提交 9de26f27 编写于 作者: J John Ferlan

hotplug: Check for alias in hostdev detach

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
上级 5d02a9a0
......@@ -3371,8 +3371,15 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr detach)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
int ret = -1;
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
!detach->info->alias) {
if (qemuAssignDeviceHostdevAlias(vm->def, detach, -1) < 0)
return -1;
}
switch (detach->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
ret = qemuDomainDetachHostPCIDevice(driver, vm, detach);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册