[libvirt PATCH] rpm: Don't require qemu-img at build time
by Andrea Bolognani
It's not used as part of the build process or even searched for
at build time. The QEMU driver detects its path at runtime.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
libvirt.spec.in | 2 --
1 file changed, 2 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index c542ec3b2b..69cafc8b91 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -310,8 +310,6 @@ BuildRequires: util-linux
%if %{with_qemu}
# For managing ACLs
BuildRequires: libacl-devel
-# From QEMU RPMs
-BuildRequires: /usr/bin/qemu-img
%endif
# For LVM drivers
BuildRequires: lvm2
--
2.40.1
1 year, 6 months
[PATCH 0/2] Fix mocking around networkxml2firewalltest
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (2):
util: include virfirewall.h in virfirewalld.h
virfirewallmock: Replace virFindFileInPath() with
virFirewallDIsRegistered()
src/util/virfirewalld.h | 2 ++
tests/virfirewallmock.c | 16 ++++------------
2 files changed, 6 insertions(+), 12 deletions(-)
--
2.39.2
1 year, 6 months
[RFC PATCH] hostdev:Introduce vDPA device to hostdev subsystem as a new subtype
by libai
The following is the xml of vdpa device:
<devices>
<hostdev mode='subsystem' type='vdpa'>
<source dev='/dev/vhost-vdpa-0'/>
</hostdev>
</devices>
And the command line passed to QEMU is as follows:
-device {"driver":"vhost-vdpa-device-pci","vhostdev":"/dev/vhost-vdpa-0"}
This solution is selected according to the previous discussion
on the solution of supporting the vDPA device.
For details, see the following:
https://listman.redhat.com/archives/libvir-list/2023-March/239018.html
Signed-off-by: libai <libai12(a)huawei.com>
---
src/conf/domain_audit.c | 4 +++
src/conf/domain_conf.c | 47 +++++++++++++++++++++++++++++++++
src/conf/domain_conf.h | 6 +++++
src/conf/domain_validate.c | 1 +
src/conf/virconftypes.h | 2 ++
src/qemu/qemu_command.c | 19 +++++++++++++
src/qemu/qemu_command.h | 3 +++
src/qemu/qemu_domain.c | 6 +++++
src/qemu/qemu_hotplug.c | 1 +
src/qemu/qemu_migration.c | 2 ++
src/qemu/qemu_validate.c | 2 ++
src/security/security_dac.c | 2 ++
src/security/security_selinux.c | 2 ++
13 files changed, 97 insertions(+)
diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index ae875188bd..6906ce7ade 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -344,6 +344,7 @@ virDomainAuditHostdev(virDomainObj *vm, virDomainHostdevDef *hostdev,
virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi;
virDomainHostdevSubsysSCSIVHost *hostsrc = &hostdev->source.subsys.u.scsi_host;
virDomainHostdevSubsysMediatedDev *mdevsrc = &hostdev->source.subsys.u.mdev;
+ virDomainHostdevSubsysVDPA *vdpasrc = &hostdev->source.subsys.u.vdpa;
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
@@ -383,6 +384,9 @@ virDomainAuditHostdev(virDomainObj *vm, virDomainHostdevDef *hostdev,
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
address = g_strdup(mdevsrc->uuidstr);
break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ address = g_strdup(vdpasrc->devpath);
+ break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
default:
VIR_WARN("Unexpected hostdev type while encoding audit message: %d",
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b03a3ff011..e8f6d1457b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1047,6 +1047,7 @@ VIR_ENUM_IMPL(virDomainHostdevSubsys,
"scsi",
"scsi_host",
"mdev",
+ "vdpa",
);
VIR_ENUM_IMPL(virDomainHostdevSubsysPCIBackend,
@@ -2641,6 +2642,9 @@ virDomainHostdevDefClear(virDomainHostdevDef *def)
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
g_clear_pointer(&def->source.subsys.u.pci.origstates, virBitmapFree);
break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ VIR_FREE(def->source.subsys.u.vdpa.devpath);
+ break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
@@ -6160,6 +6164,22 @@ virDomainHostdevSubsysMediatedDevDefParseXML(virDomainHostdevDef *def,
return 0;
}
+static int
+virDomainHostdevSubsysVDPADefParseXML(xmlNodePtr sourcenode,
+ virDomainHostdevDef *def)
+{
+ g_autofree char *devpath = NULL;
+ virDomainHostdevSubsysVDPA *vdpa = &def->source.subsys.u.vdpa;
+
+ if(!(devpath = virXMLPropString(sourcenode, "dev"))) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Missing 'dev' attribute for element <source>"));
+ return -1;
+ }
+ vdpa->devpath = g_steal_pointer(&devpath);
+ return 0;
+}
+
static int
virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
xmlXPathContextPtr ctxt,
@@ -6317,6 +6337,11 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
if (virDomainHostdevSubsysMediatedDevDefParseXML(def, ctxt) < 0)
return -1;
break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ if (virDomainHostdevSubsysVDPADefParseXML(sourcenode, def) < 0) {
+ return -1;
+ }
+ break;
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -12979,6 +13004,7 @@ virDomainHostdevDefParseXML(virDomainXMLOption *xmlopt,
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
break;
}
@@ -14101,6 +14127,13 @@ virDomainHostdevMatchSubsys(virDomainHostdevDef *a,
return 0;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
return virDomainHostdevMatchSubsysMediatedDev(a, b);
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ if (STREQ(a->source.subsys.u.vdpa.devpath,
+ b->source.subsys.u.vdpa.devpath)) {
+ return 1;
+ } else {
+ return 0;
+ }
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
return 0;
}
@@ -23290,6 +23323,16 @@ virDomainHostdevDefFormatSubsysMdev(virBuffer *buf,
virXMLFormatElement(buf, "source", NULL, &sourceChildBuf);
}
+static void
+virDomainHostdevDefFormatSubsysVDPA(virBuffer *buf,
+ virDomainHostdevDef *def)
+{
+ g_auto(virBuffer) sourceAttrBuf = VIR_BUFFER_INITIALIZER;
+ virDomainHostdevSubsysVDPA *vdpasrc = &def->source.subsys.u.vdpa;
+ virBufferAsprintf(&sourceAttrBuf, " dev='%s'", vdpasrc->devpath);
+ virXMLFormatElement(buf, "source", &sourceAttrBuf, NULL);
+}
+
static int
virDomainHostdevDefFormatSubsys(virBuffer *buf,
@@ -23317,6 +23360,10 @@ virDomainHostdevDefFormatSubsys(virBuffer *buf,
virDomainHostdevDefFormatSubsysMdev(buf, def);
return 0;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ virDomainHostdevDefFormatSubsysVDPA(buf, def);
+ return 0;
+
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
default:
virReportEnumRangeError(virDomainHostdevSubsysType, def->source.subsys.type);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 511067a050..ade8b0edec 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -197,6 +197,7 @@ typedef enum {
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI,
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST,
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV,
+ VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA,
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST
} virDomainHostdevSubsysType;
@@ -289,6 +290,10 @@ struct _virDomainHostdevSubsysMediatedDev {
virTristateSwitch ramfb;
};
+struct _virDomainHostdevSubsysVDPA {
+ char *devpath; /* vDPA device path */
+};
+
typedef enum {
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_NONE,
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_VHOST,
@@ -323,6 +328,7 @@ struct _virDomainHostdevSubsys {
virDomainHostdevSubsysSCSI scsi;
virDomainHostdevSubsysSCSIVHost scsi_host;
virDomainHostdevSubsysMediatedDev mdev;
+ virDomainHostdevSubsysVDPA vdpa;
} u;
};
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index e04b85fee4..4af84c4f0c 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -2214,6 +2214,7 @@ virDomainHostdevDefValidate(const virDomainHostdevDef *hostdev)
}
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
break;
}
diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h
index e07f967814..1756c54e7a 100644
--- a/src/conf/virconftypes.h
+++ b/src/conf/virconftypes.h
@@ -120,6 +120,8 @@ typedef struct _virDomainHostdevSubsys virDomainHostdevSubsys;
typedef struct _virDomainHostdevSubsysMediatedDev virDomainHostdevSubsysMediatedDev;
+typedef struct _virDomainHostdevSubsysVDPA virDomainHostdevSubsysVDPA;
+
typedef struct _virDomainHostdevSubsysPCI virDomainHostdevSubsysPCI;
typedef struct _virDomainHostdevSubsysSCSI virDomainHostdevSubsysSCSI;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 4ca93bf3dc..121214f4d5 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4958,6 +4958,18 @@ qemuBuildHostdevMediatedDevProps(const virDomainDef *def,
return g_steal_pointer(&props);
}
+virJSONValue *
+qemuBuildHostdevVDPADevProps(virDomainHostdevDef *dev)
+{
+ g_autoptr(virJSONValue) props = NULL;
+ virDomainHostdevSubsysVDPA *vdpasrc = &dev->source.subsys.u.vdpa;
+ if (virJSONValueObjectAdd(&props,
+ "s:driver", "vhost-vdpa-device-pci",
+ "s:vhostdev", vdpasrc->devpath,
+ NULL) < 0)
+ return NULL;
+ return g_steal_pointer(&props);
+}
qemuBlockStorageSourceAttachData *
qemuBuildHostdevSCSIDetachPrepare(virDomainHostdevDef *hostdev,
@@ -5154,6 +5166,13 @@ qemuBuildHostdevCommandLine(virCommand *cmd,
return -1;
break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ if (!(devprops = qemuBuildHostdevVDPADevProps(hostdev)))
+ return -1;
+ if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCaps) < 0)
+ return -1;
+ break;
+
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
break;
}
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 5fdb138030..dff18350b5 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -198,6 +198,9 @@ virJSONValue *
qemuBuildHostdevMediatedDevProps(const virDomainDef *def,
virDomainHostdevDef *dev);
+virJSONValue *
+qemuBuildHostdevVDPADevProps(virDomainHostdevDef *dev);
+
virJSONValue *
qemuBuildRedirdevDevProps(const virDomainDef *def,
virDomainRedirdevDef *dev);
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 63b13b6875..0cd485a459 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -10533,6 +10533,8 @@ qemuDomainGetHostdevPath(virDomainHostdevDef *dev,
virDomainHostdevSubsysSCSI *scsisrc = &dev->source.subsys.u.scsi;
virDomainHostdevSubsysSCSIVHost *hostsrc = &dev->source.subsys.u.scsi_host;
virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev;
+ virDomainHostdevSubsysVDPA *vdpasrc = &dev->source.subsys.u.vdpa;
+
g_autoptr(virUSBDevice) usb = NULL;
g_autoptr(virSCSIDevice) scsi = NULL;
g_autoptr(virSCSIVHostDevice) host = NULL;
@@ -10603,6 +10605,10 @@ qemuDomainGetHostdevPath(virDomainHostdevDef *dev,
if (!(tmpPath = virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuidstr)))
return -1;
+ perm = VIR_CGROUP_DEVICE_RW;
+ break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ tmpPath = g_strdup(vdpasrc->devpath);
perm = VIR_CGROUP_DEVICE_RW;
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 5072798cb7..7d89899223 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -4546,6 +4546,7 @@ qemuDomainRemoveHostDevice(virQEMUDriver *driver,
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
qemuDomainRemoveMediatedDevice(driver, vm, hostdev);
break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
break;
}
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index ed41a03851..9220ef1ab1 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1295,6 +1295,8 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def)
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
+ /* The vDPA devices don't support migration for now */
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot migrate a domain with <hostdev mode='subsystem' type='%1$s'>"),
virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index b8d5e9bd74..ea3d4e1a39 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -2566,6 +2566,8 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHostdevDef *hostdev,
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
return qemuValidateDomainMdevDef(hostdev, def, qemuCaps);
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
default:
virReportEnumRangeError(virDomainHostdevSubsysType,
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index c7dc145621..24f3de5d15 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -1313,6 +1313,7 @@ virSecurityDACSetHostdevLabel(virSecurityManager *mgr,
break;
}
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
ret = 0;
break;
@@ -1469,6 +1470,7 @@ virSecurityDACRestoreHostdevLabel(virSecurityManager *mgr,
break;
}
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
ret = 0;
break;
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index e3e6a6115f..5cb6612fbc 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -2265,6 +2265,7 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityManager *mgr,
break;
}
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
ret = 0;
break;
@@ -2493,6 +2494,7 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecurityManager *mgr,
break;
}
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
ret = 0;
break;
--
2.33.0
1 year, 7 months
[libvirt PATCH 0/5] qemu: Find helpers at runtime
by Andrea Bolognani
This removes the need to have them present in the build environment
and makes things more flexible.
Note that we currently *do not* have the helpers available in most CI
environments, or have BuildRequires for them in the spec file. That
only works for Fedora and RHEL because the hardcoded fallback paths
happen to match those used on those distributions: everywhere else,
the choice is to either ensure that the additional packages are
installed in the build environment or to produce a build of libvirt
that can't use the corresponding features out of the box.
Andrea Bolognani (5):
util: Small refactor
util: Introduce virFileFindInPathFull()
qemu: Find helpers at runtime
meson: Stop looking for QEMU helpers
qemu: Update documentation for qemu.conf keys
meson.build | 24 ---------------
src/libvirt_private.syms | 1 +
src/qemu/qemu.conf.in | 8 +++--
src/qemu/qemu_conf.c | 4 +++
src/qemu/qemu_interface.c | 15 ++++++++--
src/qemu/qemu_process.c | 17 ++++++++---
src/qemu/test_libvirtd_qemu.aug.in | 4 +--
src/util/virfile.c | 47 ++++++++++++++++++++++++++----
src/util/virfile.h | 3 ++
9 files changed, 83 insertions(+), 40 deletions(-)
--
2.40.1
1 year, 7 months
[PATCH 0/3] Audio test cleanups
by Peter Krempa
Few things I've cleaned up before realizing that:
https://gitlab.com/libvirt/libvirt/-/issues/473
can't really be solved without qemu assistance.
Peter Krempa (3):
qemuxml2xmlout: Replace symlinks of all 'audio-' tests by real files
qemuxml2argvtest: Use real caps instead of fake caps for
'audio-default-*' cases
qemuxml2xmltest: Modernize all 'audio-' cases
...gs => audio-default-sdl.x86_64-4.2.0.args} | 6 +-
... => audio-default-spice.x86_64-4.2.0.args} | 6 +-
...gs => audio-default-vnc.x86_64-4.2.0.args} | 6 +-
tests/qemuxml2argvtest.c | 6 +-
.../audio-alsa-best.x86_64-latest.xml | 46 ++++++++++++++
tests/qemuxml2xmloutdata/audio-alsa-best.xml | 1 -
.../audio-alsa-full.x86_64-latest.xml | 46 ++++++++++++++
tests/qemuxml2xmloutdata/audio-alsa-full.xml | 1 -
.../audio-alsa-minimal.x86_64-latest.xml | 39 ++++++++++++
.../qemuxml2xmloutdata/audio-alsa-minimal.xml | 1 -
.../audio-coreaudio-best.x86_64-latest.xml | 46 ++++++++++++++
.../audio-coreaudio-best.xml | 1 -
.../audio-coreaudio-full.x86_64-latest.xml | 46 ++++++++++++++
.../audio-coreaudio-full.xml | 1 -
.../audio-coreaudio-minimal.x86_64-latest.xml | 39 ++++++++++++
.../audio-coreaudio-minimal.xml | 1 -
.../audio-file-best.x86_64-latest.xml | 46 ++++++++++++++
tests/qemuxml2xmloutdata/audio-file-best.xml | 1 -
.../audio-file-full.x86_64-latest.xml | 46 ++++++++++++++
tests/qemuxml2xmloutdata/audio-file-full.xml | 1 -
.../audio-file-minimal.x86_64-latest.xml | 39 ++++++++++++
.../qemuxml2xmloutdata/audio-file-minimal.xml | 1 -
.../audio-jack-full.x86_64-latest.xml | 46 ++++++++++++++
tests/qemuxml2xmloutdata/audio-jack-full.xml | 1 -
.../audio-many-backends.x86_64-latest.xml | 61 ++++++++++++++++++-
.../audio-none-best.x86_64-latest.xml | 46 ++++++++++++++
tests/qemuxml2xmloutdata/audio-none-best.xml | 1 -
.../audio-none-full.x86_64-latest.xml | 46 ++++++++++++++
tests/qemuxml2xmloutdata/audio-none-full.xml | 1 -
.../audio-none-minimal.x86_64-latest.xml | 39 ++++++++++++
.../qemuxml2xmloutdata/audio-none-minimal.xml | 1 -
.../audio-oss-best.x86_64-latest.xml | 46 ++++++++++++++
tests/qemuxml2xmloutdata/audio-oss-best.xml | 1 -
.../audio-oss-full.x86_64-latest.xml | 46 ++++++++++++++
tests/qemuxml2xmloutdata/audio-oss-full.xml | 1 -
.../audio-oss-minimal.x86_64-latest.xml | 39 ++++++++++++
.../qemuxml2xmloutdata/audio-oss-minimal.xml | 1 -
.../audio-pulseaudio-best.x86_64-latest.xml | 46 ++++++++++++++
.../audio-pulseaudio-best.xml | 1 -
.../audio-pulseaudio-full.x86_64-latest.xml | 46 ++++++++++++++
.../audio-pulseaudio-full.xml | 1 -
...audio-pulseaudio-minimal.x86_64-latest.xml | 39 ++++++++++++
.../audio-pulseaudio-minimal.xml | 1 -
.../audio-sdl-best.x86_64-latest.xml | 46 ++++++++++++++
tests/qemuxml2xmloutdata/audio-sdl-best.xml | 1 -
.../audio-sdl-full.x86_64-latest.xml | 46 ++++++++++++++
tests/qemuxml2xmloutdata/audio-sdl-full.xml | 1 -
.../audio-sdl-minimal.x86_64-latest.xml | 39 ++++++++++++
.../qemuxml2xmloutdata/audio-sdl-minimal.xml | 1 -
.../audio-spice-best.x86_64-latest.xml | 53 ++++++++++++++++
tests/qemuxml2xmloutdata/audio-spice-best.xml | 1 -
.../audio-spice-full.x86_64-latest.xml | 53 ++++++++++++++++
tests/qemuxml2xmloutdata/audio-spice-full.xml | 1 -
.../audio-spice-minimal.x86_64-latest.xml | 46 ++++++++++++++
.../audio-spice-minimal.xml | 1 -
tests/qemuxml2xmltest.c | 56 ++++++++---------
56 files changed, 1215 insertions(+), 66 deletions(-)
rename tests/qemuxml2argvdata/{audio-default-sdl.args => audio-default-sdl.x86_64-4.2.0.args} (86%)
rename tests/qemuxml2argvdata/{audio-default-spice.args => audio-default-spice.x86_64-4.2.0.args} (86%)
rename tests/qemuxml2argvdata/{audio-default-vnc.args => audio-default-vnc.x86_64-4.2.0.args} (86%)
create mode 100644 tests/qemuxml2xmloutdata/audio-alsa-best.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-alsa-best.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-alsa-full.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-alsa-full.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-alsa-minimal.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-alsa-minimal.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-coreaudio-best.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-coreaudio-best.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-coreaudio-full.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-coreaudio-full.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-coreaudio-minimal.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-coreaudio-minimal.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-file-best.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-file-best.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-file-full.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-file-full.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-file-minimal.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-file-minimal.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-jack-full.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-jack-full.xml
mode change 120000 => 100644 tests/qemuxml2xmloutdata/audio-many-backends.x86_64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-none-best.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-none-best.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-none-full.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-none-full.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-none-minimal.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-none-minimal.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-oss-best.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-oss-best.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-oss-full.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-oss-full.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-oss-minimal.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-oss-minimal.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-pulseaudio-best.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-pulseaudio-best.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-pulseaudio-full.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-pulseaudio-full.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-pulseaudio-minimal.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-pulseaudio-minimal.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-sdl-best.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-sdl-best.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-sdl-full.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-sdl-full.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-sdl-minimal.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-sdl-minimal.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-spice-best.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-spice-best.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-spice-full.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-spice-full.xml
create mode 100644 tests/qemuxml2xmloutdata/audio-spice-minimal.x86_64-latest.xml
delete mode 120000 tests/qemuxml2xmloutdata/audio-spice-minimal.xml
--
2.40.1
1 year, 7 months
[PATCH 0/5] qemu: Clean up testing of sound devices and implement 'multichannel' support for 'usb-audio'
by Peter Krempa
Peter Krempa (5):
docs: formatdomain: Use code blocks to emphasize various sound device
options
qemuxml2(argv|xml)test: Remove 'sound' case
qemuxml2(argv|xml)test: Modernize 'sound-device' case
conf: Register autoptr cleanup for 'virDomainSoundDef' and refactor
virDomainSoundDefParseXML
conf: qemu: Add support for multi-channel mode for 'usb' sound cards
docs/formatdomain.rst | 55 ++++++++++---------
src/conf/domain_conf.c | 42 ++++++++++----
src/conf/domain_conf.h | 5 ++
src/conf/schemas/domaincommon.rng | 5 ++
src/qemu/qemu_command.c | 3 +
...ce.args => sound-device.x86_64-4.2.0.args} | 13 ++---
.../sound-device.x86_64-latest.args | 50 +++++++++++++++++
tests/qemuxml2argvdata/sound-device.xml | 12 +---
tests/qemuxml2argvdata/sound.args | 37 -------------
tests/qemuxml2argvdata/sound.xml | 34 ------------
tests/qemuxml2argvtest.c | 8 +--
...ice.xml => sound-device.x86_64-latest.xml} | 17 +++---
tests/qemuxml2xmloutdata/sound.xml | 43 ---------------
tests/qemuxml2xmltest.c | 8 +--
14 files changed, 142 insertions(+), 190 deletions(-)
rename tests/qemuxml2argvdata/{sound-device.args => sound-device.x86_64-4.2.0.args} (80%)
create mode 100644 tests/qemuxml2argvdata/sound-device.x86_64-latest.args
delete mode 100644 tests/qemuxml2argvdata/sound.args
delete mode 100644 tests/qemuxml2argvdata/sound.xml
rename tests/qemuxml2xmloutdata/{sound-device.xml => sound-device.x86_64-latest.xml} (82%)
delete mode 100644 tests/qemuxml2xmloutdata/sound.xml
--
2.40.0
1 year, 7 months
[PATCH] qemu: Report domain name in unexpectedly closed monitor message
by Michal Privoznik
When QEMU closes the monitor suddenly, the following error
message is reported:
internal error: qemu unexpectedly closed the monitor: ...
And this works. But other error messages produced in the same
function include domain name too. Do that for the unexpectedly
closed monitor message too.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_monitor.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 71ebd356ad..dacf161971 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -513,15 +513,18 @@ qemuMonitorIO(GSocket *socket G_GNUC_UNUSED,
if (error || mon->goteof) {
if (hangup && mon->logFunc != NULL) {
+ g_autofree char *errmsg = NULL;
+
/* Check if an error message from qemu is available and if so, use
* it to overwrite the actual message. It's done only in early
* startup phases or during incoming migration when the message
* from qemu is certainly more interesting than a
* "connection reset by peer" message.
*/
- mon->logFunc(mon,
- _("qemu unexpectedly closed the monitor"),
- mon->logOpaque);
+
+ errmsg = g_strdup_printf(_("QEMU unexpectedly closed the monitor (vm='%1$s')"),
+ mon->domainName);
+ mon->logFunc(mon, errmsg, mon->logOpaque);
virCopyLastError(&mon->lastError);
virResetLastError();
}
--
2.39.3
1 year, 7 months
[PATCH] logging: Provide empty VIRTLOGD_ARGS in the unit file
by Michal Privoznik
For all our daemons, we provide VIRXXXD_ARGS env var in the unit
file. The variable can then be overridden in corresponding file:
EnvironmentFile=-@initconfdir@/virtxxxd
The daemon is then executed as:
ExecStart=@sbindir@/virtxxxd $VIRTXXXD_ARGS
But virlogd is exception, for no good reason. And while there are
probably no arguments we want to pass to virtlogd by default,
just mimic what we do for say virtlockd, where we also don't pass
any default argument.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/logging/virtlogd.service.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/logging/virtlogd.service.in b/src/logging/virtlogd.service.in
index 158124e4d3..e4aecd46a7 100644
--- a/src/logging/virtlogd.service.in
+++ b/src/logging/virtlogd.service.in
@@ -7,6 +7,7 @@ Documentation=man:virtlogd(8)
Documentation=https://libvirt.org
[Service]
+Environment=VIRTLOGD_ARGS=
EnvironmentFile=-@initconfdir@/virtlogd
ExecStart=@sbindir@/virtlogd $VIRTLOGD_ARGS
ExecReload=/bin/kill -USR1 $MAINPID
--
2.39.3
1 year, 7 months
[RFC PATCH] hostdev:Introduce vDPA device to hostdev subsystem as a new subtype
by libai
The following is the xml of vdpa device:
<devices>
<hostdev mode='subsystem' type='vdpa'>
<source dev='/dev/vhost-vdpa-0'/>
</hostdev>
</devices>
And the command line passed to QEMU is as follows:
-device {"driver":"vhost-vdpa-device-pci","vhostdev":"/dev/vhost-vdpa-0"}
This solution is selected according to the previous discussion
on the solution of supporting the vDPA device.
For details, see the following:
https://listman.redhat.com/archives/libvir-list/2023-March/239018.html
Signed-off-by: libai <libai12(a)huawei.com>
---
src/conf/domain_audit.c | 4 +++
src/conf/domain_conf.c | 47 +++++++++++++++++++++++++++++++++
src/conf/domain_conf.h | 6 +++++
src/conf/domain_validate.c | 1 +
src/conf/virconftypes.h | 2 ++
src/qemu/qemu_command.c | 19 +++++++++++++
src/qemu/qemu_command.h | 3 +++
src/qemu/qemu_domain.c | 6 +++++
src/qemu/qemu_hotplug.c | 1 +
src/qemu/qemu_migration.c | 2 ++
src/qemu/qemu_validate.c | 2 ++
src/security/security_dac.c | 2 ++
src/security/security_selinux.c | 2 ++
13 files changed, 97 insertions(+)
diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index ae875188bd..6906ce7ade 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -344,6 +344,7 @@ virDomainAuditHostdev(virDomainObj *vm, virDomainHostdevDef *hostdev,
virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi;
virDomainHostdevSubsysSCSIVHost *hostsrc = &hostdev->source.subsys.u.scsi_host;
virDomainHostdevSubsysMediatedDev *mdevsrc = &hostdev->source.subsys.u.mdev;
+ virDomainHostdevSubsysVDPA *vdpasrc = &hostdev->source.subsys.u.vdpa;
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
@@ -383,6 +384,9 @@ virDomainAuditHostdev(virDomainObj *vm, virDomainHostdevDef *hostdev,
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
address = g_strdup(mdevsrc->uuidstr);
break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ address = g_strdup(vdpasrc->devpath);
+ break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
default:
VIR_WARN("Unexpected hostdev type while encoding audit message: %d",
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b03a3ff011..e8f6d1457b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1047,6 +1047,7 @@ VIR_ENUM_IMPL(virDomainHostdevSubsys,
"scsi",
"scsi_host",
"mdev",
+ "vdpa",
);
VIR_ENUM_IMPL(virDomainHostdevSubsysPCIBackend,
@@ -2641,6 +2642,9 @@ virDomainHostdevDefClear(virDomainHostdevDef *def)
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
g_clear_pointer(&def->source.subsys.u.pci.origstates, virBitmapFree);
break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ VIR_FREE(def->source.subsys.u.vdpa.devpath);
+ break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
@@ -6160,6 +6164,22 @@ virDomainHostdevSubsysMediatedDevDefParseXML(virDomainHostdevDef *def,
return 0;
}
+static int
+virDomainHostdevSubsysVDPADefParseXML(xmlNodePtr sourcenode,
+ virDomainHostdevDef *def)
+{
+ g_autofree char *devpath = NULL;
+ virDomainHostdevSubsysVDPA *vdpa = &def->source.subsys.u.vdpa;
+
+ if(!(devpath = virXMLPropString(sourcenode, "dev"))) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Missing 'dev' attribute for element <source>"));
+ return -1;
+ }
+ vdpa->devpath = g_steal_pointer(&devpath);
+ return 0;
+}
+
static int
virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
xmlXPathContextPtr ctxt,
@@ -6317,6 +6337,11 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
if (virDomainHostdevSubsysMediatedDevDefParseXML(def, ctxt) < 0)
return -1;
break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ if (virDomainHostdevSubsysVDPADefParseXML(sourcenode, def) < 0) {
+ return -1;
+ }
+ break;
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -12979,6 +13004,7 @@ virDomainHostdevDefParseXML(virDomainXMLOption *xmlopt,
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
break;
}
@@ -14101,6 +14127,13 @@ virDomainHostdevMatchSubsys(virDomainHostdevDef *a,
return 0;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
return virDomainHostdevMatchSubsysMediatedDev(a, b);
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ if (STREQ(a->source.subsys.u.vdpa.devpath,
+ b->source.subsys.u.vdpa.devpath)) {
+ return 1;
+ } else {
+ return 0;
+ }
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
return 0;
}
@@ -23290,6 +23323,16 @@ virDomainHostdevDefFormatSubsysMdev(virBuffer *buf,
virXMLFormatElement(buf, "source", NULL, &sourceChildBuf);
}
+static void
+virDomainHostdevDefFormatSubsysVDPA(virBuffer *buf,
+ virDomainHostdevDef *def)
+{
+ g_auto(virBuffer) sourceAttrBuf = VIR_BUFFER_INITIALIZER;
+ virDomainHostdevSubsysVDPA *vdpasrc = &def->source.subsys.u.vdpa;
+ virBufferAsprintf(&sourceAttrBuf, " dev='%s'", vdpasrc->devpath);
+ virXMLFormatElement(buf, "source", &sourceAttrBuf, NULL);
+}
+
static int
virDomainHostdevDefFormatSubsys(virBuffer *buf,
@@ -23317,6 +23360,10 @@ virDomainHostdevDefFormatSubsys(virBuffer *buf,
virDomainHostdevDefFormatSubsysMdev(buf, def);
return 0;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ virDomainHostdevDefFormatSubsysVDPA(buf, def);
+ return 0;
+
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
default:
virReportEnumRangeError(virDomainHostdevSubsysType, def->source.subsys.type);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 511067a050..ade8b0edec 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -197,6 +197,7 @@ typedef enum {
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI,
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST,
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV,
+ VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA,
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST
} virDomainHostdevSubsysType;
@@ -289,6 +290,10 @@ struct _virDomainHostdevSubsysMediatedDev {
virTristateSwitch ramfb;
};
+struct _virDomainHostdevSubsysVDPA {
+ char *devpath; /* vDPA device path */
+};
+
typedef enum {
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_NONE,
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_VHOST,
@@ -323,6 +328,7 @@ struct _virDomainHostdevSubsys {
virDomainHostdevSubsysSCSI scsi;
virDomainHostdevSubsysSCSIVHost scsi_host;
virDomainHostdevSubsysMediatedDev mdev;
+ virDomainHostdevSubsysVDPA vdpa;
} u;
};
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index e04b85fee4..4af84c4f0c 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -2214,6 +2214,7 @@ virDomainHostdevDefValidate(const virDomainHostdevDef *hostdev)
}
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
break;
}
diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h
index e07f967814..1756c54e7a 100644
--- a/src/conf/virconftypes.h
+++ b/src/conf/virconftypes.h
@@ -120,6 +120,8 @@ typedef struct _virDomainHostdevSubsys virDomainHostdevSubsys;
typedef struct _virDomainHostdevSubsysMediatedDev virDomainHostdevSubsysMediatedDev;
+typedef struct _virDomainHostdevSubsysVDPA virDomainHostdevSubsysVDPA;
+
typedef struct _virDomainHostdevSubsysPCI virDomainHostdevSubsysPCI;
typedef struct _virDomainHostdevSubsysSCSI virDomainHostdevSubsysSCSI;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 4ca93bf3dc..121214f4d5 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4958,6 +4958,18 @@ qemuBuildHostdevMediatedDevProps(const virDomainDef *def,
return g_steal_pointer(&props);
}
+virJSONValue *
+qemuBuildHostdevVDPADevProps(virDomainHostdevDef *dev)
+{
+ g_autoptr(virJSONValue) props = NULL;
+ virDomainHostdevSubsysVDPA *vdpasrc = &dev->source.subsys.u.vdpa;
+ if (virJSONValueObjectAdd(&props,
+ "s:driver", "vhost-vdpa-device-pci",
+ "s:vhostdev", vdpasrc->devpath,
+ NULL) < 0)
+ return NULL;
+ return g_steal_pointer(&props);
+}
qemuBlockStorageSourceAttachData *
qemuBuildHostdevSCSIDetachPrepare(virDomainHostdevDef *hostdev,
@@ -5154,6 +5166,13 @@ qemuBuildHostdevCommandLine(virCommand *cmd,
return -1;
break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ if (!(devprops = qemuBuildHostdevVDPADevProps(hostdev)))
+ return -1;
+ if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCaps) < 0)
+ return -1;
+ break;
+
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
break;
}
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 5fdb138030..dff18350b5 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -198,6 +198,9 @@ virJSONValue *
qemuBuildHostdevMediatedDevProps(const virDomainDef *def,
virDomainHostdevDef *dev);
+virJSONValue *
+qemuBuildHostdevVDPADevProps(virDomainHostdevDef *dev);
+
virJSONValue *
qemuBuildRedirdevDevProps(const virDomainDef *def,
virDomainRedirdevDef *dev);
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 63b13b6875..0cd485a459 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -10533,6 +10533,8 @@ qemuDomainGetHostdevPath(virDomainHostdevDef *dev,
virDomainHostdevSubsysSCSI *scsisrc = &dev->source.subsys.u.scsi;
virDomainHostdevSubsysSCSIVHost *hostsrc = &dev->source.subsys.u.scsi_host;
virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev;
+ virDomainHostdevSubsysVDPA *vdpasrc = &dev->source.subsys.u.vdpa;
+
g_autoptr(virUSBDevice) usb = NULL;
g_autoptr(virSCSIDevice) scsi = NULL;
g_autoptr(virSCSIVHostDevice) host = NULL;
@@ -10603,6 +10605,10 @@ qemuDomainGetHostdevPath(virDomainHostdevDef *dev,
if (!(tmpPath = virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuidstr)))
return -1;
+ perm = VIR_CGROUP_DEVICE_RW;
+ break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ tmpPath = g_strdup(vdpasrc->devpath);
perm = VIR_CGROUP_DEVICE_RW;
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 5072798cb7..7d89899223 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -4546,6 +4546,7 @@ qemuDomainRemoveHostDevice(virQEMUDriver *driver,
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
qemuDomainRemoveMediatedDevice(driver, vm, hostdev);
break;
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
break;
}
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index ed41a03851..9220ef1ab1 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1295,6 +1295,8 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def)
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
+ /* The vDPA devices don't support migration for now */
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot migrate a domain with <hostdev mode='subsystem' type='%1$s'>"),
virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index b8d5e9bd74..ea3d4e1a39 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -2566,6 +2566,8 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHostdevDef *hostdev,
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
return qemuValidateDomainMdevDef(hostdev, def, qemuCaps);
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+ break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
default:
virReportEnumRangeError(virDomainHostdevSubsysType,
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index c7dc145621..24f3de5d15 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -1313,6 +1313,7 @@ virSecurityDACSetHostdevLabel(virSecurityManager *mgr,
break;
}
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
ret = 0;
break;
@@ -1469,6 +1470,7 @@ virSecurityDACRestoreHostdevLabel(virSecurityManager *mgr,
break;
}
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
ret = 0;
break;
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index e3e6a6115f..5cb6612fbc 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -2265,6 +2265,7 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityManager *mgr,
break;
}
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
ret = 0;
break;
@@ -2493,6 +2494,7 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecurityManager *mgr,
break;
}
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
ret = 0;
break;
--
2.33.0
1 year, 7 months
[libvirt PATCH] .gitlab-ci.yml: Fix Leap 15.4 codestyle job
by Erik Skultety
Commit a3cc0e9ceb3e forgot to tweak the codestyle job so that we refer
to Leap 15.4 as Leap 15 (with the recent change in lcitool). However,
it was easy to miss as that job is not managed by the manifest.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
.gitlab-ci.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3a36c0ef18..2378b1a39f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -118,10 +118,10 @@ codestyle_prebuilt_env:
- .codestyle_job
- .gitlab_native_build_job_prebuilt_env
needs:
- - job: x86_64-opensuse-leap-154-container
+ - job: x86_64-opensuse-leap-15-container
optional: true
variables:
- NAME: opensuse-leap-154
+ NAME: opensuse-leap-15
codestyle_local_env:
extends:
@@ -129,7 +129,7 @@ codestyle_local_env:
- .gitlab_native_build_job_local_env
variables:
IMAGE: registry.opensuse.org/opensuse/leap:15.4
- NAME: opensuse-leap-154
+ NAME: opensuse-leap-15
# This artifact published by this job is downloaded to push to Weblate
--
2.40.1
1 year, 7 months