提交 9882123d 编写于 作者: D Daniel P. Berrange

Fix USB/PCI device address aliases in QEMU hotplug driver

The USB/PCI device hotplug code for the QEMU driver was forgetting
to allocate a unique device alias.

* src/qemu/qemu_driver.c: Fill in device alias for USB/PCI devices
上级 44f68729
......@@ -6017,6 +6017,8 @@ static int qemudDomainAttachHostPciDevice(struct qemud_driver *driver,
}
if (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) {
if (qemuAssignDeviceHostdevAlias(vm->def, hostdev, -1) < 0)
goto error;
if (qemuDomainPCIAddressEnsureAddr(priv->pciaddrs, &hostdev->info) < 0)
goto error;
......@@ -6065,9 +6067,12 @@ static int qemudDomainAttachHostUsbDevice(struct qemud_driver *driver,
qemuDomainObjPrivatePtr priv = vm->privateData;
char *devstr = NULL;
if ((qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) &&
!(devstr = qemuBuildUSBHostdevDevStr(hostdev)))
goto error;
if (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) {
if (qemuAssignDeviceHostdevAlias(vm->def, hostdev, -1) < 0)
goto error;
if (!(devstr = qemuBuildUSBHostdevDevStr(hostdev)))
goto error;
}
if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs+1) < 0) {
virReportOOMError();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册