mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
bhyve: honor VIR_DOMAIN_XML_INACTIVE in virDomainGetXMLDesc()
For an active persistent domain, vm->def contains the live definition and vm->newDef contains the persistent definition. Use vm->newDef when VIR_DOMAIN_XML_INACTIVE is requested so that the persistent XML is returned. Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
1 parent
69bb5d29ff
commit
e351099fb5
1 file changed
+7
-1
@@ -507,6 +507,7 @@ bhyveDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
|
||||
{
|
||||
struct _bhyveConn *privconn = domain->conn->privateData;
|
||||
virDomainObj *vm;
|
||||
virDomainDef *def;
|
||||
char *ret = NULL;
|
||||
|
||||
virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS, NULL);
|
||||
@@ -517,7 +518,12 @@ bhyveDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
|
||||
if (virDomainGetXMLDescEnsureACL(domain->conn, vm->def, flags) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = virDomainDefFormat(vm->def, privconn->xmlopt,
|
||||
if ((flags & VIR_DOMAIN_XML_INACTIVE) && vm->newDef)
|
||||
def = vm->newDef;
|
||||
else
|
||||
def = vm->def;
|
||||
|
||||
ret = virDomainDefFormat(def, privconn->xmlopt,
|
||||
virDomainDefFormatConvertXMLFlags(flags));
|
||||
|
||||
cleanup:
|
||||
|
||||
Reference in new issue
Block a user