summaryrefslogtreecommitdiffstats
path: root/src/launch-libvirt.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-09-14 15:50:38 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-09-14 15:52:42 +0100
commitaa9e0057b19e29f76c9a81f9aebeeb1cb5bf1fdb (patch)
tree434d2d079a742c84c2de0eecca9cf00934ce85d8 /src/launch-libvirt.c
parent281b155800f2e62b994e59bef418ca200da8e93a (diff)
downloadlibguestfs-aa9e0057b19e29f76c9a81f9aebeeb1cb5bf1fdb.tar.gz
libguestfs-aa9e0057b19e29f76c9a81f9aebeeb1cb5bf1fdb.tar.xz
libguestfs-aa9e0057b19e29f76c9a81f9aebeeb1cb5bf1fdb.zip
launch: libvirt: Mark appliance disk as <shareable/> (thanks Dan Berrange).
This is a fix for multiprogramming: If two instances of libguestfs share the same appliance disk, then libvirt would unlabel the disk when one of the instances closes the handle, resulting in the other qemu being unable to continue accessing the appliance. Adding the flag makes libvirt understand that the disk is shared so it doesn't do this, and it apparently handles locking correctly too if we were using sanlock.
Diffstat (limited to 'src/launch-libvirt.c')
-rw-r--r--src/launch-libvirt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index 37113633..346c7f91 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -978,6 +978,9 @@ construct_libvirt_xml_appliance (guestfs_h *g, xmlTextWriterPtr xo,
BAD_CAST "0"));
XMLERROR (-1, xmlTextWriterEndElement (xo));
+ XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "shareable"));
+ XMLERROR (-1, xmlTextWriterEndElement (xo));
+
/* We'd like to do this, but it's not supported by libvirt.
* See construct_libvirt_xml_qemu_cmdline for the workaround.
*