[Libvir] [PATCH] fix to allow usage of flags when saving XML

As pointed by Jay Gagnon on IRC, virDomainGetXMLDesc() was failing if the flags value was non-NULL, and looking at the source we still had a check there to fail if flags is non-zero (and we define 2 flags in virDomainXMLFlags, so this is clearly broken), Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Daniel Veillard wrote:
As pointed by Jay Gagnon on IRC, virDomainGetXMLDesc() was failing if the flags value was non-NULL, and looking at the source we still had a check there to fail if flags is non-zero (and we define 2 flags in virDomainXMLFlags, so this is clearly broken),
+1 for the patch. We define two flags of interest: VIR_DOMAIN_XML_SECURE = 1, /* dump security sensitive informations too */ VIR_DOMAIN_XML_INACTIVE = 2/* dump inactive domain informations */ Of these only 'SECURE' is actually used. I'm not quite sure what the second one means, since to dump an inactive domain you'd just call virDomainGetXMLDesc on the inactive domain (?) We probably ought to also document these in the API, and add the appropriate flags to virsh too. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Thu, Jan 24, 2008 at 03:35:43PM +0000, Richard W.M. Jones wrote:
Daniel Veillard wrote:
As pointed by Jay Gagnon on IRC, virDomainGetXMLDesc() was failing if the flags value was non-NULL, and looking at the source we still had a check there to fail if flags is non-zero (and we define 2 flags in virDomainXMLFlags, so this is clearly broken),
+1 for the patch.
We define two flags of interest:
VIR_DOMAIN_XML_SECURE = 1, /* dump security sensitive informations too */ VIR_DOMAIN_XML_INACTIVE = 2/* dump inactive domain informations */
Of these only 'SECURE' is actually used. I'm not quite sure what the second one means, since to dump an inactive domain you'd just call virDomainGetXMLDesc on the inactive domain (?)
It enables you get the inactive config of a live domain. eg without the various runtime attrs added in. Not that we've implemented it yet, but its fairly easy for the QEMU driver, since we explicitly store this info. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

On Thu, Jan 24, 2008 at 03:35:43PM +0000, Richard W.M. Jones wrote:
Daniel Veillard wrote:
As pointed by Jay Gagnon on IRC, virDomainGetXMLDesc() was failing if the flags value was non-NULL, and looking at the source we still had a check there to fail if flags is non-zero (and we define 2 flags in virDomainXMLFlags, so this is clearly broken),
+1 for the patch.
okay, commited, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Richard W.M. Jones