diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.x86_64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.x86_64-latest.args
new file mode 100644
index 0000000000..e883ce10cc
--- /dev/null
+++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.x86_64-latest.args
@@ -0,0 +1,33 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-q35-test \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-q35-test/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-q35-test/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-q35-test/.config \
+/usr/bin/qemu-system-x86_64 \
+-name guest=q35-test,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-q35-test/master-key.aes"}' \
+-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-accel tcg \
+-cpu qemu64 \
+-m size=2097152k \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":2147483648}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-global ICH9-LPC.noreboot=off \
+-watchdog-action reset \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.x86_64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.x86_64-latest.xml
new file mode 100644
index 0000000000..11ca806c63
--- /dev/null
+++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.x86_64-latest.xml
@@ -0,0 +1,30 @@
+
+ q35-test
+ 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774
+ 2097152
+ 2097152
+ 1
+
+ hvm
+
+
+
+ qemu64
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-x86_64
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.xml b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.xml
new file mode 100644
index 0000000000..d89dc4afe8
--- /dev/null
+++ b/tests/qemuxmlconfdata/usb-controller-automatic-unavailable-q35.xml
@@ -0,0 +1,20 @@
+
+ q35-test
+ 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774
+ 2097152
+ 2097152
+ 1
+
+ hvm
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-x86_64
+
+
+
+
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index e693a3fc7c..c9706db664 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -1822,12 +1822,21 @@ mymain(void)
ARG_CAPS_VER, "latest",
ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST,
ARG_END);
+ /* q35 fails instead */
DO_TEST_FULL("usb-controller-default-unavailable-q35", ".x86_64-latest",
ARG_CAPS_ARCH, "x86_64",
ARG_CAPS_VER, "latest",
ARG_FLAGS, FLAG_EXPECT_FAILURE,
ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST,
ARG_END);
+ /* However, if the USB controller is the one that gets added
+ * automatically for every guest instead of one that the user has
+ * explicitly asked for, we prefer simply skipping it */
+ DO_TEST_FULL("usb-controller-automatic-unavailable-q35", ".x86_64-latest",
+ ARG_CAPS_ARCH, "x86_64",
+ ARG_CAPS_VER, "latest",
+ ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_LAST,
+ ARG_END);
DO_TEST_CAPS_LATEST("usb-none");