[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 03/15] pci: Implement BusInfo.get_dev_path()
From: |
Alex Williamson |
Subject: |
Re: [Qemu-devel] [PATCH 03/15] pci: Implement BusInfo.get_dev_path() |
Date: |
Thu, 24 Jun 2010 09:05:11 -0600 |
On Thu, 2010-06-24 at 16:39 +0900, Isaku Yamahata wrote:
> On Wed, Jun 23, 2010 at 10:41:13PM -0600, Alex Williamson wrote:
> > This works great for PCI since a <segment>:<bus>:<dev>.<fn> uniquely
> > describes a global address. No need to traverse up the qdev tree.
> > PCI segment support is a placeholder for compatibility once we
> > support multiple segments.
> >
> > Signed-off-by: Alex Williamson <address@hidden>
> > ---
> >
> > hw/pci.c | 14 ++++++++++++++
> > 1 files changed, 14 insertions(+), 0 deletions(-)
> >
> > diff --git a/hw/pci.c b/hw/pci.c
> > index 7787005..5c9d6b4 100644
> > --- a/hw/pci.c
> > +++ b/hw/pci.c
> > @@ -58,11 +58,13 @@ struct PCIBus {
> > };
> >
> > static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent);
> > +static char *pcibus_get_dev_path(DeviceState *dev);
> >
> > static struct BusInfo pci_bus_info = {
> > .name = "PCI",
> > .size = sizeof(PCIBus),
> > .print_dev = pcibus_dev_print,
> > + .get_dev_path = pcibus_get_dev_path,
> > .props = (Property[]) {
> > DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1),
> > DEFINE_PROP_STRING("romfile", PCIDevice, romfile),
> > @@ -1853,6 +1855,18 @@ static void pcibus_dev_print(Monitor *mon,
> > DeviceState *dev, int indent)
> > }
> > }
> >
> > +static char *pcibus_get_dev_path(DeviceState *dev)
> > +{
> > + PCIDevice *d = (PCIDevice *)dev;
> > + char path[16];
> > +
> > + snprintf(path, sizeof(path), "%04x:%02x:%02x.%x",
> > + 0 /* FIXME for segment support */,
> > d->config[PCI_SECONDARY_BUS],
>
> pci_find_domain(d->bus)
Thank you Isaku, I'll make the change.
Alex
- [Qemu-devel] [PATCH 00/15] Make migration work with hotplug, Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 01/15] Remove uses of ram.last_offset (aka last_ram_offset), Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 02/15] qdev: Add a get_dev_path() function to BusInfo, Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 03/15] pci: Implement BusInfo.get_dev_path(), Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 04/15] savevm: Add DeviceState param, Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 05/15] savevm: Make use of DeviceState, Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 06/15] eepro100: Add a dev field to eeprom new/free functions, Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 07/15] virtio-net: Incorporate a DeviceState pointer and let savevm track instances, Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 08/15] qemu_ram_alloc: Add DeviceState and name parameters, Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 10/15] savevm: Migrate RAM based on name/offset, Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 09/15] ramblocks: Make use of DeviceState pointer and BusInfo.get_dev_path, Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 11/15] savevm: Use RAM blocks for basis of migration, Alex Williamson, 2010/06/24
- [Qemu-devel] [PATCH 12/15] savevm: Create a new continue flag to avoid resending block name, Alex Williamson, 2010/06/24