From aa9e0057b19e29f76c9a81f9aebeeb1cb5bf1fdb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 14 Sep 2012 15:50:38 +0100 Subject: launch: libvirt: Mark appliance disk as (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. --- src/launch-libvirt.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/launch-libvirt.c') 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. * -- cgit