summaryrefslogtreecommitdiff
path: root/hw/pc.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 1486b683a8..25dedc8999 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -33,6 +33,7 @@
#include "boards.h"
#include "console.h"
#include "fw_cfg.h"
+#include "virtio-blk.h"
/* output Bochs bios info messages */
//#define DEBUG_BIOS
@@ -1092,6 +1093,18 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
}
}
}
+
+ /* Add virtio block devices */
+ if (pci_enabled) {
+ int index;
+ int unit_id = 0;
+
+ while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
+ virtio_blk_init(pci_bus, 0x1AF4, 0x1001,
+ drives_table[index].bdrv);
+ unit_id++;
+ }
+ }
}
static void pc_init_pci(ram_addr_t ram_size, int vga_ram_size,