]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainSupportsVcpuHotplug: Base return value on virQEMUCapsGetMachineHotplugCpus
authorPeter Krempa <pkrempa@redhat.com>
Mon, 28 Aug 2023 12:14:32 +0000 (14:14 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 4 Sep 2023 08:31:52 +0000 (10:31 +0200)
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>
src/qemu/qemu_domain.c

index af1b29772cae81230502b89caeb704ff59efb631..bf0b349406b1344a7d0ae47d41b8849e66b2e727 100644 (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);
 }