[libvirt] [PATCHv2 2/3] qemu: Re-detect virtual cpu threads after cpu hot (un)plug.
Eric Blake
eblake at redhat.com
Fri May 11 14:11:08 UTC 2012
On 05/11/2012 07:23 AM, Peter Krempa wrote:
> After a cpu hotplug the qemu driver did not refresh information about
> virtual processors used by qemu and their corresponding threads. This
> patch forces a re-detection as is done on start of QEMU.
>
> This ensures that correct information is reported by the
> virDomainGetVcpus API and "virsh vcpuinfo".
>
> A failure to obtain the thread<->vcpu mapping is treated non-fatal and
> the mapping is not updated in a case of failure as not all versions of
> QEMU report this in the info cpus command.
> ---
> Diff to v1:
> - don't fail the call if cpu thread detection fails
> - fix memory leak when overwriting the priv->vcpupids array
> ---
> src/qemu/qemu_driver.c | 29 +++++++++++++++++++++++++++++
> 1 files changed, 29 insertions(+), 0 deletions(-)
>
> @@ -3373,11 +3375,38 @@ static int qemudDomainHotplugVcpus(struct qemud_driver *driver,
> }
> }
>
> + /* hotplug succeeded */
> +
> ret = 0;
>
> + /* After hotplugging the CPUs we need to re-detect threads corresponding
> + * to the virtual CPUs. Some older versions don't provide the thread ID
> + * or don't have the "info cpus" (and they don't support mutliple CPUs
s/mutliple/multiple/
> + * anyways) command, so errors in the re-detection will not be treated
s/"info cpus" (...) command/"info cpus" command (...)/
ACK with comment fix.
--
Eric Blake eblake at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120511/b50e60e6/attachment-0001.sig>
More information about the libvir-list
mailing list