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(a)suse.com>
---
src/libxl/libxl_driver.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index fb9523a..1a5b1a7 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -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)
--
2.3.7