From: Peter Krempa Date: Mon, 28 Aug 2023 12:14:32 +0000 (+0200) Subject: qemuDomainSupportsVcpuHotplug: Base return value on virQEMUCapsGetMachineHotplugCpus X-Git-Tag: v9.8.0-rc1~231 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d82bce8362dc94d168e3784d67476e7e36448b9;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index af1b29772c..bf0b349406 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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); }