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

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

 



These were probably left there after some code movement.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]