diff options
author | Pavel Fedin <p.fedin@samsung.com> | 2015-08-13 11:26:21 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-08-13 11:26:21 +0100 |
commit | e6fbcbc4e57322a8de1307556e68a4cd6d0d8c8b (patch) | |
tree | 39e13cd535cb305398377adc6d2365eb9f6679e7 /hw/arm/virt.c | |
parent | 7926c210ab0c44fc3612461a50f487d16be98dca (diff) | |
download | hqemu-e6fbcbc4e57322a8de1307556e68a4cd6d0d8c8b.zip hqemu-e6fbcbc4e57322a8de1307556e68a4cd6d0d8c8b.tar.gz |
Introduce gic_class_name() instead of repeating condition
This small inline returns correct GIC class name depending on whether we
use KVM acceleration or not. Avoids duplicating the condition everywhere.
Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 4f26901be9b844b563673ce3ad08eeedbb7a7132.1438758065.git.p.fedin@samsung.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/arm/virt.c')
-rw-r--r-- | hw/arm/virt.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index aab99f7..94694d6 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -49,6 +49,7 @@ #include "hw/platform-bus.h" #include "hw/arm/fdt.h" #include "hw/intc/arm_gic_common.h" +#include "kvm_arm.h" /* Number of external interrupt lines to configure the GIC with */ #define NUM_IRQS 256 @@ -366,12 +367,10 @@ static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic) /* We create a standalone GIC v2 */ DeviceState *gicdev; SysBusDevice *gicbusdev; - const char *gictype = "arm_gic"; + const char *gictype; int i; - if (kvm_irqchip_in_kernel()) { - gictype = "kvm-arm-gic"; - } + gictype = gic_class_name(); gicdev = qdev_create(NULL, gictype); qdev_prop_set_uint32(gicdev, "revision", 2); |