1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-26 03:21:44 +03:00

libxl: honor domainGetXMLDesc() --inactive flag

The libxl driver always uses virDomainObj->def when formatting
the domain XML description.  Use virDomainObj->newDef when
--inactive flag is set.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Jim Fehlig 2015-06-24 16:15:22 -06:00
parent 4b53d0d4ac
commit 33be48d78e

View File

@ -2429,6 +2429,7 @@ static char *
libxlDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
{
virDomainObjPtr vm;
virDomainDefPtr def;
char *ret = NULL;
/* Flags checked by virDomainDefFormat */
@ -2439,8 +2440,13 @@ libxlDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
if (virDomainGetXMLDescEnsureACL(dom->conn, vm->def, flags) < 0)
goto cleanup;
ret = virDomainDefFormat(vm->def,
virDomainDefFormatConvertXMLFlags(flags));
if ((flags & VIR_DOMAIN_XML_INACTIVE) && vm->newDef)
def = vm->newDef;
else
def = vm->def;
ret = virDomainDefFormat(def,
virDomainDefFormatConvertXMLFlags(flags));
cleanup:
if (vm)