[libvirt] [PATCH] tests: Add newlines with VIR_TEST_REGENERATE_OUTPUT
by Cole Robinson
Since test files are formatted predictably nowadays, we can make
VIR_TEST_REGENERATE_OUTPUT handle most cases for us with a simple
replacement. test-wrap-argv.pl is still canon, but this bit makes
it easier to confirm test output changes during active development.
---
tests/testutils.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/testutils.c b/tests/testutils.c
index 857e819..6487a62 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -598,6 +598,7 @@ virtTestCompareToFile(const char *strcontent,
int ret = -1;
char *filecontent = NULL;
char *fixedcontent = NULL;
+ char *regencontent = NULL;
bool regenerate = !!virTestGetFlag("VIR_TEST_REGENERATE_OUTPUT");
if (virtTestLoadFile(filename, &filecontent) < 0 && !regenerate)
@@ -613,7 +614,10 @@ virtTestCompareToFile(const char *strcontent,
if (STRNEQ_NULLABLE(fixedcontent ? fixedcontent : strcontent,
filecontent)) {
if (regenerate) {
- if (virFileWriteStr(filename, strcontent, 0666) < 0)
+ if (!(regencontent = virStringReplace(strcontent, " -", " \\\n-")))
+ goto failure;
+
+ if (virFileWriteStr(filename, regencontent, 0666) < 0)
goto failure;
goto out;
}
@@ -626,6 +630,7 @@ virtTestCompareToFile(const char *strcontent,
failure:
VIR_FREE(fixedcontent);
VIR_FREE(filecontent);
+ VIR_FREE(regencontent);
return ret;
}
--
2.5.0
8 years, 10 months
[libvirt] [PATCH] qemu: Fix return value of qemuDomainGetBlockJobInfo
by Michal Privoznik
While reviewing 1b43885d1784640 I've noticed a virReportError()
followed by a goto endjob; without setting the correct return
value. Problem is, if block job is so fast that it's bandwidth
does not fit into ulong, an error is reported. However, by that
time @ret is already set to 1 which means success. Since the
scenario can be hardly considered successful, we should return a
value meaning error.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 304165c..1161aa0 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16546,6 +16546,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
virReportError(VIR_ERR_OVERFLOW,
_("bandwidth %llu cannot be represented in result"),
rawInfo.bandwidth);
+ ret = -1;
goto endjob;
}
--
2.4.10
8 years, 10 months
[libvirt] [PATCH] qemu: Fix all callers of qemuMonitorGetBlockJobInfo()
by Andrea Bolognani
Commit 1b43885 modified one of the callers of this function to take
into account the possible return value of 0 when the block job can't be
found.
This commit finishes the job by updating the remaining caller.
---
src/qemu/qemu_driver.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 304165c..c4573d9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16150,14 +16150,13 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
rc = qemuMonitorGetBlockJobInfo(priv->mon, disk->info.alias, &info);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto cleanup;
- if (rc < 0)
+ if (rc <= 0)
goto cleanup;
- if (rc == 1 &&
- (info.ready == 1 ||
- (info.ready == -1 &&
- info.end == info.cur &&
- (info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY ||
- info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT))))
+ if (info.ready == 1 ||
+ (info.ready == -1 &&
+ info.end == info.cur &&
+ (info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY ||
+ info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT)))
disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY;
}
--
2.5.0
8 years, 10 months
[libvirt] [PATCH] rbd: Return VIR_STORAGE_FILE_RAW as format for RBD volumes
by Wido den Hollander
This used to return 'unkown' and that was not correct.
A vol-dumpxml now returns:
<volume type='network'>
<name>image3</name>
<key>libvirt/image3</key>
<source>
</source>
<capacity unit='bytes'>10737418240</capacity>
<allocation unit='bytes'>10737418240</allocation>
<target>
<path>libvirt/image3</path>
<format type='raw'/>
</target>
</volume>
The RBD driver will now error out if a different format than RAW
is provided when creating a volume.
Signed-off-by: Wido den Hollander <wido(a)widodh.nl>
---
src/conf/storage_conf.c | 3 ++-
src/storage/storage_backend_rbd.c | 13 +++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 9b8abea..7c81bab 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -220,7 +220,8 @@ static virStoragePoolTypeInfo poolTypeInfo[] = {
},
.volOptions = {
.defaultFormat = VIR_STORAGE_FILE_RAW,
- .formatToString = virStoragePoolFormatDiskTypeToString,
+ .formatFromString = virStorageVolumeFormatFromString,
+ .formatToString = virStorageFileFormatTypeToString,
}
},
{.poolType = VIR_STORAGE_POOL_SHEEPDOG,
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index cdbfdee..80684eb 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -306,6 +306,7 @@ static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
vol->target.capacity = info.size;
vol->target.allocation = info.obj_size * info.num_objs;
vol->type = VIR_STORAGE_VOL_NETWORK;
+ vol->target.format = VIR_STORAGE_FILE_RAW;
VIR_FREE(vol->target.path);
if (virAsprintf(&vol->target.path, "%s/%s",
@@ -557,6 +558,12 @@ virStorageBackendRBDCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
{
vol->type = VIR_STORAGE_VOL_NETWORK;
+ if (vol->target.format != VIR_STORAGE_FILE_RAW) {
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("only RAW volumes are supported by this storage pool"));
+ return -VIR_ERR_NO_SUPPORT;
+ }
+
VIR_FREE(vol->target.path);
if (virAsprintf(&vol->target.path, "%s/%s",
pool->def->source.name,
@@ -603,6 +610,12 @@ virStorageBackendRBDBuildVol(virConnectPtr conn,
goto cleanup;
}
+ if (vol->target.format != VIR_STORAGE_FILE_RAW) {
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("only RAW volumes are supported by this storage pool"));
+ goto cleanup;
+ }
+
if (virStorageBackendRBDOpenRADOSConn(&ptr, conn, &pool->def->source) < 0)
goto cleanup;
--
1.9.1
8 years, 10 months
[libvirt] [PATCH 0/3] Various Valgrind fixes
by Michael Chapman
Valgrind reported a couple of memory leaks and jumps conditional on
uninitialized values.
Happy New Year!
Michael Chapman (3):
qemu: do not copy out non-existent block job info
qemu: do not leak NBD disk data in migration cookie
storage: do not leak storage pool XML filename
src/qemu/qemu_driver.c | 4 ++--
src/qemu/qemu_migration.c | 5 +++--
src/storage/storage_driver.c | 10 +++++-----
3 files changed, 10 insertions(+), 9 deletions(-)
--
2.4.3
8 years, 10 months
[libvirt] [libvirt-glib][PATCH] libvirt-glib-1.0.pc.in: Correctly mark variable
by Michal Privoznik
In the pkg-config file for libvirt-glib we have a typo:
Libs.private: @LIBVIRT_LIBS @GLIB2_LIBS@
Noticed the missing '@' after LIBVIRT_LIBS? Well, I just did.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
libvirt-glib-1.0.pc.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt-glib-1.0.pc.in b/libvirt-glib-1.0.pc.in
index 1e8956d..d00be9f 100644
--- a/libvirt-glib-1.0.pc.in
+++ b/libvirt-glib-1.0.pc.in
@@ -8,5 +8,5 @@ Version: @VERSION@
Description: libvirt glib library
Requires: glib-2.0
Libs: -L${libdir} -lvirt-glib-1.0
-Libs.private: @LIBVIRT_LIBS @GLIB2_LIBS@
+Libs.private: @LIBVIRT_LIBS@ @GLIB2_LIBS@
Cflags: -I${includedir}/libvirt-glib-1.0 @LIBVIRT_CFLAGS@ @GLIB2_CFLAGS@
--
2.4.10
8 years, 10 months
[libvirt] Non-contiguous NUMA cell numbers
by Andrea Bolognani
Hi all,
libvirt currently doesn't allow you to configure a guest with something
like
<cpu>
<topology sockets='2' cores='5' threads='8'/>
<numa>
<cell id='0' cpus='0-39' memory='1048576' unit='KiB'/>
<cell id='16' cpus='40-79' memory='1048576' unit='KiB'/>
</numa>
</cpu>
with the following error:
XML error: Exactly one 'cell' element per guest NUMA cell allowed,
non-contiguous ranges or ranges not starting from 0 are not allowed
The error message is very specific about not allowing gaps in NUMA cell
numbering; however, on the very same host, I have
$ numactl --hard | head -1
available: 4 nodes (0-1,16-17)
so gaps in numbering are definitely possible, at least on ppc64.
Should we consider relaxing this requirement and allow
arbitrarily-numbered NUMA cells? Is there a specific reason why it was
forbidden in the first place?
Cheers.
--
Andrea Bolognani
Software Engineer - Virtualization Team
8 years, 10 months
[libvirt] [PATCH v8 0/5] Partial posting of updates to Add quorum to libvirt
by John Ferlan
I took a few cycles to reformat the initial 5 patches of the add quorum
support posted as a v7 here:
http://www.redhat.com/archives/libvir-list/2015-December/msg00119.html
These patches are easily separable from the rest of the series. Rather
than see things linger for months on end, trying to make small leaps.
Changes in the series are to reorder things slightly, follow some of the
review comments from previous series, and a few other things along the
way. I've looked at this way too long to - hopefully I haven't missed
anything. Most I forget... One I do remember is the virStorageSourceCopy
changes in patch 5 where I believe the "Get" and "Set" wanted to use the
'i' index rather than having the "Get" use the 'i' and the "Set" always
use '0'.
Matthias Gatto (5):
virstoragefile: Add helper to get storage source backingStore
virstoragefile: Add helper to set storage source backingStore
virstoragefile: Use helper to get storage source backing store
virstoragefile: Use helper to set storage source backing store
virstoragefile: Convert storage source backingStore into backingStores
src/conf/domain_conf.c | 25 +++++----
src/conf/storage_conf.c | 29 ++++++-----
src/libvirt_private.syms | 2 +
src/qemu/qemu_cgroup.c | 6 ++-
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_driver.c | 35 ++++++++-----
src/qemu/qemu_monitor_json.c | 4 +-
src/security/security_dac.c | 3 +-
src/security/security_selinux.c | 5 +-
src/security/virt-aa-helper.c | 2 +-
src/storage/storage_backend.c | 34 +++++++-----
src/storage/storage_backend_fs.c | 46 +++++++++-------
src/storage/storage_backend_gluster.c | 11 ++--
src/storage/storage_backend_logical.c | 15 ++++--
src/storage/storage_driver.c | 3 +-
src/util/virstoragefile.c | 98 ++++++++++++++++++++++++++++++-----
src/util/virstoragefile.h | 10 +++-
tests/virstoragetest.c | 18 +++----
18 files changed, 243 insertions(+), 105 deletions(-)
--
2.5.0
8 years, 10 months
[libvirt] [PATCH] tests: Make test-wrap-argv.pl executable
by Michal Privoznik
While 'perl test-wrap-argv.pl' is not too long,
'./test-wrap-argv.pl' is shorter.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/test-wrap-argv.pl | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 tests/test-wrap-argv.pl
diff --git a/tests/test-wrap-argv.pl b/tests/test-wrap-argv.pl
old mode 100644
new mode 100755
--
2.4.10
8 years, 11 months
[libvirt] [PATCH] bhyve: bhyveload: respect boot dev and boot order
by Roman Bogorodskiy
Make bhyveload respect boot order as specified by os.boot section of the
domain XML or by "boot order" for specific devices. As bhyve does not
support a real boot order specification right now, it's just about
choosing a single device to boot from.
---
src/bhyve/bhyve_command.c | 49 ++++++++++++++++++++--
.../bhyvexml2argv-bhyveload-bootorder.args | 10 +++++
.../bhyvexml2argv-bhyveload-bootorder.ldargs | 3 ++
.../bhyvexml2argv-bhyveload-bootorder.xml | 30 +++++++++++++
.../bhyvexml2argv-bhyveload-bootorder1.args | 10 +++++
.../bhyvexml2argv-bhyveload-bootorder1.ldargs | 3 ++
.../bhyvexml2argv-bhyveload-bootorder1.xml | 29 +++++++++++++
.../bhyvexml2argv-bhyveload-bootorder2.args | 9 ++++
.../bhyvexml2argv-bhyveload-bootorder2.ldargs | 3 ++
.../bhyvexml2argv-bhyveload-bootorder2.xml | 24 +++++++++++
.../bhyvexml2argv-bhyveload-bootorder3.args | 10 +++++
.../bhyvexml2argv-bhyveload-bootorder3.ldargs | 3 ++
.../bhyvexml2argv-bhyveload-bootorder3.xml | 30 +++++++++++++
tests/bhyvexml2argvtest.c | 4 ++
14 files changed, 214 insertions(+), 3 deletions(-)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.xml
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index 6576029..1e5d4c7 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -522,6 +522,48 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
return cmd;
}
+static virDomainDiskDefPtr
+virBhyveGetBootDisk(virConnectPtr conn, virDomainDefPtr def)
+{
+ size_t i;
+ virDomainDiskDefPtr match = NULL;
+ int best_index = INT_MAX;
+ int boot_cdrom = 0, boot_disk = 0;
+
+ if (def->ndisks == 0)
+ return NULL;
+
+ for (i = 0; i < def->os.nBootDevs; i++) {
+ switch (def->os.bootDevs[i]) {
+ case VIR_DOMAIN_BOOT_CDROM:
+ boot_cdrom = i;
+ break;
+ case VIR_DOMAIN_BOOT_DISK:
+ boot_disk = i;
+ break;
+ }
+ }
+
+ for (i = 0; i < def->ndisks; i++) {
+ int bootIndex;
+ if (!virBhyveUsableDisk(conn, def->disks[i]))
+ continue;
+
+ bootIndex = def->disks[i]->info.bootIndex;
+ if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
+ bootIndex += boot_cdrom;
+ else if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK)
+ bootIndex += boot_disk;
+
+ if (bootIndex < best_index) {
+ best_index = bootIndex;
+ match = def->disks[i];
+ }
+ }
+
+ return match;
+}
+
virCommandPtr
virBhyveProcessBuildLoadCmd(virConnectPtr conn, virDomainDefPtr def,
const char *devmap_file, char **devicesmap_out)
@@ -535,10 +577,11 @@ virBhyveProcessBuildLoadCmd(virConnectPtr conn, virDomainDefPtr def,
}
if (def->os.bootloader == NULL) {
- disk = def->disks[0];
+ disk = virBhyveGetBootDisk(conn, def);
- if (!virBhyveUsableDisk(conn, disk))
- return NULL;
+ if (disk == NULL)
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("no bootable disks found"));
return virBhyveProcessBuildBhyveloadCmd(def, disk);
} else if (strstr(def->os.bootloader, "grub-bhyve") != NULL) {
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.args b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.args
new file mode 100644
index 0000000..01a0290
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.args
@@ -0,0 +1,10 @@
+/usr/sbin/bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
+-s 2:0,ahci-hd,/tmp/freebsd.img \
+-s 4:0,ahci-cd,/tmp/cdrom.iso bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.ldargs
new file mode 100644
index 0000000..24e0bc2
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.ldargs
@@ -0,0 +1,3 @@
+/usr/sbin/bhyveload \
+-m 214 \
+-d /tmp/cdrom.iso bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.xml
new file mode 100644
index 0000000..487caf0
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.xml
@@ -0,0 +1,30 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ <boot dev='cdrom'/>
+ <boot dev='hd'/>
+ </os>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <disk type='file' device='cdrom'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/cdrom.iso'/>
+ <target dev='hda' bus='sata'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </disk>
+ <interface type='bridge'>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.args b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.args
new file mode 100644
index 0000000..01a0290
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.args
@@ -0,0 +1,10 @@
+/usr/sbin/bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
+-s 2:0,ahci-hd,/tmp/freebsd.img \
+-s 4:0,ahci-cd,/tmp/cdrom.iso bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.ldargs
new file mode 100644
index 0000000..32538b5
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.ldargs
@@ -0,0 +1,3 @@
+/usr/sbin/bhyveload \
+-m 214 \
+-d /tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.xml
new file mode 100644
index 0000000..6ea4631
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.xml
@@ -0,0 +1,29 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <disk type='file' device='cdrom'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/cdrom.iso'/>
+ <target dev='hda' bus='sata'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </disk>
+ <interface type='bridge'>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.args b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.args
new file mode 100644
index 0000000..88de179
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.args
@@ -0,0 +1,9 @@
+/usr/sbin/bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
+-s 2:0,ahci-hd,/tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.ldargs
new file mode 100644
index 0000000..32538b5
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.ldargs
@@ -0,0 +1,3 @@
+/usr/sbin/bhyveload \
+-m 214 \
+-d /tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.xml
new file mode 100644
index 0000000..f086a9e
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder2.xml
@@ -0,0 +1,24 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ <boot dev='cdrom'/>
+ <boot dev='hd'/>
+ </os>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <interface type='bridge'>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.args b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.args
new file mode 100644
index 0000000..01a0290
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.args
@@ -0,0 +1,10 @@
+/usr/sbin/bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
+-s 2:0,ahci-hd,/tmp/freebsd.img \
+-s 4:0,ahci-cd,/tmp/cdrom.iso bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.ldargs
new file mode 100644
index 0000000..24e0bc2
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.ldargs
@@ -0,0 +1,3 @@
+/usr/sbin/bhyveload \
+-m 214 \
+-d /tmp/cdrom.iso bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.xml
new file mode 100644
index 0000000..c3edcdf
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.xml
@@ -0,0 +1,30 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <boot order='2'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <disk type='file' device='cdrom'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/cdrom.iso'/>
+ <target dev='hda' bus='sata'/>
+ <boot order='1'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </disk>
+ <interface type='bridge'>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
index 3e57a78..bea4caa 100644
--- a/tests/bhyvexml2argvtest.c
+++ b/tests/bhyvexml2argvtest.c
@@ -130,6 +130,10 @@ mymain(void)
DO_TEST("grub-defaults");
DO_TEST("grub-bootorder");
DO_TEST("grub-bootorder2");
+ DO_TEST("bhyveload-bootorder");
+ DO_TEST("bhyveload-bootorder1");
+ DO_TEST("bhyveload-bootorder2");
+ DO_TEST("bhyveload-bootorder3");
DO_TEST("bhyveload-explicitargs");
DO_TEST("custom-loader");
DO_TEST("disk-cdrom-grub");
--
2.4.6
8 years, 11 months