提交 38533726 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 93841cb0
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册