libxl: make libxl_cdrom_insert async.
authorIan Campbell <ian.campbell@citrix.com>
Thu, 26 Jul 2012 14:58:18 +0000 (15:58 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 26 Jul 2012 14:58:18 +0000 (15:58 +0100)
commite158dcadaf6e6842791fe5114cc0e1de0e77ffbd
tree80d924a74c2212d9466620cc1178f23fd859b3aa
parentf5e3add94b9455922f3374e61acd60ffddb6b5de
libxl: make libxl_cdrom_insert async.

This functionality is a bit of a mess and several configurations are
not properly supported.

The protocol for changing is basically to change the params node in
the disk xenstore backend. There is no interlock or error reporting in
this protocol. Completely removing the device and recreating it is not
necessary nor expected. For reference the equivalent xend code is
tools/python/xen/xend/server/blkif.py::BlkifController::reconfigureDevice().

Device model stub domains are not supported. There appears to be no
way correctly to do a media change on the emulated device while also
changing the stub domains PV backend to point to the new
backend. Reworking this is a significant task deferred until 4.3. xend
(via the equivalent "xm block-configure" functionality) also does not
support media change for stub domains (confirmed by code inspection
and experiment). Unlike xend this version errors out instead of
silently not achieving anything in this case.

There is no support for qemu-xen (upstream) media change. I expect
this is supported on the qemu side and required QMP plumbing on the
libxl side. Again this is deferred until 4.3.

On the plus side the current implementation is trivially "asynchronous".

Adds a libxl__xs_writev_atonce helper to write a key-value list to
xenstore in one go.

Tested with Windows 7.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl.h
tools/libxl/libxl_internal.h
tools/libxl/libxl_xshelp.c
tools/libxl/xl_cmdimpl.c