aboutsummaryrefslogtreecommitdiff
path: root/hw/pc.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@pond.sub.org>2009-06-18 15:14:10 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-22 10:15:29 -0500
commitc2cc47a449c3e16f7dd4d19a536c649ec56a9ac9 (patch)
tree77920d6d5fd89eb2d8513b49c1205a3656b28429 /hw/pc.c
parent1f5f6638c063514f193ca447d49fa95f8a574a69 (diff)
Support addr=... in option argument of -drive if=virtio
Make drive_init() accept addr=, put the value into struct DriveInfo. Use it in all the places that create virtio-blk-pci devices: pc_init1(), bamboo_init(), mpc8544ds_init(). Don't support addr= in third argument of monitor command pci_add and second argument of drive_add, because that clashes with their first arguments. Admittedly unelegant. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/pc.c b/hw/pc.c
index d5c8c3c3b0..19021eafb6 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -848,6 +848,7 @@ static void pc_init1(ram_addr_t ram_size,
ram_addr_t below_4g_mem_size, above_4g_mem_size = 0;
int bios_size, isa_bios_size, oprom_area_size;
PCIBus *pci_bus;
+ PCIDevice *pci_dev;
int piix3_devfn = -1;
CPUState *env;
qemu_irq *cpu_irq;
@@ -1161,7 +1162,9 @@ static void pc_init1(ram_addr_t ram_size,
int unit_id = 0;
while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
- pci_create_simple(pci_bus, -1, "virtio-blk-pci");
+ pci_dev = pci_create("virtio-blk-pci",
+ drives_table[index].devaddr);
+ qdev_init(&pci_dev->qdev);
unit_id++;
}
}