提交 9ee809d6 编写于 作者: O Osier Yang

qemu: Simplify the code

"disk" is initialized to "dev->data.disk" in the beginning of the
function.
上级 8f218fbd
......@@ -6136,9 +6136,8 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
case VIR_DOMAIN_DISK_DEVICE_LUN:
if (disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO)
ret = qemuDomainDetachPciDiskDevice(driver, vm, dev);
else if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI)
ret = qemuDomainDetachDiskDevice(driver, vm, dev);
else if (dev->data.disk->bus == VIR_DOMAIN_DISK_BUS_USB)
else if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI ||
disk->bus == VIR_DOMAIN_DISK_BUS_USB)
ret = qemuDomainDetachDiskDevice(driver, vm, dev);
else
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册