From 8e6ee9f280b258e058a876413654ed827ca37077 Mon Sep 17 00:00:00 2001 From: Stefan Zimmermann Date: Wed, 18 Feb 2015 16:44:19 +0100 Subject: [PATCH] Rework s390 architecture checking Making use of the ARCH_IS_S390 macro introduced with e808357528d8be1ebc3970424b4a7b7c04eda2b6 Signed-off-by: Stefan Zimmermann Reviewed-by: Boris Fiuczynski --- src/qemu/qemu_domain.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index bd9d4f26ec..ac5ca74a83 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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 */