pci: virtio: use pci id defines (Gerd Hoffman)
Use the defines added by the previous patch in the virtio drivers. Also remove the pointless vendor and device args from the virtio_blk_init() function. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5987 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
d350d97d19
commit
9b32d5a5f7
3
hw/pc.c
3
hw/pc.c
|
@ -1101,8 +1101,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
|
||||||
int unit_id = 0;
|
int unit_id = 0;
|
||||||
|
|
||||||
while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
|
while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
|
||||||
virtio_blk_init(pci_bus, 0x1AF4, 0x1001,
|
virtio_blk_init(pci_bus, drives_table[index].bdrv);
|
||||||
drives_table[index].bdrv);
|
|
||||||
unit_id++;
|
unit_id++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,7 +172,8 @@ void *virtio_balloon_init(PCIBus *bus)
|
||||||
VirtIOBalloon *s;
|
VirtIOBalloon *s;
|
||||||
|
|
||||||
s = (VirtIOBalloon *)virtio_init_pci(bus, "virtio-balloon",
|
s = (VirtIOBalloon *)virtio_init_pci(bus, "virtio-balloon",
|
||||||
6900, 0x1002,
|
PCI_VENDOR_ID_REDHAT_QUMRANET,
|
||||||
|
PCI_DEVICE_ID_VIRTIO_BALLOON,
|
||||||
0, VIRTIO_ID_BALLOON,
|
0, VIRTIO_ID_BALLOON,
|
||||||
0x05, 0x00, 0x00,
|
0x05, 0x00, 0x00,
|
||||||
8, sizeof(VirtIOBalloon));
|
8, sizeof(VirtIOBalloon));
|
||||||
|
|
|
@ -218,14 +218,15 @@ static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *virtio_blk_init(PCIBus *bus, uint16_t vendor, uint16_t device,
|
void *virtio_blk_init(PCIBus *bus, BlockDriverState *bs)
|
||||||
BlockDriverState *bs)
|
|
||||||
{
|
{
|
||||||
VirtIOBlock *s;
|
VirtIOBlock *s;
|
||||||
int cylinders, heads, secs;
|
int cylinders, heads, secs;
|
||||||
static int virtio_blk_id;
|
static int virtio_blk_id;
|
||||||
|
|
||||||
s = (VirtIOBlock *)virtio_init_pci(bus, "virtio-blk", vendor, device,
|
s = (VirtIOBlock *)virtio_init_pci(bus, "virtio-blk",
|
||||||
|
PCI_VENDOR_ID_REDHAT_QUMRANET,
|
||||||
|
PCI_DEVICE_ID_VIRTIO_BLOCK,
|
||||||
0, VIRTIO_ID_BLOCK,
|
0, VIRTIO_ID_BLOCK,
|
||||||
0x01, 0x80, 0x00,
|
0x01, 0x80, 0x00,
|
||||||
sizeof(struct virtio_blk_config), sizeof(VirtIOBlock));
|
sizeof(struct virtio_blk_config), sizeof(VirtIOBlock));
|
||||||
|
|
|
@ -70,7 +70,6 @@ struct virtio_blk_inhdr
|
||||||
unsigned char status;
|
unsigned char status;
|
||||||
};
|
};
|
||||||
|
|
||||||
void *virtio_blk_init(PCIBus *bus, uint16_t vendor, uint16_t device,
|
void *virtio_blk_init(PCIBus *bus, BlockDriverState *bs);
|
||||||
BlockDriverState *bs);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue