summary refs log tree commit diff stats
path: root/hw/pci/pci-hotplug-old.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2013-06-06 18:48:46 +1000
committerMichael S. Tsirkin <mst@redhat.com>2013-07-04 10:45:31 +0300
commit6ac363b50c569815786a795d806e068b3f6a07eb (patch)
tree7db15e73a59a2680ca985b48cbb685892aadec5c /hw/pci/pci-hotplug-old.c
parent79ca616f291124d166ca173e512c4ace1c2fe8b2 (diff)
downloadfocaccia-qemu-6ac363b50c569815786a795d806e068b3f6a07eb.tar.gz
focaccia-qemu-6ac363b50c569815786a795d806e068b3f6a07eb.zip
pci: Move pci_read_devaddr to pci-hotplug-old.c
pci_read_devaddr() is only used by the legacy functions for the old PCI
hotplug interface in pci-hotplug-old.c.  So we move the function there,
and make it static.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci/pci-hotplug-old.c')
-rw-r--r--hw/pci/pci-hotplug-old.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/pci/pci-hotplug-old.c b/hw/pci/pci-hotplug-old.c
index b3c233caef..a0b5558789 100644
--- a/hw/pci/pci-hotplug-old.c
+++ b/hw/pci/pci-hotplug-old.c
@@ -36,6 +36,20 @@
 #include "sysemu/blockdev.h"
 #include "qapi/error.h"
 
+static int pci_read_devaddr(Monitor *mon, const char *addr, int *domp,
+                            int *busp, unsigned *slotp)
+{
+    /* strip legacy tag */
+    if (!strncmp(addr, "pci_addr=", 9)) {
+        addr += 9;
+    }
+    if (pci_parse_devaddr(addr, domp, busp, slotp, NULL)) {
+        monitor_printf(mon, "Invalid pci address\n");
+        return -1;
+    }
+    return 0;
+}
+
 static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
                                        const char *devaddr,
                                        const char *opts_str)