[PATCH 00/14] Snapshot definition cleanups
by Peter Krempa
Cleanup patches extracted from my upcoming series for handling snapshots
with outsourced storage.
Peter Krempa (14):
virDomainDiskDefFormat: Refactor to virXMLFormatElement
qemuSnapshotDiskPrepareActiveExternal: Handle only external snapshots
qemuSnapshotCreateAlignDisks: Rewrite logic for selecting default
memory snapshot mode
virDomainSnapshotDiskDefParseXML: Automatically free temporary
variables and remove cleanup
virStorageSource: Convert 'type' to proper enum
conf: Move definition of 'virDomainSnapshotLocation'
Rename VIR_DOMAIN_SNAPSHOT_LOCATION_NONE to
VIR_DOMAIN_SNAPSHOT_LOCATION_NO
qemuDomainSnapshotForEachQcow2Raw: Act only on internal snapshots
conf: snapshot: Remove VIR_DOMAIN_SNAPSHOT_PARSE_DISKS flag
virDomainSnapshotDefParse: Refactor cleanup
virDomainSnapshotDefParse: Avoid 'memoryfile' temporary variable
virDomainSnapshotDefParse: Decouple parsing of memory snapshot config
conf: snapshot: Use proper types for snapshot location
qemuSnapshotCreateActiveExternal: Remove duplicit assignment
src/ch/ch_monitor.c | 1 +
src/conf/domain_conf.c | 122 ++++++------
src/conf/domain_conf.h | 14 +-
src/conf/domain_validate.c | 2 +-
src/conf/snapshot_conf.c | 255 ++++++++++++--------------
src/conf/snapshot_conf.h | 23 +--
src/conf/storage_source_conf.h | 2 +-
src/libvirt_private.syms | 4 +-
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_driver.c | 1 -
src/qemu/qemu_snapshot.c | 23 ++-
src/test/test_driver.c | 7 +-
src/vbox/vbox_common.c | 4 +-
src/vz/vz_driver.c | 2 +-
src/vz/vz_sdk.c | 2 +-
tests/qemudomainsnapshotxml2xmltest.c | 2 +-
16 files changed, 221 insertions(+), 245 deletions(-)
--
2.35.1
2 years, 9 months
[PATCH 00/10] qemu: Update capabilities and use 'tls-hostname' field for NBD
by Peter Krempa
Technically patch 7/10 is more of a RFC for now as my migration setup
doesn't work properly so I could not test it.
Peter Krempa (10):
tests: qemucapabilities: Update caps_7.0.0.x86_64
qemu: capabilities: Introduce QEMU_CAPS_BLOCKDEV_NBD_TLS_HOSTNAME
qemuMigrationSrcRun: Fix misleading comment about NBD with TLS support
storage_source: Add 'tlsHostname' field to virStorageSource
qemu: Add support for 'tlsHostname' setting of virStorageSource
conf: Add support for setting expected TLS hostname for NBD disks
qemu: migration: Use 'VIR_MIGRATE_PARAM_TLS_DESTINATION' for the NBD
connection
NEWS: Mention that VIR_MIGRATE_PARAM_TLS_DESTINATION works now for
non-shared storage migration
qemuMigrationSrcNBDStorageCopyOne: Refactor cleanup
qemuBlockJobDiskNew: Remove misleading return value description
NEWS.rst | 6 +
docs/formatdomain.rst | 4 +-
docs/schemas/domaincommon.rng | 3 +
src/conf/domain_conf.c | 3 +
src/conf/storage_source_conf.c | 2 +
src/conf/storage_source_conf.h | 3 +
src/qemu/qemu_block.c | 6 +-
src/qemu/qemu_blockjob.c | 2 -
src/qemu/qemu_capabilities.c | 4 +
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_domain.c | 15 +
src/qemu/qemu_migration.c | 46 +-
src/qemu/qemu_migration_params.c | 17 +
src/qemu/qemu_migration_params.h | 3 +
.../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 1 +
.../caps_7.0.0.x86_64.replies | 2202 +++++++++--------
.../caps_7.0.0.x86_64.xml | 43 +-
...work-tlsx509-nbd-hostname.x86_64-6.2.0.err | 1 +
...rk-tlsx509-nbd-hostname.x86_64-latest.args | 38 +
.../disk-network-tlsx509-nbd-hostname.xml | 31 +
tests/qemuxml2argvtest.c | 2 +
...ork-tlsx509-nbd-hostname.x86_64-latest.xml | 37 +
tests/qemuxml2xmltest.c | 1 +
23 files changed, 1390 insertions(+), 1083 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-network-tlsx509-nbd-hostname.x86_64-6.2.0.err
create mode 100644 tests/qemuxml2argvdata/disk-network-tlsx509-nbd-hostname.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-network-tlsx509-nbd-hostname.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-network-tlsx509-nbd-hostname.x86_64-latest.xml
--
2.35.1
2 years, 9 months
[libvirt PATCH 0/2] nwfilter: switch nwfilter list from array to hash
by Daniel P. Berrangé
Currently the virNWFilterObjList has O(N) complexity for
object lookup and requires taking locks on every object
examined.
This switches to as hash table which O(1) complexity and
lockless lookup.
Daniel P. Berrangé (2):
nwfilter: update comment about locking filter updates
conf: use a hash table for storing nwfilter object list
src/conf/virnwfilterobj.c | 264 +++++++++++++++++--------
src/nwfilter/nwfilter_gentech_driver.c | 51 +++--
2 files changed, 217 insertions(+), 98 deletions(-)
--
2.35.1
2 years, 9 months
[PATCH] virsh: fflush(stdout) after fputs()
by Michal Privoznik
We are not guaranteed that the string we are printing onto stdout
contains '\n' and thus that the stdout is flushed. In fact, I've
met this problem when virsh asked me whether I want to edit the
domain XML again (vshAskReedit()) but the prompt wasn't displayed
(as it does not contain a newline character) and virsh just sat
there waiting for my input, I sat there waiting for virsh's
output. Flush stdout after all fputs()-s which do not flush
stdout.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tools/vsh.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/vsh.c b/tools/vsh.c
index bbde594967..499794c8fc 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -1863,6 +1863,7 @@ vshDebug(vshControl *ctl, int level, const char *format, ...)
str = g_strdup_vprintf(format, ap);
va_end(ap);
fputs(str, stdout);
+ fflush(stdout);
}
void
@@ -1878,6 +1879,7 @@ vshPrintExtra(vshControl *ctl, const char *format, ...)
str = g_strdup_vprintf(format, ap);
va_end(ap);
fputs(str, stdout);
+ fflush(stdout);
}
@@ -1891,6 +1893,7 @@ vshPrint(vshControl *ctl G_GNUC_UNUSED, const char *format, ...)
str = g_strdup_vprintf(format, ap);
va_end(ap);
fputs(str, stdout);
+ fflush(stdout);
}
@@ -2938,6 +2941,7 @@ vshReadline(vshControl *ctl G_GNUC_UNUSED,
int len;
fputs(prompt, stdout);
+ fflush(stdout);
r = fgets(line, sizeof(line), stdin);
if (r == NULL) return NULL; /* EOF */
--
2.34.1
2 years, 9 months
[PATCH] conf: remove misleading comments about access being 'lockless'
by Daniel P. Berrangé
For the various structs storing lists of objects, the access
to the hash tables is not lockless. The mutex on the object
owning the hash table must be held.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/conf/virdomainobjlist.c | 4 ++--
src/conf/virinterfaceobj.c | 2 +-
src/conf/virnodedeviceobj.c | 2 +-
src/conf/virnwfilterbindingobjlist.c | 2 +-
src/conf/virsecretobj.c | 2 +-
src/conf/virstorageobj.c | 10 +++++-----
6 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c
index 70b73e87ec..66bd4bcba7 100644
--- a/src/conf/virdomainobjlist.c
+++ b/src/conf/virdomainobjlist.c
@@ -46,11 +46,11 @@ struct _virDomainObjList {
virObjectRWLockable parent;
/* uuid string -> virDomainObj mapping
- * for O(1), lockless lookup-by-uuid */
+ * for O(1), lookup-by-uuid */
GHashTable *objs;
/* name -> virDomainObj mapping for O(1),
- * lockless lookup-by-name */
+ * lookup-by-name */
GHashTable *objsName;
};
diff --git a/src/conf/virinterfaceobj.c b/src/conf/virinterfaceobj.c
index 62b21b5e5f..95279d5b1c 100644
--- a/src/conf/virinterfaceobj.c
+++ b/src/conf/virinterfaceobj.c
@@ -44,7 +44,7 @@ struct _virInterfaceObjList {
virObjectRWLockable parent;
/* name string -> virInterfaceObj mapping
- * for O(1), lockless lookup-by-name */
+ * for O(1), lookup-by-name */
GHashTable *objsName;
};
diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index ba84dce82b..fd23ea5fc7 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -48,7 +48,7 @@ struct _virNodeDeviceObjList {
virObjectRWLockable parent;
/* name string -> virNodeDeviceObj mapping
- * for O(1), lockless lookup-by-name */
+ * for O(1), lookup-by-name */
GHashTable *objs;
};
diff --git a/src/conf/virnwfilterbindingobjlist.c b/src/conf/virnwfilterbindingobjlist.c
index 03441c9c1b..53713d815a 100644
--- a/src/conf/virnwfilterbindingobjlist.c
+++ b/src/conf/virnwfilterbindingobjlist.c
@@ -39,7 +39,7 @@ struct _virNWFilterBindingObjList {
virObjectRWLockable parent;
/* port dev name -> virNWFilterBindingObj mapping
- * for O(1), lockless lookup-by-port dev */
+ * for O(1), lookup-by-port dev */
GHashTable *objs;
};
diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c
index ed62856d61..92985c4b63 100644
--- a/src/conf/virsecretobj.c
+++ b/src/conf/virsecretobj.c
@@ -54,7 +54,7 @@ struct _virSecretObjList {
virObjectRWLockable parent;
/* uuid string -> virSecretObj mapping
- * for O(1), lockless lookup-by-uuid */
+ * for O(1), lookup-by-uuid */
GHashTable *objs;
};
diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
index d527132184..b57c1cb8b2 100644
--- a/src/conf/virstorageobj.c
+++ b/src/conf/virstorageobj.c
@@ -66,15 +66,15 @@ struct _virStorageVolObjList {
virObjectRWLockable parent;
/* key string -> virStorageVolObj mapping
- * for (1), lockless lookup-by-key */
+ * for (1), lookup-by-key */
GHashTable *objsKey;
/* name string -> virStorageVolObj mapping
- * for (1), lockless lookup-by-name */
+ * for (1), lookup-by-name */
GHashTable *objsName;
/* path string -> virStorageVolObj mapping
- * for (1), lockless lookup-by-path */
+ * for (1), lookup-by-path */
GHashTable *objsPath;
};
@@ -98,11 +98,11 @@ struct _virStoragePoolObjList {
virObjectRWLockable parent;
/* uuid string -> virStoragePoolObj mapping
- * for (1), lockless lookup-by-uuid */
+ * for (1), lookup-by-uuid */
GHashTable *objs;
/* name string -> virStoragePoolObj mapping
- * for (1), lockless lookup-by-name */
+ * for (1), lookup-by-name */
GHashTable *objsName;
};
--
2.35.1
2 years, 9 months
[PATCH] run: include 'src' in $PATH for the daemons
by Daniel P. Berrangé
Currently the 'run' script modifies $PATH to add the 'tools'
directly to pick up client programs. It fails to add the 'src'
directory to pick up the daemons.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
run.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/run.in b/run.in
index 174b191675..3be7818d32 100644
--- a/run.in
+++ b/run.in
@@ -70,6 +70,7 @@ env = os.environ
prepend(env, "LD_LIBRARY_PATH", os.path.join(here, "src"))
prepend(env, "PKG_CONFIG_PATH", os.path.join(here, "src"))
prepend(env, "PATH", os.path.join(here, "tools"))
+prepend(env, "PATH", os.path.join(here, "src"))
# Ensure that any 3rd party apps using libvirt.so from the build tree get
# files resolved to the build/source tree too. Typically useful for language
--
2.35.1
2 years, 9 months
[PATCH] run: gracefully handle SIGHUP, SIGQUIT, SIGTERM
by Daniel P. Berrangé
When using thue 'run' script to launch a daemon, it is intended to
temporarily stop the systemd units and re-start them again after.
When using this script over an SSH connection, it will get SIGHUP
if the connection goes away, and in this case it fails to re-start
the systemd units. We need to catch SIGHUP and turn it into a
normal python exception. For good measure we do the same for
SIGQUIT and SIGTERM too. SIGINT already gets turned into an
exception by default which we handle.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
run.in | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/run.in b/run.in
index 3be7818d32..c6d3411082 100644
--- a/run.in
+++ b/run.in
@@ -43,6 +43,7 @@
import os
import os.path
import random
+import signal
import sys
import subprocess
@@ -155,6 +156,13 @@ else:
print("Temporarily stopping systemd units...")
stopped_units = []
+ def sighandler(signum, frame):
+ raise OSError("Signal %d received, terminating" % signum)
+
+ signal.signal(signal.SIGHUP, sighandler)
+ signal.signal(signal.SIGTERM, sighandler)
+ signal.signal(signal.SIGQUIT, sighandler)
+
try:
for unit in try_stop_units:
print(" > %s" % unit)
@@ -167,6 +175,8 @@ else:
ret = subprocess.call(args, env=env)
except KeyboardInterrupt:
pass
+ except Exception as e:
+ print("%s" % e, file=sys.stderr)
finally:
print("Re-starting original systemd units...")
stopped_units.reverse()
--
2.35.1
2 years, 9 months
[libvirt PATCH] news: Document that we build with musl
by Martin Kletzander
A bit of effort by me and Michal helped make this the case, and it helped us
uncover some potential issues. I am not documenting it as supported or adding
an Alpine container into the CI, but since there were some distribution bugs
mentioning libvirt issues I thing it would be nice of us to notify those
distribution maintainers that read our release news.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
NEWS.rst | 3 +++
1 file changed, 3 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index a5b6106bc2c2..f0270b9bb159 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -21,6 +21,9 @@ v8.2.0 (unreleased)
* **Bug fixes**
+ * Both build and tests should now pass on Alpine Linux or any other
+ distribution with musl libc.
+
v8.1.0 (2022-03-01)
===================
--
2.35.1
2 years, 9 months
[libvirt PATCH 00/12] Automatic mutex management - part 4
by Tim Wiederhake
Use the recently implemented VIR_LOCK_GUARD and VIR_WITH_MUTEX_LOCK_GUARD
to simplify mutex management.
Tim Wiederhake (12):
nwfilter_driver: Statically initialize mutex
nwfilter_driver: Split up nwfilterStateCleanup
nwfilter_driver: Use automatic mutex management
nwfilter_gentech: Use automatic mutex management
nwfilter_dhcpsnoop: Replace virNWFilterSnoopActiveLock macros
nwfilter_dhcpsnoop: Replace virNWFilterSnoopLock macros
nwfilter_dhcpsnoop: Replace virNWFilterSnoopReqLock functions
nwfilter_learnipaddr: Use automatic mutex management
nwfilter_ipaddrmap: Use automatic mutex management
virnetlink: Use automatic memory management
remote_daemon_stream: Use automatic memory management
qemu_conf: Use automatic memory management
src/conf/nwfilter_ipaddrmap.c | 80 ++---
src/conf/virnwfilterobj.h | 1 -
src/nwfilter/nwfilter_dhcpsnoop.c | 393 ++++++++-----------------
src/nwfilter/nwfilter_driver.c | 175 +++++------
src/nwfilter/nwfilter_gentech_driver.c | 34 +--
src/nwfilter/nwfilter_learnipaddr.c | 83 ++----
src/qemu/qemu_conf.c | 70 ++---
src/remote/remote_daemon_stream.c | 34 +--
src/util/virnetlink.c | 101 +++----
9 files changed, 357 insertions(+), 614 deletions(-)
--
2.31.1
2 years, 9 months
[libvirt PATCH v3] qemu: support multiqueue for vdpa net device
by Jonathon Jongsma
The vdpa device supports multiqueue, so remove the restriction from
qemuDomainValidateActualNetDef() that prevents us from using this
functionality.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2024406
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
Changes in v3:
- Do not set the model type in virDomainNetDefParseXML(). Other virtio devices
require the model to be explicitly set to 'virtio' in the xml definition in
order to parse the virtio driver options, and it doesn't make sense to treat
the vdpa device differently. If we want this behavior to change, it should
probably be changed so that it applies to all devices that default to a
virtio device model.
Changes in v2:
- remove error message in virDomainNetDefParseXML(). The model is already
checked in the post parse validation step.
src/qemu/qemu_domain.c | 3 +-
.../net-vdpa-multiqueue.x86_64-latest.args | 36 +++++++++++++++++++
.../qemuxml2argvdata/net-vdpa-multiqueue.xml | 30 ++++++++++++++++
tests/qemuxml2argvtest.c | 1 +
.../net-vdpa-multiqueue.xml | 36 +++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
6 files changed, 106 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/net-vdpa-multiqueue.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/net-vdpa-multiqueue.xml
create mode 100644 tests/qemuxml2xmloutdata/net-vdpa-multiqueue.xml
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index acc76c1cd6..6b61fefb8f 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4523,7 +4523,8 @@ qemuDomainValidateActualNetDef(const virDomainNetDef *net,
actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
actualType == VIR_DOMAIN_NET_TYPE_DIRECT ||
actualType == VIR_DOMAIN_NET_TYPE_ETHERNET ||
- actualType == VIR_DOMAIN_NET_TYPE_VHOSTUSER)) {
+ actualType == VIR_DOMAIN_NET_TYPE_VHOSTUSER ||
+ actualType == VIR_DOMAIN_NET_TYPE_VDPA)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("interface %s - multiqueue is not supported for network interfaces of type %s"),
macstr, virDomainNetTypeToString(actualType));
diff --git a/tests/qemuxml2argvdata/net-vdpa-multiqueue.x86_64-latest.args b/tests/qemuxml2argvdata/net-vdpa-multiqueue.x86_64-latest.args
new file mode 100644
index 0000000000..26ef666036
--- /dev/null
+++ b/tests/qemuxml2argvdata/net-vdpa-multiqueue.x86_64-latest.args
@@ -0,0 +1,36 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-x86_64 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-accel tcg \
+-cpu qemu64 \
+-m 214 \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-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 \
+-no-acpi \
+-boot strict=on \
+-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
+-add-fd set=0,fd=1732,opaque=net0-vdpa \
+-netdev vhost-vdpa,vhostdev=/dev/fdset/0,id=hostnet0 \
+-device '{"driver":"virtio-net-pci","mq":true,"vectors":6,"netdev":"hostnet0","id":"net0","mac":"52:54:00:95:db:c0","bus":"pci.0","addr":"0x2"}' \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/net-vdpa-multiqueue.xml b/tests/qemuxml2argvdata/net-vdpa-multiqueue.xml
new file mode 100644
index 0000000000..6e369c1916
--- /dev/null
+++ b/tests/qemuxml2argvdata/net-vdpa-multiqueue.xml
@@ -0,0 +1,30 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <interface type='vdpa'>
+ <mac address='52:54:00:95:db:c0'/>
+ <source dev='/dev/vhost-vdpa-0'/>
+ <model type='virtio'/>
+ <driver queues='2'/>
+ </interface>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index ce475df466..7e1167e60e 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1609,6 +1609,7 @@ mymain(void)
DO_TEST_FAILURE("net-hostdev-fail",
QEMU_CAPS_DEVICE_VFIO_PCI);
DO_TEST_CAPS_LATEST("net-vdpa");
+ DO_TEST_CAPS_LATEST("net-vdpa-multiqueue");
DO_TEST("hostdev-pci-multifunction",
QEMU_CAPS_KVM,
diff --git a/tests/qemuxml2xmloutdata/net-vdpa-multiqueue.xml b/tests/qemuxml2xmloutdata/net-vdpa-multiqueue.xml
new file mode 100644
index 0000000000..0876d5df62
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/net-vdpa-multiqueue.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <interface type='vdpa'>
+ <mac address='52:54:00:95:db:c0'/>
+ <source dev='/dev/vhost-vdpa-0'/>
+ <model type='virtio'/>
+ <driver queues='2'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </interface>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 052950b86f..2174965784 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -485,6 +485,7 @@ mymain(void)
DO_TEST_NOCAPS("net-coalesce");
DO_TEST_NOCAPS("net-many-models");
DO_TEST("net-vdpa", QEMU_CAPS_NETDEV_VHOST_VDPA);
+ DO_TEST("net-vdpa-multiqueue", QEMU_CAPS_NETDEV_VHOST_VDPA);
DO_TEST_NOCAPS("serial-tcp-tlsx509-chardev");
DO_TEST_NOCAPS("serial-tcp-tlsx509-chardev-notls");
--
2.35.1
2 years, 9 months