diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-vmport-opt.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-vmport-opt.args
new file mode 100644
index 0000000000..ea1a11f528
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-vmport-opt.args
@@ -0,0 +1,6 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu \
+-S -machine pc,accel=tcg,vmport=off -m 214 -smp 1 -nographic \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
+-hda /dev/HostVG/QEMUGuest1 -net none -serial \
+none -parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-vmport-opt.xml b/tests/qemuxml2argvdata/qemuxml2argv-machine-vmport-opt.xml
new file mode 100644
index 0000000000..671d3a991f
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-vmport-opt.xml
@@ -0,0 +1,28 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219100
+ 219100
+ 1
+
+ hvm
+
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-xen-vmport-opt.xml b/tests/qemuxml2argvdata/qemuxml2argv-machine-xen-vmport-opt.xml
new file mode 100644
index 0000000000..4466d1a367
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-xen-vmport-opt.xml
@@ -0,0 +1,27 @@
+
+ XenGuest2
+ c7a5fdb2-cdaf-9455-926a-d65c16db1809
+ 592896
+ 403456
+ 1
+
+ hvm
+ /usr/lib/xen/boot/hvmloader
+
+
+
+
+
+
+
+
+
+
+
+ destroy
+ restart
+ restart
+
+ /usr/lib/xen/bin/qemu-dm
+
+
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 4acaa11b88..4678261bce 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -594,6 +594,10 @@ mymain(void)
DO_TEST_FAILURE("machine-core-on", QEMU_CAPS_MACHINE_OPT);
DO_TEST("machine-usb-opt", QEMU_CAPS_MACHINE_OPT,
QEMU_CAPS_MACHINE_USB_OPT);
+ DO_TEST("machine-vmport-opt", QEMU_CAPS_MACHINE_OPT,
+ QEMU_CAPS_MACHINE_VMPORT_OPT);
+ DO_TEST_FAILURE("machine-xen-vmport-opt", QEMU_CAPS_MACHINE_OPT,
+ QEMU_CAPS_MACHINE_VMPORT_OPT);
DO_TEST("kvm", QEMU_CAPS_MACHINE_OPT);
DO_TEST("boot-cdrom", NONE);
DO_TEST("boot-network", NONE);