]> xenbits.xensource.com Git - libvirt.git/commit
libxl: Set def->vcpus after successfully modifying live vcpu count
authorJim Fehlig <jfehlig@suse.com>
Mon, 29 Jun 2015 16:46:36 +0000 (10:46 -0600)
committerJim Fehlig <jfehlig@suse.com>
Tue, 30 Jun 2015 17:02:30 +0000 (11:02 -0600)
commit04597f8f0de09cbac5a141bee6f6690924900bc8
tree716c295d4dd11ea547e10fbbc6d83b0da8fdf09f
parent33be48d78edc85d9162e56824cf9b45f51b68152
libxl: Set def->vcpus after successfully modifying live vcpu count

def->vcpus was never updated after successfully changing the live
vcpu count of a domain. Subsequent queries for vcpu info would
return incorrect results.  E.g.:

virsh vcpucount test
maximum      config         4
maximum      live           4
current      config         4
current      live           4

virsh setvcpus test 2

virsh vcpucount test
maximum      config         4
maximum      live           4
current      config         4
current      live           4

After patch, live current config is reported correctly:

virsh vcpucount test
maximum      config         4
maximum      live           4
current      config         4
current      live           2

While fixing this, noticed that the live config was not saved
to cfg->stateDir via virDomainSaveStatus. Save the live config
and change error handling of virDomainSave{Config,Status} to
log a message via VIR_WARN, instead of failing the entire
DomainSetVcpusFlags operation.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
src/libxl/libxl_driver.c