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

[libvirt] [PATCH 13/16] qemu_command: Clean up default model passing



After the previous commit, the assignment of the default model is no
longer needed. Get rid of it and simplify the code.
---
 src/qemu/qemu_command.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index dee493f..82e9426 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3155,21 +3155,17 @@ qemuBuildNicDevStr(virDomainNetDefPtr net,
                    virQEMUCapsPtr qemuCaps)
 {
     virBuffer buf = VIR_BUFFER_INITIALIZER;
-    const char *nic;
+    const char *nic = net->model;
     bool usingVirtio = false;

-    if (!net->model) {
-        nic = "rtl8139";
-    } else if (STREQ(net->model, "virtio")) {
+    if (STREQ(net->model, "virtio")) {
         if (net->info.type ==
-            VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390) {
+            VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390)
             nic = "virtio-net-s390";
-        } else  {
+        else
             nic = "virtio-net-pci";
-        }
+
         usingVirtio = true;
-    } else {
-        nic = net->model;
     }

     virBufferAdd(&buf, nic, strlen(nic));
-- 
1.8.1.1


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