mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
qemu: process: Don't use hardcoded QOM path for cpu for probing flags
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@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
068aaa9795
commit
a7743c6026
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user