1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

hotplug: Check for alias in net detach

https://bugzilla.redhat.com/show_bug.cgi?id=1141621

If the QEMU_CAPS_DEVICE is set, then ensure the host device alias has
been properly set before making the calls to detach the device
This commit is contained in:
John Ferlan 2014-10-08 18:55:43 -04:00
parent 4d8a4165a7
commit 96af61ddc1

View File

@ -3530,6 +3530,12 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
}
}
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
!detach->info.alias) {
if (qemuAssignDeviceNetAlias(vm->def, detach, -1) < 0)
goto cleanup;
}
qemuDomainMarkDeviceForRemoval(vm, &detach->info);
qemuDomainObjEnterMonitor(driver, vm);