hw/ivshmem.c: convert to PCIDeviceInfo to initialize ids
authorIsaku Yamahata <yamahata@valinux.co.jp>
Wed, 25 May 2011 01:58:18 +0000 (10:58 +0900)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 12 Jun 2011 07:33:35 +0000 (10:33 +0300)
use PCIDeviceInfo to initialize ids.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/ivshmem.c

index 7b19a81a47c9956f73bb132586b3d71825fce4a2..3055dd2a5031f9c838514bcd0013e13eea3ac6d3 100644 (file)
@@ -706,12 +706,7 @@ static int pci_ivshmem_init(PCIDevice *dev)
     }
 
     pci_conf = s->dev.config;
-    pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_REDHAT_QUMRANET);
-    pci_conf[0x02] = 0x10;
-    pci_conf[0x03] = 0x11;
     pci_conf[PCI_COMMAND] = PCI_COMMAND_IO | PCI_COMMAND_MEMORY;
-    pci_config_set_class(pci_conf, PCI_CLASS_MEMORY_RAM);
-    pci_conf[PCI_HEADER_TYPE] = PCI_HEADER_TYPE_NORMAL;
 
     pci_config_set_interrupt_pin(pci_conf, 1);
 
@@ -809,6 +804,9 @@ static PCIDeviceInfo ivshmem_info = {
     .qdev.reset = ivshmem_reset,
     .init       = pci_ivshmem_init,
     .exit       = pci_ivshmem_uninit,
+    .vendor_id  = PCI_VENDOR_ID_REDHAT_QUMRANET,
+    .device_id  = 0x1110,
+    .class_id   = PCI_CLASS_MEMORY_RAM,
     .qdev.props = (Property[]) {
         DEFINE_PROP_CHR("chardev", IVShmemState, server_chr),
         DEFINE_PROP_STRING("size", IVShmemState, sizearg),