mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: hotplug: Assume QEMU_CAPS_DEVICE in qemuDomainDetachControllerDevice
This commit is contained in:
parent
a0b38d6f9a
commit
920e811f9f
@ -3616,8 +3616,7 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
|
||||
!detach->info.alias) {
|
||||
if (!detach->info.alias) {
|
||||
if (qemuAssignDeviceControllerAlias(vm->def, priv->qemuCaps, detach) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
@ -3625,17 +3624,9 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
|
||||
qemuDomainMarkDeviceForRemoval(vm, &detach->info);
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
|
||||
if (qemuMonitorDelDevice(priv->mon, detach->info.alias)) {
|
||||
ignore_value(qemuDomainObjExitMonitor(driver, vm));
|
||||
goto cleanup;
|
||||
}
|
||||
} else {
|
||||
if (qemuMonitorRemovePCIDevice(priv->mon,
|
||||
&detach->info.addr.pci) < 0) {
|
||||
ignore_value(qemuDomainObjExitMonitor(driver, vm));
|
||||
goto cleanup;
|
||||
}
|
||||
if (qemuMonitorDelDevice(priv->mon, detach->info.alias)) {
|
||||
ignore_value(qemuDomainObjExitMonitor(driver, vm));
|
||||
goto cleanup;
|
||||
}
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user