mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu_hotplug: Don't build device string in qemuDomainDetachChrDevice
This is basically an old artefact from 24b0821926e 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: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
17ddfd420a
commit
0c17685760
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user