Skip to contentSkip to conversation

[5987] pci: virtio: use pci id defines (Gerd Hoffman)

Qemu-devel Anthony Liguori 1 participant 1 message Dec 11, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5987

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5987
Author:   aliguori
Date:     2008-12-11 21:20:03 +0000 (Thu, 11 Dec 2008)

Log Message:
-----------
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.

Modified Paths:
--------------
trunk/hw/pc.c
trunk/hw/virtio-balloon.c
trunk/hw/virtio-blk.c
trunk/hw/virtio-blk.h

Modified: trunk/hw/pc.c
===================================================================

hw/pc.c +1 -2
@@ -1101,8 +1101,7 @@
         int unit_id = 0;
 
         while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
-            virtio_blk_init(pci_bus, 0x1AF4, 0x1001,
-                            drives_table[index].bdrv);
+            virtio_blk_init(pci_bus, drives_table[index].bdrv);
             unit_id++;
         }
     }

Modified: trunk/hw/virtio-balloon.c
===================================================================

hw/virtio-balloon.c +2 -1
@@ -172,7 +172,8 @@
     VirtIOBalloon *s;
 
     s = (VirtIOBalloon *)virtio_init_pci(bus, "virtio-balloon",
-                                         6900, 0x1002,
+                                         PCI_VENDOR_ID_REDHAT_QUMRANET,
+                                         PCI_DEVICE_ID_VIRTIO_BALLOON,
                                          0, VIRTIO_ID_BALLOON,
                                          0x05, 0x00, 0x00,
                                          8, sizeof(VirtIOBalloon));

Modified: trunk/hw/virtio-blk.c
===================================================================

hw/virtio-blk.c +4 -3
@@ -218,14 +218,15 @@
     return 0;
 }
 
-void *virtio_blk_init(PCIBus *bus, uint16_t vendor, uint16_t device,
-                      BlockDriverState *bs)
+void *virtio_blk_init(PCIBus *bus, BlockDriverState *bs)
 {
     VirtIOBlock *s;
     int cylinders, heads, secs;
     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,
                                        0x01, 0x80, 0x00,
                                        sizeof(struct virtio_blk_config), sizeof(VirtIOBlock));

Modified: trunk/hw/virtio-blk.h
===================================================================

hw/virtio-blk.h +1 -2
@@ -70,7 +70,6 @@
     unsigned char status;
 };
 
-void *virtio_blk_init(PCIBus *bus, uint16_t vendor, uint16_t device,
-                      BlockDriverState *bs);
+void *virtio_blk_init(PCIBus *bus, BlockDriverState *bs);
 
 #endif