diff options
author | aliguori | 2009-02-11 16:20:29 +0100 |
---|---|---|
committer | aliguori | 2009-02-11 16:20:29 +0100 |
commit | b0a7b120a357733d9c554a1a3b125991114a1135 (patch) | |
tree | ffbfbcd4bb19dd5b6f2e047a47668e35f715f62a /hw/ide.c | |
parent | qemu: drive removal support (Marcelo Tosatti) (diff) | |
download | qemu-b0a7b120a357733d9c554a1a3b125991114a1135.tar.gz qemu-b0a7b120a357733d9c554a1a3b125991114a1135.tar.xz qemu-b0a7b120a357733d9c554a1a3b125991114a1135.zip |
qemu: record devfn on block driver instance (Marcelo Tosatti)
Record PCIDev on the BlockDriverState structure to locate for release
on hot-removal.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6597 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ide.c')
-rw-r--r-- | hw/ide.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -28,6 +28,7 @@ #include "scsi-disk.h" #include "pcmcia.h" #include "block.h" +#include "block_int.h" #include "qemu-timer.h" #include "sysemu.h" #include "ppc_mac.h" @@ -3352,6 +3353,7 @@ void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn, { PCIIDEState *d; uint8_t *pci_conf; + int i; /* register a function 1 of PIIX3 */ d = (PCIIDEState *)pci_register_device(bus, "PIIX3 IDE", @@ -3378,6 +3380,10 @@ void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn, ide_init_ioport(&d->ide_if[0], 0x1f0, 0x3f6); ide_init_ioport(&d->ide_if[2], 0x170, 0x376); + for (i = 0; i < 4; i++) + if (hd_table[i]) + hd_table[i]->private = &d->dev; + register_savevm("ide", 0, 2, pci_ide_save, pci_ide_load, d); } |