From 4d82bce8362dc94d168e3784d67476e7e36448b9 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 28 Aug 2023 14:14:32 +0200 Subject: [PATCH] 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 --- src/qemu/qemu_domain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }