diff options
author | Jan Kiszka <jan.kiszka@web.de> | 2009-06-26 00:04:00 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-29 14:18:07 -0500 |
commit | e9283f8b88eb6054ac032f3d9b773e80d842c0cf (patch) | |
tree | c081d619584bf9060bd4a7b37f0484cbb3a6ac0a /hw/pci.c | |
parent | 3b88e52b41fe77728b4accb68e14bed98bdc75d3 (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.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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) |