[libvirt] [PATCH 0/2] Two more setvcpu fixes

Fix fix fix. Ján Tomko (2): Save domain status after cpu hotplug Document behavior of setvcpus during guest boot src/libvirt.c | 6 ++++++ src/qemu/qemu_driver.c | 3 +++ tools/virsh.pod | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) -- 1.8.3.2

The live change of vcpus was not reflected in the domain status xml and it got lost during libvirtd restart. https://bugzilla.redhat.com/show_bug.cgi?id=1088703 --- src/qemu/qemu_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c3ac6d4..11cb86d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4273,6 +4273,9 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (qemuDomainHotplugVcpus(driver, vm, nvcpus) < 0) goto endjob; + + if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) + goto endjob; } if (flags & VIR_DOMAIN_AFFECT_CONFIG) { -- 1.8.3.2

On 04/23/2014 05:08 AM, Ján Tomko wrote:
The live change of vcpus was not reflected in the domain status xml and it got lost during libvirtd restart.
https://bugzilla.redhat.com/show_bug.cgi?id=1088703 --- src/qemu/qemu_driver.c | 3 +++ 1 file changed, 3 insertions(+)
ACK
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c3ac6d4..11cb86d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4273,6 +4273,9 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (qemuDomainHotplugVcpus(driver, vm, nvcpus) < 0) goto endjob; + + if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) + goto endjob; }
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1088748 The hotlugged vcpus could fail to show up in the guest if they were added during boot, see: https://bugzilla.redhat.com/show_bug.cgi?id=807508 --- src/libvirt.c | 6 ++++++ tools/virsh.pod | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libvirt.c b/src/libvirt.c index 4454829..94066f6 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -9371,6 +9371,9 @@ virDomainSendProcessSignal(virDomainPtr domain, * does not support it or if growing the number is arbitrary limited. * This function may require privileged access to the hypervisor. * + * Note that if this call is executed before the guest has finished booting, + * the guest may fail to process the change. + * * This command only changes the runtime configuration of the domain, * so can only be called on an active domain. It is hypervisor-dependent * whether it also affects persistent configuration; for more control, @@ -9429,6 +9432,9 @@ virDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus) * is hypervisor-dependent on whether just live or both live and persistent * state is changed. * + * Note that if this call is executed before the guest has finished booting, + * the guest may fail to process the change. + * * If @flags includes VIR_DOMAIN_VCPU_MAXIMUM, then * VIR_DOMAIN_AFFECT_LIVE must be clear, and only the maximum virtual * CPU limit is altered; generally, this value must be less than or diff --git a/tools/virsh.pod b/tools/virsh.pod index a2eae25..abd2e93 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1743,7 +1743,9 @@ domain is next started. If I<--live> is specified, the guest domain must be active, and the change takes place immediately. Both the I<--config> and I<--live> flags may be -specified together if supported by the hypervisor. +specified together if supported by the hypervisor. If this command is run +before the guest has finished booting, the guest may fail to process +the change. If I<--current> is specified, affect the current guest state. -- 1.8.3.2

On 04/23/2014 05:08 AM, Ján Tomko wrote:
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1088748
The hotlugged vcpus could fail to show up in the guest if
s/hotlugged/hotplugged/
they were added during boot, see: https://bugzilla.redhat.com/show_bug.cgi?id=807508 --- src/libvirt.c | 6 ++++++ tools/virsh.pod | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/libvirt.c b/src/libvirt.c index 4454829..94066f6 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -9371,6 +9371,9 @@ virDomainSendProcessSignal(virDomainPtr domain, * does not support it or if growing the number is arbitrary limited.
While here, s/arbitrary/arbitrarily/ ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 04/23/2014 02:14 PM, Eric Blake wrote:
On 04/23/2014 05:08 AM, Ján Tomko wrote:
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1088748
The hotlugged vcpus could fail to show up in the guest if
s/hotlugged/hotplugged/
they were added during boot, see: https://bugzilla.redhat.com/show_bug.cgi?id=807508 --- src/libvirt.c | 6 ++++++ tools/virsh.pod | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/libvirt.c b/src/libvirt.c index 4454829..94066f6 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -9371,6 +9371,9 @@ virDomainSendProcessSignal(virDomainPtr domain, * does not support it or if growing the number is arbitrary limited.
While here, s/arbitrary/arbitrarily/
ACK
Thanks, I've pushed the series with the fixes. Jan
participants (2)
-
Eric Blake
-
Ján Tomko