aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@web.de>2009-06-26 00:04:00 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-29 14:18:07 -0500
commite9283f8b88eb6054ac032f3d9b773e80d842c0cf (patch)
treec081d619584bf9060bd4a7b37f0484cbb3a6ac0a /hw/pci.c
parent3b88e52b41fe77728b4accb68e14bed98bdc75d3 (diff)
monitor: Drop pci_addr prefix from hotplug commands
The "pci_addr=" prefix currently required by pci_add/remove and drive_add has no practical use. Drop it, but still silently accept it for backward compatibility. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 381fc2de20..63852c6ca3 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -232,14 +232,18 @@ static int pci_parse_devaddr(const char *addr, int *domp, int *busp, unsigned *s
return 0;
}
-int pci_read_devaddr(const char *addr, int *domp, int *busp, unsigned *slotp)
+int pci_read_devaddr(Monitor *mon, const char *addr, int *domp, int *busp,
+ unsigned *slotp)
{
- char devaddr[32];
-
- if (!get_param_value(devaddr, sizeof(devaddr), "pci_addr", addr))
+ /* strip legacy tag */
+ if (!strncmp(addr, "pci_addr=", 9)) {
+ addr += 9;
+ }
+ if (pci_parse_devaddr(addr, domp, busp, slotp)) {
+ monitor_printf(mon, "Invalid pci address\n");
return -1;
-
- return pci_parse_devaddr(devaddr, domp, busp, slotp);
+ }
+ return 0;
}
static PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)