aboutsummaryrefslogtreecommitdiff
path: root/hw/i386
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-12-03 11:54:15 +0100
committerGerd Hoffmann <kraxel@redhat.com>2020-12-10 08:47:44 +0100
commitc214a7bcb6320c37777a662f38aea2a7c6919148 (patch)
treeecae511fc67fb40e10fc45670796ff3b867ad0b1 /hw/i386
parent94c5a606379ddd04beecdb11fb34b51b4b28c7f2 (diff)
downloadqemu-c214a7bcb6320c37777a662f38aea2a7c6919148.zip
qemu-c214a7bcb6320c37777a662f38aea2a7c6919148.tar.gz
qemu-c214a7bcb6320c37777a662f38aea2a7c6919148.tar.bz2
microvm: make number of virtio transports runtime changeable
This will allow to increase the number of transports in case we have enough irq lines available for them all. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Sergio Lopez <slp@redhat.com> Message-id: 20201203105423.10431-5-kraxel@redhat.com
Diffstat (limited to 'hw/i386')
-rw-r--r--hw/i386/microvm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index 5428448..e92f236 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -178,8 +178,13 @@ static void microvm_devices_init(MicrovmMachineState *mms)
kvmclock_create(true);
- mms->virtio_irq_base = x86_machine_is_acpi_enabled(x86ms) ? 16 : 5;
- for (i = 0; i < VIRTIO_NUM_TRANSPORTS; i++) {
+ mms->virtio_irq_base = 5;
+ mms->virtio_num_transports = 8;
+ if (x86_machine_is_acpi_enabled(x86ms)) {
+ mms->virtio_irq_base = 16;
+ }
+
+ for (i = 0; i < mms->virtio_num_transports; i++) {
sysbus_create_simple("virtio-mmio",
VIRTIO_MMIO_BASE + i * 512,
x86ms->gsi[mms->virtio_irq_base + i]);