From d176c495b6664b72dc1e595f6e89dc5648aa248b Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 31 Jul 2009 12:25:41 +0200 Subject: qdev-ify virtio-blk. First user of the new drive property. With this patch applied host and guest config can be specified separately, like this: -drive if=none,id=disk1,file=/path/to/disk.img -device virtio-blk-pci,drive=disk1 You can set any property for virtio-blk-pci now. You can set the pci address via addr=. You can switch the device into 0.10 compat mode using class=0x0180. As this is per device you can have one 0.10 and one 0.11 virtio block device in a single virtual machine. Old syntax continues to work. Internally it does the same as the two lines above though. One side effect this has is a different initialization order, which might result in a different pci address being assigned by default. Long term plan here is to have this working for all block devices, i.e. once all scsi is properly qdev-ified you will be able to do something like this: -drive if=none,id=sda,file=/path/to/disk.img -device lsi,id=lsi,addr= -device scsi-disk,drive=sda,bus=lsi.0,lun= Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori Message-Id: --- hw/ppc440_bamboo.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'hw/ppc440_bamboo.c') diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c index 5011679ccc..3c59f33099 100644 --- a/hw/ppc440_bamboo.c +++ b/hw/ppc440_bamboo.c @@ -90,7 +90,6 @@ static void bamboo_init(ram_addr_t ram_size, { unsigned int pci_irq_nrs[4] = { 28, 27, 26, 25 }; PCIBus *pcibus; - PCIDevice *pci_dev; CPUState *env; uint64_t elf_entry; uint64_t elf_lowaddr; @@ -102,21 +101,11 @@ static void bamboo_init(ram_addr_t ram_size, target_ulong dt_base = 0; void *fdt; int i; - DriveInfo *dinfo; /* Setup CPU. */ env = ppc440ep_init(&ram_size, &pcibus, pci_irq_nrs, 1, cpu_model); if (pcibus) { - int unit_id = 0; - - /* Add virtio block devices. */ - while ((dinfo = drive_get(IF_VIRTIO, 0, unit_id)) != NULL) { - pci_dev = pci_create("virtio-blk-pci", dinfo->devaddr); - qdev_init(&pci_dev->qdev); - unit_id++; - } - /* Add virtio console devices */ for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) { if (virtcon_hds[i]) { -- cgit v1.2.3-55-g7522