From 9ee809d60cb31dbbd24390af8008a952b3b61c95 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Wed, 5 Dec 2012 01:29:15 +0800 Subject: [PATCH] qemu: Simplify the code "disk" is initialized to "dev->data.disk" in the beginning of the function. --- src/qemu/qemu_driver.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a0503148f0..64221cf99d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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", -- GitLab