Modify 'qemuProcessGetVCPUQOMPath' to take the detected QOM path of the
first vCPU which is always present as the QOM path used our code probing
CPU flags via 'qom-get'.
This is needed as upcoming qemu will change it.
Resolves:
https://gitlab.com/libvirt/libvirt/-/issues/272
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=2051451
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_process.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index bd9c6ed747..eeda2a92ef 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4226,8 +4226,16 @@ qemuProcessTranslateCPUFeatures(const char *name,
/* returns the QOM path to the first vcpu */
static const char *
-qemuProcessGetVCPUQOMPath(void)
+qemuProcessGetVCPUQOMPath(virDomainObj *vm)
{
+ virDomainVcpuDef *vcpu = virDomainDefGetVcpu(vm->def, 0);
+ qemuDomainVcpuPrivate *vcpupriv;
+
+ if (vcpu &&
+ (vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpu)) &&
+ vcpupriv->qomPath)
+ return vcpupriv->qomPath;
+
return "/machine/unattached/device[0]";
}
@@ -4242,7 +4250,7 @@ qemuProcessFetchGuestCPU(virQEMUDriver *driver,
qemuDomainObjPrivate *priv = vm->privateData;
g_autoptr(virCPUData) dataEnabled = NULL;
g_autoptr(virCPUData) dataDisabled = NULL;
- const char *cpuQOMPath = qemuProcessGetVCPUQOMPath();
+ const char *cpuQOMPath = qemuProcessGetVCPUQOMPath(vm);
bool generic;
int rc;
@@ -8465,7 +8473,7 @@ qemuProcessRefreshCPUMigratability(virQEMUDriver *driver,
{
qemuDomainObjPrivate *priv = vm->privateData;
virDomainDef *def = vm->def;
- const char *cpuQOMPath = qemuProcessGetVCPUQOMPath();
+ const char *cpuQOMPath = qemuProcessGetVCPUQOMPath(vm);
bool migratable;
int rc;
--
2.34.1