[libvirt] [PATCH 5/8] qemu: support attachment of disk device with boot index

Ján Tomko jtomko at redhat.com
Tue Feb 3 09:27:09 UTC 2015


On Mon, Jan 05, 2015 at 03:29:44PM +0800, Wang Rui wrote:
> When we attach a disk to a running VM with boot index, we can get a
> successful result. But in fact the boot index won't take effect. QEMU
> supported to set device's boot index online recently(since QEMU 2.2.0).
> 

It seems older QEMU silently ignores the bootindex specified with
device_add.

Checking for the support upfront lets libvirt error out earlier.
(Even in the case of updating the boot-index, there would be no need
to enter the monitor to report the error).
Can that be done by looking at some qom property, or can it only
be checked by comparing the QEMU version?

> After this patch, the boot index will take effect after
> virDomainAttachDevice(Flags) API returning success. If new disk is
> attached successfully but boot index is set failed, we'll remove the
> new disk to restore.

The bootindex can be specified as a part of the device_add command,
removing the need to detach the device on failure (and the previous code
movement patch).

Also, can the qom-set really fail? It seems the property has been
around for a while, it was just ignored.

Jan

> 
> Signed-off-by: Wang Rui <moon.wangrui at huawei.com>
> Signed-off-by: Zhou Yimin <zhouyimin at huawei.com>
> ---
>  src/qemu/qemu_hotplug.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 88 insertions(+)
> 
-------------- 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/20150203/174fb59e/attachment-0001.sig>


More information about the libvir-list mailing list