From c2cc47a449c3e16f7dd4d19a536c649ec56a9ac9 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 18 Jun 2009 15:14:10 +0200 Subject: 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 Signed-off-by: Anthony Liguori --- hw/pci-hotplug.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'hw/pci-hotplug.c') diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index 031643e..952e27a 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -70,6 +70,10 @@ void drive_hot_add(Monitor *mon, const char *pci_addr, const char *opts) drive_idx = add_init_drive(opts); if (drive_idx < 0) return; + if (drives_table[drive_idx].devaddr) { + monitor_printf(mon, "Parameter addr not supported\n"); + return; + } type = drives_table[drive_idx].type; bus = drive_get_max_bus (type); @@ -116,6 +120,10 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon, drive_idx = add_init_drive(opts); if (drive_idx < 0) return NULL; + if (drives_table[drive_idx].devaddr) { + monitor_printf(mon, "Parameter addr not supported\n"); + return NULL; + } } else if (type == IF_VIRTIO) { monitor_printf(mon, "virtio requires a backing file/device.\n"); return NULL; -- cgit v1.1