mirror of https://gitee.com/openkylin/libvirt.git
qemu: Remove an unnecessary variables
qemuCaps is no longer used anywhere in these functions, so it can be deleted.
This commit is contained in:
parent
d259e825bc
commit
346d2be202
|
@ -8079,8 +8079,6 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom,
|
|||
int ret = -1;
|
||||
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE;
|
||||
virQEMUCapsPtr qemuCaps = NULL;
|
||||
qemuDomainObjPrivatePtr priv;
|
||||
virQEMUDriverConfigPtr cfg = NULL;
|
||||
virCapsPtr caps = NULL;
|
||||
|
||||
|
@ -8097,8 +8095,6 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom,
|
|||
if (!(vm = qemuDomObjFromDomain(dom)))
|
||||
goto cleanup;
|
||||
|
||||
priv = vm->privateData;
|
||||
|
||||
if (virDomainAttachDeviceFlagsEnsureACL(dom->conn, vm->def, flags) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
@ -8125,11 +8121,6 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom,
|
|||
goto endjob;
|
||||
}
|
||||
|
||||
if (priv->qemuCaps)
|
||||
qemuCaps = virObjectRef(priv->qemuCaps);
|
||||
else if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, vm->def->emulator)))
|
||||
goto endjob;
|
||||
|
||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||
/* Make a copy for updated domain. */
|
||||
vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt);
|
||||
|
@ -8178,7 +8169,6 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom,
|
|||
qemuDomainObjEndJob(driver, vm);
|
||||
|
||||
cleanup:
|
||||
virObjectUnref(qemuCaps);
|
||||
virDomainDefFree(vmdef);
|
||||
if (dev != dev_copy)
|
||||
virDomainDeviceDefFree(dev_copy);
|
||||
|
@ -8331,8 +8321,6 @@ qemuDomainDetachDeviceFlags(virDomainPtr dom,
|
|||
virDomainDeviceDefPtr dev = NULL, dev_copy = NULL;
|
||||
int ret = -1;
|
||||
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE;
|
||||
virQEMUCapsPtr qemuCaps = NULL;
|
||||
qemuDomainObjPrivatePtr priv;
|
||||
virQEMUDriverConfigPtr cfg = NULL;
|
||||
virCapsPtr caps = NULL;
|
||||
|
||||
|
@ -8347,8 +8335,6 @@ qemuDomainDetachDeviceFlags(virDomainPtr dom,
|
|||
if (!(vm = qemuDomObjFromDomain(dom)))
|
||||
goto cleanup;
|
||||
|
||||
priv = vm->privateData;
|
||||
|
||||
if (virDomainDetachDeviceFlagsEnsureACL(dom->conn, vm->def, flags) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
@ -8379,11 +8365,6 @@ qemuDomainDetachDeviceFlags(virDomainPtr dom,
|
|||
goto endjob;
|
||||
}
|
||||
|
||||
if (priv->qemuCaps)
|
||||
qemuCaps = virObjectRef(priv->qemuCaps);
|
||||
else if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, vm->def->emulator)))
|
||||
goto endjob;
|
||||
|
||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||
/* Make a copy for updated domain. */
|
||||
vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt);
|
||||
|
@ -8431,7 +8412,6 @@ qemuDomainDetachDeviceFlags(virDomainPtr dom,
|
|||
qemuDomainObjEndJob(driver, vm);
|
||||
|
||||
cleanup:
|
||||
virObjectUnref(qemuCaps);
|
||||
virDomainDefFree(vmdef);
|
||||
if (dev != dev_copy)
|
||||
virDomainDeviceDefFree(dev_copy);
|
||||
|
|
Loading…
Reference in New Issue