summary refs log tree commit diff stats
path: root/hw/xen/xen_pvdevice.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@amazon.com>2013-12-06 12:58:28 -0800
committerAnthony Liguori <aliguori@amazon.com>2013-12-06 12:58:28 -0800
commit9ed5dacbfa0f3f74238854776385f150b68e78b9 (patch)
tree8c3ed48bd6e89fb2ee199ab6b2287ca2e17f165c /hw/xen/xen_pvdevice.c
parentcdac7a7184065467ba45ec83a9abfeeae060ce4b (diff)
parent539891a85d17bd8c23a2547e52e26993350d2c3a (diff)
downloadfocaccia-qemu-9ed5dacbfa0f3f74238854776385f150b68e78b9.tar.gz
focaccia-qemu-9ed5dacbfa0f3f74238854776385f150b68e78b9.zip
Merge remote-tracking branch 'sstabellini/xen-2013-12-01' into staging
# By Paul Durrant (1) and Wei Liu (1)
# Via Stefano Stabellini
* sstabellini/xen-2013-12-01:
  xen-pvdevice: make device-id property compulsory
  xen: fix two errors when debug is enabled

Message-id: alpine.DEB.2.02.1312011829000.3198@kaball.uk.xensource.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
Diffstat (limited to 'hw/xen/xen_pvdevice.c')
-rw-r--r--hw/xen/xen_pvdevice.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/xen/xen_pvdevice.c b/hw/xen/xen_pvdevice.c
index 1132c8934f..c2189473ba 100644
--- a/hw/xen/xen_pvdevice.c
+++ b/hw/xen/xen_pvdevice.c
@@ -74,6 +74,10 @@ static int xen_pv_init(PCIDevice *pci_dev)
     XenPVDevice *d = XEN_PV_DEVICE(pci_dev);
     uint8_t *pci_conf;
 
+    /* device-id property must always be supplied */
+    if (d->device_id == 0xffff)
+	    return -1;
+
     pci_conf = pci_dev->config;
 
     pci_set_word(pci_conf + PCI_VENDOR_ID, d->vendor_id);
@@ -99,7 +103,7 @@ static int xen_pv_init(PCIDevice *pci_dev)
 
 static Property xen_pv_props[] = {
     DEFINE_PROP_UINT16("vendor-id", XenPVDevice, vendor_id, PCI_VENDOR_ID_XEN),
-    DEFINE_PROP_UINT16("device-id", XenPVDevice, device_id, PCI_DEVICE_ID_XEN_PVDEVICE),
+    DEFINE_PROP_UINT16("device-id", XenPVDevice, device_id, 0xffff),
     DEFINE_PROP_UINT8("revision", XenPVDevice, revision, 0x01),
     DEFINE_PROP_UINT32("size", XenPVDevice, size, 0x400000),
     DEFINE_PROP_END_OF_LIST()