[libvirt] [RFC PATCH 00/12] qemu: add support to hot-plug/unplug cpu device

Peter Krempa pkrempa at redhat.com
Wed Jan 21 08:49:43 UTC 2015

On Wed, Jan 21, 2015 at 16:00:52 +0800, Zhu Guihua wrote:
> If you apply the folowing patchset
> [PATCH v3 0/7] cpu: add device_add foo-x86_64-cpu support
> https://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg01552.html,
> and [PATCH v2 00/11] cpu: add i386 cpu hot remove support
> https://lists.nongnu.org/archive/html/qemu-devel/2015-01/msg01557.html,
> qemu can support hotplug and hot-unplug cpu device.
> So this patch series will make libvirt support hotplug and hot-unplug cpu
> device for qemu driver, and now only supports one cpu driver which is
> 'qemu64-x86_64-cpu'.
> The cpu device's xml like this:
> <cpu driver='qemu64-x86_64-cpu' apic_id='3'>

Libvirt already implements vCPU hotplug and unplug via
virDomainSetVcpusFlags() API and implements this API also for the qemu
driver. Granted that the existing code uses older comands but that can
be tweaked to support the new stuff too.

Additionally the new <cpu> subelement of <devices> doesn't seem

- There's only one model that can be plugged
- Configuring the APIC id doesn't make much sense for users
- nothing else can be configured

I have following questions though:

Is there a difference in specifying the cpu via the -device option and
via the legacy -cpu argument?

Is there a plan to have more than one cpu "model" that can be plugged?

Can more than one cpu model be plugged to the same VM at the same time?

In general I don't think it's necessary to add the new device type and
we should rather improve the existing API to support the new device

More comments will be inline in the patches.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150121/dcd3db51/attachment-0001.sig>

More information about the libvir-list mailing list