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,8 +1101,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, | ||
1101 | int unit_id = 0; | 1101 | int unit_id = 0; |
1102 | 1102 | ||
1103 | while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) { | 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 | unit_id++; | 1105 | unit_id++; |
1107 | } | 1106 | } |
1108 | } | 1107 | } |
hw/virtio-balloon.c
@@ -172,7 +172,8 @@ void *virtio_balloon_init(PCIBus *bus) | @@ -172,7 +172,8 @@ void *virtio_balloon_init(PCIBus *bus) | ||
172 | VirtIOBalloon *s; | 172 | VirtIOBalloon *s; |
173 | 173 | ||
174 | s = (VirtIOBalloon *)virtio_init_pci(bus, "virtio-balloon", | 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 | 0, VIRTIO_ID_BALLOON, | 177 | 0, VIRTIO_ID_BALLOON, |
177 | 0x05, 0x00, 0x00, | 178 | 0x05, 0x00, 0x00, |
178 | 8, sizeof(VirtIOBalloon)); | 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,14 +218,15 @@ static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id) | ||
218 | return 0; | 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 | VirtIOBlock *s; | 223 | VirtIOBlock *s; |
225 | int cylinders, heads, secs; | 224 | int cylinders, heads, secs; |
226 | static int virtio_blk_id; | 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 | 0, VIRTIO_ID_BLOCK, | 230 | 0, VIRTIO_ID_BLOCK, |
230 | 0x01, 0x80, 0x00, | 231 | 0x01, 0x80, 0x00, |
231 | sizeof(struct virtio_blk_config), sizeof(VirtIOBlock)); | 232 | sizeof(struct virtio_blk_config), sizeof(VirtIOBlock)); |
hw/virtio-blk.h
@@ -70,7 +70,6 @@ struct virtio_blk_inhdr | @@ -70,7 +70,6 @@ struct virtio_blk_inhdr | ||
70 | unsigned char status; | 70 | unsigned char status; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | -void *virtio_blk_init(PCIBus *bus, uint16_t vendor, uint16_t device, | ||
74 | - BlockDriverState *bs); | 73 | +void *virtio_blk_init(PCIBus *bus, BlockDriverState *bs); |
75 | 74 | ||
76 | #endif | 75 | #endif |