Differences to v3: functional changes: - Throw an error when there is no bhyverun command (bhyve_argv == NULL) - Parse the memory size in the same way bhyve does it, and adapt the relevant code (vm_parse_memsize) from the FreeBSD source tree. Here I'm a bit unsure about attribution; the original function comes from a BSD 2-Clause Licenced file, and I'm not sure if I also have to include the BSD disclaimer to the header. - Removed capability check for clock offset - Fix a mixup of NMDM master and slave - Fixed numbering of disks. When >25 disks are given, disks after vdz/sdz no longer get added. - Fail completely should parsing fail. bugfixes: - Fix a possible Null-Pointer dereference in bhyveParseCommandLineString when no loader command is given. - Fix an off-by-one in the string allocation (bhyve_parse_command.c:60) style: - Fix some indentation - Move else-clauses on the same line as the closing bracket from the if Link to v3: https://www.redhat.com/archives/libvir-list/2016-June/msg01741.html Link to v2: https://www.redhat.com/archives/libvir-list/2016-June/msg00728.html Link to v1: https://www.redhat.com/archives/libvir-list/2016-June/msg00001.html Fabian Freyer (6): config-post.h: define __GNUC_PREREQ if not defined gnulib: add getopt module bhyve: implement virConnectDomainXMLFromNative bhyve: implement bhyve argument parser bhyve: implement argument parser for loader Add some tests for bhyveParseCommandLineString bootstrap.conf | 1 + config-post.h | 18 + m4/virt-driver-bhyve.m4 | 3 + po/POTFILES.in | 1 + src/Makefile.am | 2 + src/bhyve/bhyve_driver.c | 42 + src/bhyve/bhyve_parse_command.c | 892 +++++++++++++++++++++ src/bhyve/bhyve_parse_command.h | 30 + tests/Makefile.am | 23 +- .../bhyveargv2xmldata/bhyveargv2xml-acpiapic.args | 9 + tests/bhyveargv2xmldata/bhyveargv2xml-acpiapic.xml | 20 + tests/bhyveargv2xmldata/bhyveargv2xml-ahci-hd.args | 8 + tests/bhyveargv2xmldata/bhyveargv2xml-ahci-hd.xml | 21 + tests/bhyveargv2xmldata/bhyveargv2xml-base.args | 7 + tests/bhyveargv2xmldata/bhyveargv2xml-base.xml | 16 + .../bhyveargv2xml-bhyveload-bootorder.args | 13 + .../bhyveargv2xml-bhyveload-bootorder.xml | 27 + .../bhyveargv2xml-bhyveload-custom.args | 11 + .../bhyveargv2xml-bhyveload-custom.xml | 18 + .../bhyveargv2xml-bhyveload-mem-mismatch.args | 12 + .../bhyveargv2xml-bhyveload-memsize-fail.args | 12 + .../bhyveargv2xml-bhyveload-name-mismatch.args | 12 + .../bhyveargv2xml-bhyveload-vda.args | 12 + .../bhyveargv2xml-bhyveload-vda.xml | 21 + .../bhyveargv2xml-bhyverun-mem-mismatch.args | 12 + .../bhyveargv2xml-bhyverun-name-mismatch.args | 12 + tests/bhyveargv2xmldata/bhyveargv2xml-cdrom.args | 8 + tests/bhyveargv2xmldata/bhyveargv2xml-cdrom.xml | 21 + tests/bhyveargv2xmldata/bhyveargv2xml-console.args | 10 + tests/bhyveargv2xmldata/bhyveargv2xml-console.xml | 28 + .../bhyveargv2xmldata/bhyveargv2xml-console2.args | 10 + tests/bhyveargv2xmldata/bhyveargv2xml-console2.xml | 15 + .../bhyveargv2xmldata/bhyveargv2xml-console3.args | 11 + tests/bhyveargv2xmldata/bhyveargv2xml-console3.xml | 27 + .../bhyveargv2xmldata/bhyveargv2xml-console4.args | 10 + tests/bhyveargv2xmldata/bhyveargv2xml-console4.xml | 15 + .../bhyveargv2xml-custom-loader.args | 8 + .../bhyveargv2xml-custom-loader.xml | 18 + .../bhyveargv2xml-disk-toomany.args | 34 + .../bhyveargv2xml-disk-toomany.xml | 146 ++++ .../bhyveargv2xmldata/bhyveargv2xml-extraargs.args | 8 + .../bhyveargv2xml-memsize-fail.args | 7 + .../bhyveargv2xml-memsize-human.args | 7 + .../bhyveargv2xml-memsize-human.xml | 16 + .../bhyveargv2xml-memsize-large.args | 7 + .../bhyveargv2xml-memsize-large.xml | 16 + tests/bhyveargv2xmldata/bhyveargv2xml-name.args | 7 + tests/bhyveargv2xmldata/bhyveargv2xml-name.xml | 16 + tests/bhyveargv2xmldata/bhyveargv2xml-oneline.args | 1 + tests/bhyveargv2xmldata/bhyveargv2xml-oneline.xml | 16 + tests/bhyveargv2xmldata/bhyveargv2xml-utc.args | 8 + tests/bhyveargv2xmldata/bhyveargv2xml-utc.xml | 16 + tests/bhyveargv2xmldata/bhyveargv2xml-uuid.args | 8 + tests/bhyveargv2xmldata/bhyveargv2xml-uuid.xml | 16 + tests/bhyveargv2xmldata/bhyveargv2xml-uuid2.args | 8 + tests/bhyveargv2xmldata/bhyveargv2xml-vcpus.args | 7 + tests/bhyveargv2xmldata/bhyveargv2xml-vcpus.xml | 16 + .../bhyveargv2xml-virtio-blk.args | 8 + .../bhyveargv2xmldata/bhyveargv2xml-virtio-blk.xml | 21 + .../bhyveargv2xml-virtio-net.args | 9 + .../bhyveargv2xmldata/bhyveargv2xml-virtio-net.xml | 26 + .../bhyveargv2xml-virtio-net2.args | 8 + .../bhyveargv2xml-virtio-net2.xml | 16 + .../bhyveargv2xml-virtio-net3.args | 8 + .../bhyveargv2xml-virtio-net3.xml | 16 + .../bhyveargv2xml-virtio-net4.args | 8 + .../bhyveargv2xml-virtio-net4.xml | 21 + tests/bhyveargv2xmlmock.c | 27 + tests/bhyveargv2xmltest.c | 213 +++++ 69 files changed, 2174 insertions(+), 3 deletions(-) create mode 100644 src/bhyve/bhyve_parse_command.c create mode 100644 src/bhyve/bhyve_parse_command.h create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-acpiapic.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-acpiapic.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-ahci-hd.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-ahci-hd.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-base.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-base.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-bhyveload-bootorder.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-bhyveload-bootorder.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-bhyveload-custom.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-bhyveload-custom.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-bhyveload-mem-mismatch.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-bhyveload-memsize-fail.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-bhyveload-name-mismatch.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-bhyveload-vda.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-bhyveload-vda.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-bhyverun-mem-mismatch.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-bhyverun-name-mismatch.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-cdrom.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-cdrom.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-console.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-console.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-console2.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-console2.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-console3.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-console3.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-console4.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-console4.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-custom-loader.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-custom-loader.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-disk-toomany.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-disk-toomany.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-extraargs.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-memsize-fail.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-memsize-human.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-memsize-human.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-memsize-large.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-memsize-large.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-name.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-name.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-oneline.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-oneline.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-utc.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-utc.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-uuid.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-uuid.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-uuid2.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-vcpus.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-vcpus.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-virtio-blk.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-virtio-blk.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-virtio-net.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-virtio-net.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-virtio-net2.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-virtio-net2.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-virtio-net3.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-virtio-net3.xml create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-virtio-net4.args create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-virtio-net4.xml create mode 100644 tests/bhyveargv2xmlmock.c create mode 100644 tests/bhyveargv2xmltest.c -- 2.5.5
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list