qemuDomainSupportsVcpuHotplug: Base return value on virQEMUCapsGetMachineHotplugCpus

The QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS flag is always asserted as all
qemu versions support the command and selectively cleared when copying
the capabilities for VM use if given machine type does not support cpu
hotplug.

Rework this to directly probe the machine as we now populate the data
also when re-connecting to a qemu instance after daemon restart, so that
the capability can be removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2023-08-28 14:14:32 +02:00
parent 51daa85d7c
commit 4d82bce836

View File

@ -9985,7 +9985,9 @@ qemuDomainSupportsVcpuHotplug(virDomainObj *vm)
{
qemuDomainObjPrivate *priv = vm->privateData;
return virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
return virQEMUCapsGetMachineHotplugCpus(priv->qemuCaps,
vm->def->virtType,
vm->def->os.machine);
}