[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 01/15] vbox: Remove useless condition branches



These were probably left there after some code movement.

Signed-off-by: Martin Kletzander <mkletzan redhat com>
---
 src/vbox/vbox_common.c | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index bc80338..cd5b478 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -4144,23 +4144,12 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom,
                 const char *src = virDomainDiskGetSource(dev->data.disk);
                 int type = virDomainDiskGetType(dev->data.disk);

-                if (dev->data.disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
-                    if (type == VIR_STORAGE_TYPE_FILE && src) {
-                        ret = gVBoxAPI.attachDVD(data, machine, src);
-                    } else if (type == VIR_STORAGE_TYPE_BLOCK) {
-                    }
-                } else if (dev->data.disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
-                    if (type == VIR_STORAGE_TYPE_FILE && src) {
-                        ret = gVBoxAPI.attachFloppy(data, machine, src);
-                    } else if (type == VIR_STORAGE_TYPE_BLOCK) {
-                    }
-                }
-            }
-        } else if (dev->type == VIR_DOMAIN_DEVICE_NET) {
-        } else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
-            if (dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
-                if (dev->data.hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
-                }
+                if (dev->data.disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
+                    type == VIR_STORAGE_TYPE_FILE && src)
+                    ret = gVBoxAPI.attachDVD(data, machine, src);
+                else if (dev->data.disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
+                         type == VIR_STORAGE_TYPE_FILE && src)
+                    ret = gVBoxAPI.attachFloppy(data, machine, src);
             }
         } else if (dev->type == VIR_DOMAIN_DEVICE_FS &&
                    dev->data.fs->type == VIR_DOMAIN_FS_TYPE_MOUNT) {
-- 
2.1.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]