提交 0c176857 编写于 作者: M Michal Privoznik

qemu_hotplug: Don't build device string in qemuDomainDetachChrDevice

This is basically an old artefact from 24b08219 when the idea
was:

1) Build device string only to see if chardev has any -device
associated with it and thus if device_del is needed
2) Detach chardev using chardev_del

Now, that DEVICE and DEVICE_DELETED capabilities are assumed for
every domain 1) does not make sense anymore.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 17ddfd42
......@@ -6129,7 +6129,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainDefPtr vmdef = vm->def;
virDomainChrDefPtr tmpChr;
char *devstr = NULL;
bool guestfwd = false;
if (!(tmpChr = virDomainChrFind(vmdef, chr))) {
......@@ -6150,9 +6149,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
sa_assert(tmpChr->info.alias);
if (qemuBuildChrDeviceStr(&devstr, vmdef, tmpChr, priv->qemuCaps) < 0)
goto cleanup;
if (!async && !guestfwd)
qemuDomainMarkDeviceForRemoval(vm, &tmpChr->info);
......@@ -6163,7 +6159,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
goto cleanup;
}
} else {
if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
if (qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
ignore_value(qemuDomainObjExitMonitor(driver, vm));
goto cleanup;
}
......@@ -6183,7 +6179,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
cleanup:
if (!async)
qemuDomainResetDeviceRemoval(vm);
VIR_FREE(devstr);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册