Commit 9b32d5a5f75b6823940faf2ffa05341608ec5423
1 parent
d350d97d
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
Showing
4 changed files
with
8 additions
and
8 deletions
hw/pc.c
... | ... | @@ -1101,8 +1101,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, |
1101 | 1101 | int unit_id = 0; |
1102 | 1102 | |
1103 | 1103 | while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) { |
1104 | - virtio_blk_init(pci_bus, 0x1AF4, 0x1001, | |
1105 | - drives_table[index].bdrv); | |
1104 | + virtio_blk_init(pci_bus, drives_table[index].bdrv); | |
1106 | 1105 | unit_id++; |
1107 | 1106 | } |
1108 | 1107 | } | ... | ... |
hw/virtio-balloon.c
... | ... | @@ -172,7 +172,8 @@ void *virtio_balloon_init(PCIBus *bus) |
172 | 172 | VirtIOBalloon *s; |
173 | 173 | |
174 | 174 | s = (VirtIOBalloon *)virtio_init_pci(bus, "virtio-balloon", |
175 | - 6900, 0x1002, | |
175 | + PCI_VENDOR_ID_REDHAT_QUMRANET, | |
176 | + PCI_DEVICE_ID_VIRTIO_BALLOON, | |
176 | 177 | 0, VIRTIO_ID_BALLOON, |
177 | 178 | 0x05, 0x00, 0x00, |
178 | 179 | 8, sizeof(VirtIOBalloon)); | ... | ... |
hw/virtio-blk.c
... | ... | @@ -218,14 +218,15 @@ static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id) |
218 | 218 | return 0; |
219 | 219 | } |
220 | 220 | |
221 | -void *virtio_blk_init(PCIBus *bus, uint16_t vendor, uint16_t device, | |
222 | - BlockDriverState *bs) | |
221 | +void *virtio_blk_init(PCIBus *bus, BlockDriverState *bs) | |
223 | 222 | { |
224 | 223 | VirtIOBlock *s; |
225 | 224 | int cylinders, heads, secs; |
226 | 225 | static int virtio_blk_id; |
227 | 226 | |
228 | - s = (VirtIOBlock *)virtio_init_pci(bus, "virtio-blk", vendor, device, | |
227 | + s = (VirtIOBlock *)virtio_init_pci(bus, "virtio-blk", | |
228 | + PCI_VENDOR_ID_REDHAT_QUMRANET, | |
229 | + PCI_DEVICE_ID_VIRTIO_BLOCK, | |
229 | 230 | 0, VIRTIO_ID_BLOCK, |
230 | 231 | 0x01, 0x80, 0x00, |
231 | 232 | sizeof(struct virtio_blk_config), sizeof(VirtIOBlock)); | ... | ... |
hw/virtio-blk.h