[PATCH v1 09/19] qemu: Refactor qemuBuildHostdevCommandLine for non-vhost devices

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

 



Let's adjust some of the indentation in the command line code for the
upcoming vhost-scsi support, so we can keep existing code separate
from the new code that we'll add.

Signed-off-by: Eric Farman <farman@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx>
---
 src/qemu/qemu_command.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 4558b9f..dd15ff8 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4954,18 +4954,20 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
         if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
             subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI) {
             if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SCSI_GENERIC)) {
-                char *drvstr;
+                if (hostdev->source.subsys.u.scsi.protocol != VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_VHOST) {
+                    char *drvstr;
 
-                virCommandAddArg(cmd, "-drive");
-                if (!(drvstr = qemuBuildSCSIHostdevDrvStr(hostdev)))
-                    return -1;
-                virCommandAddArg(cmd, drvstr);
-                VIR_FREE(drvstr);
+                    virCommandAddArg(cmd, "-drive");
+                    if (!(drvstr = qemuBuildSCSIHostdevDrvStr(hostdev)))
+                        return -1;
+                    virCommandAddArg(cmd, drvstr);
+                    VIR_FREE(drvstr);
 
-                virCommandAddArg(cmd, "-device");
-                if (!(devstr = qemuBuildSCSIHostdevDevStr(def, hostdev,
-                                                          qemuCaps)))
-                    return -1;
+                    virCommandAddArg(cmd, "-device");
+                    if (!(devstr = qemuBuildSCSIHostdevDevStr(def, hostdev,
+                                                              qemuCaps)))
+                        return -1;
+                }
                 virCommandAddArg(cmd, devstr);
                 VIR_FREE(devstr);
             } else {
-- 
1.9.1

--
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]