]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Rework s390 architecture checking
authorStefan Zimmermann <stzi@linux.vnet.ibm.com>
Wed, 18 Feb 2015 15:44:19 +0000 (16:44 +0100)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 23 Feb 2015 19:51:02 +0000 (14:51 -0500)
Making use of the ARCH_IS_S390 macro introduced with
e808357528d8be1ebc3970424b4a7b7c04eda2b6

Signed-off-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
src/qemu/qemu_domain.c

index bd9d4f26ec99fa4f14899dd9f379c268ecf8ad8a..ac5ca74a83786c8326bc20145dd1048702361ab9 100644 (file)
@@ -1052,8 +1052,7 @@ qemuDomainDefPostParse(virDomainDefPtr def,
 static const char *
 qemuDomainDefaultNetModel(const virDomainDef *def)
 {
-    if (def->os.arch == VIR_ARCH_S390 ||
-        def->os.arch == VIR_ARCH_S390X)
+    if (ARCH_IS_S390(def->os.arch))
         return "virtio";
 
     if (def->os.arch == VIR_ARCH_ARMV7L ||
@@ -1132,7 +1131,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
     if (dev->type == VIR_DOMAIN_DEVICE_CHR &&
         dev->data.chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
         dev->data.chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE &&
-        (def->os.arch == VIR_ARCH_S390 || def->os.arch == VIR_ARCH_S390X))
+        ARCH_IS_S390(def->os.arch))
         dev->data.chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO;
 
     /* set the default USB model to none for s390 unless an address is found */
@@ -1140,7 +1139,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
         dev->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
         dev->data.controller->model == -1 &&
         dev->data.controller->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
-        (def->os.arch == VIR_ARCH_S390 || def->os.arch == VIR_ARCH_S390X))
+        ARCH_IS_S390(def->os.arch))
         dev->data.controller->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE;
 
     /* auto generate unix socket path */