mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
qemu: Don't duplicate domain def in qemuDomainGetFSInfo
Introduced in v3.0.0-rc1~336, the commit message doesn't really justifies the expensive domain def copy creation. Now, that vm->def is guarded in this function by job acquirement we can use vm->def directly. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
93841cb030
commit
3853372659
@ -22126,11 +22126,8 @@ qemuDomainGetFSInfo(virDomainPtr dom,
|
||||
unsigned int flags)
|
||||
{
|
||||
virQEMUDriverPtr driver = dom->conn->privateData;
|
||||
qemuDomainObjPrivatePtr priv;
|
||||
virDomainObjPtr vm;
|
||||
qemuAgentPtr agent;
|
||||
virCapsPtr caps = NULL;
|
||||
virDomainDefPtr def = NULL;
|
||||
int ret = -1;
|
||||
|
||||
virCheckFlags(0, ret);
|
||||
@ -22138,8 +22135,6 @@ qemuDomainGetFSInfo(virDomainPtr dom,
|
||||
if (!(vm = qemuDomObjFromDomain(dom)))
|
||||
return ret;
|
||||
|
||||
priv = vm->privateData;
|
||||
|
||||
if (virDomainGetFSInfoEnsureACL(dom->conn, vm->def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
@ -22154,14 +22149,8 @@ qemuDomainGetFSInfo(virDomainPtr dom,
|
||||
if (!qemuDomainAgentAvailable(vm, true))
|
||||
goto endjob;
|
||||
|
||||
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
|
||||
goto endjob;
|
||||
|
||||
if (!(def = virDomainDefCopy(vm->def, caps, driver->xmlopt, priv->qemuCaps, false)))
|
||||
goto endjob;
|
||||
|
||||
agent = qemuDomainObjEnterAgent(vm);
|
||||
ret = qemuAgentGetFSInfo(agent, info, def);
|
||||
ret = qemuAgentGetFSInfo(agent, info, vm->def);
|
||||
qemuDomainObjExitAgent(vm, agent);
|
||||
|
||||
endjob:
|
||||
@ -22169,8 +22158,6 @@ qemuDomainGetFSInfo(virDomainPtr dom,
|
||||
|
||||
cleanup:
|
||||
virDomainObjEndAPI(&vm);
|
||||
virDomainDefFree(def);
|
||||
virObjectUnref(caps);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user