[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 12/21] pci: Move pci_read_devaddr to pci-hotplug-o
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 12/21] pci: Move pci_read_devaddr to pci-hotplug-old.c |
Date: |
Tue, 25 Jun 2013 18:41:28 +0300 |
From: David Gibson <address@hidden>
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 <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/pci/pci-hotplug-old.c | 14 ++++++++++++++
hw/pci/pci.c | 16 +---------------
include/hw/pci/pci.h | 4 ++--
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/hw/pci/pci-hotplug-old.c b/hw/pci/pci-hotplug-old.c
index b3c233c..a0b5558 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)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index a3eb19e..57724df 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -522,7 +522,7 @@ static void pci_set_default_subsystem_id(PCIDevice *pci_dev)
* Parse [[<domain>:]<bus>:]<slot>, return -1 on error if funcp == NULL
* [[<domain>:]<bus>:]<slot>.<func>, return -1 on error
*/
-static int pci_parse_devaddr(const char *addr, int *domp, int *busp,
+int pci_parse_devaddr(const char *addr, int *domp, int *busp,
unsigned int *slotp, unsigned int *funcp)
{
const char *p;
@@ -581,20 +581,6 @@ static int pci_parse_devaddr(const char *addr, int *domp,
int *busp,
return 0;
}
-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;
-}
-
PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)
{
int dom, bus;
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index 8d075ab..3ef2ee1 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -396,8 +396,8 @@ PCIDevice *pci_find_device(PCIBus *bus, int bus_num,
uint8_t devfn);
int pci_qdev_find_device(const char *id, PCIDevice **pdev);
PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr);
-int pci_read_devaddr(Monitor *mon, const char *addr, int *domp, int *busp,
- unsigned *slotp);
+int pci_parse_devaddr(const char *addr, int *domp, int *busp,
+ unsigned int *slotp, unsigned int *funcp);
void pci_device_deassert_intx(PCIDevice *dev);
--
MST
- [Qemu-devel] [PULL v2 00/21] pci,kvm,misc enhancements, Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 01/21] range: add Range structure, Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 03/21] pc: pass PCI hole ranges to Guests, Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 06/21] kvm: zero-initialize KVM_SET_GSI_ROUTING input, Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 05/21] e1000: cleanup process_tx_desc, Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 12/21] pci: Move pci_read_devaddr to pci-hotplug-old.c,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 10/21] pvpanic: fix fwcfg for big endian hosts, Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 13/21] pci: Abolish pci_find_root_bus(), Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 14/21] pci: Use helper to find device's root bus in pci_find_domain(), Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 15/21] pci: Replace pci_find_domain() with more general pci_root_bus_path(), Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 16/21] pci: Add root bus argument to pci_get_bus_devfn(), Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 18/21] pci: Simpler implementation of primary PCI bus, Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 19/21] pci: Remove domain from PCIHostBus, Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 11/21] pci: Cleanup configuration for pci-hotplug.c, Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 20/21] pci: Fold host_buses list into PCIHostState functionality, Michael S. Tsirkin, 2013/06/25
- [Qemu-devel] [PULL v2 17/21] pci: Add root bus parameter to pci_nic_init(), Michael S. Tsirkin, 2013/06/25