[Libvir] <disk> <shareable/> has no effect

Daniel Veillard veillard at redhat.com
Wed Nov 21 16:14:18 UTC 2007


On Fri, Nov 16, 2007 at 10:09:19AM -0500, Daniel Veillard wrote:
> On Wed, Nov 14, 2007 at 06:55:31PM +0100, Markus Armbruster wrote:
> > Looks like <shareable/> within <disk> has no effect.  I ran virsh
> > dumpxml, inserted the <shareable/>, redefined the domain, and ran
> > virsh dumpxml again.  No shareable.  I even ran virsh undefine and
> > virsh define again, same thing.
> > 
> 
>   Strange, I noticed that there were no test of the conversion for 
> "w!" to and from <shareable/>, so I added tests based on yours but
> they work as expected in the conversion routines as tested. So I admit
> I'm a bit lost to what could have caused the problem. Since the 
> xml dump includes the "w!" I would assume the part going from 
> the XML file for creation of the domain worked as expected, but it's
> when dumping back the domain that you got the missing  <shareable/>,
> right ? Was the domain running at that point ? If on RHEL-5(.1) and
> for a defined but non-running domain, the dump routine could use a 
> different path.

  Okay, checked and confirmed if you build from a defined domain 
it uses the xm_internal.c backend and in xenXMDomainFormatXML we
forgot to check for 'w!' and dump the <shareable/> element. The
fix is trivial, enclosed, and I will commit it tomorrow unless
someone disagrees,

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/
-------------- next part --------------
Index: src/xm_internal.c
===================================================================
RCS file: /data/cvs/libxen/src/xm_internal.c,v
retrieving revision 1.46
diff -u -r1.46 xm_internal.c
--- src/xm_internal.c	20 Nov 2007 18:57:41 -0000	1.46
+++ src/xm_internal.c	21 Nov 2007 15:53:32 -0000
@@ -810,6 +810,8 @@
             if (!strcmp(head, "r") ||
                 !strcmp(head, "ro"))
                 virBufferAdd(buf, "      <readonly/>\n", -1);
+	    else if (!strcmp(head, "w!"))
+	        virBufferAdd(buf, "      <shareable/>\n", -1);
             virBufferAdd(buf, "    </disk>\n", -1);
 
         skipdisk:


More information about the libvir-list mailing list