mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 23:25:24 +00:00
qemu: hotplug: Assume QEMU_CAPS_DEVICE in qemuDomainDetachNetDevice
This commit is contained in:
parent
78bb0df8c9
commit
b956512f6c
@ -3896,8 +3896,7 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
|
if (!detach->info.alias) {
|
||||||
!detach->info.alias) {
|
|
||||||
if (qemuAssignDeviceNetAlias(vm->def, detach, -1) < 0)
|
if (qemuAssignDeviceNetAlias(vm->def, detach, -1) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -3917,22 +3916,12 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
|
|||||||
qemuDomainMarkDeviceForRemoval(vm, &detach->info);
|
qemuDomainMarkDeviceForRemoval(vm, &detach->info);
|
||||||
|
|
||||||
qemuDomainObjEnterMonitor(driver, vm);
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
||||||
if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
|
if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
virDomainAuditNet(vm, detach, NULL, "detach", false);
|
virDomainAuditNet(vm, detach, NULL, "detach", false);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (qemuMonitorRemovePCIDevice(priv->mon,
|
|
||||||
&detach->info.addr.pci) < 0) {
|
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
virDomainAuditNet(vm, detach, NULL, "detach", false);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user