mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
3b88e52b41
commit
e9283f8b88
4 changed files with 24 additions and 23 deletions
16
hw/pci.c
16
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue