[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCHv2 7/8] Change pci bus get_dev_path callback to print
From: |
Gleb Natapov |
Subject: |
[Qemu-devel] [PATCHv2 7/8] Change pci bus get_dev_path callback to print only slot and func |
Date: |
Sun, 31 Oct 2010 13:40:08 +0200 |
Domain should be determined form parent bus and bus number is configured
by guest and should not be used in qemu internally.
Signed-off-by: Gleb Natapov <address@hidden>
---
hw/pci.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 92aaa85..1c5706f 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -2138,12 +2138,13 @@ 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",
- pci_find_domain(d->bus), d->config[PCI_SECONDARY_BUS],
- PCI_SLOT(d->devfn), PCI_FUNC(d->devfn));
+ char path[50];
+ int off;
+ off = snprintf(path, sizeof(path), "address@hidden", qdev_driver_name(dev),
+ PCI_SLOT(d->devfn));
+ if (PCI_FUNC(d->devfn))
+ snprintf(path + off, sizeof(path) + off, ",%x", PCI_FUNC(d->devfn));
return strdup(path);
}
--
1.7.1
- [Qemu-devel] [PATCHv2 0/8 RFC] boot order specification, Gleb Natapov, 2010/10/31
- [Qemu-devel] [PATCHv2 3/8] Add get_dev_path callback to ISA bus in qdev., Gleb Natapov, 2010/10/31
- [Qemu-devel] [PATCHv2 4/8] Store IDE bus id in IDEBus structure for easy access., Gleb Natapov, 2010/10/31
- [Qemu-devel] [PATCHv2 7/8] Change pci bus get_dev_path callback to print only slot and func,
Gleb Natapov <=
- [Qemu-devel] [PATCHv2 5/8] Add get_dev_path callback to IDE bus., Gleb Natapov, 2010/10/31
- [Qemu-devel] [PATCHv2 6/8] Add get_dev_path callback for system bus., Gleb Natapov, 2010/10/31
- [Qemu-devel] [PATCHv2 2/8] Keep track of ISA ports ISA device is using in qdev., Gleb Natapov, 2010/10/31
- [Qemu-devel] [PATCHv2 1/8] Introduce deriver_name field to DeviceInfo structure., Gleb Natapov, 2010/10/31
- [Qemu-devel] [PATCHv2 8/8] Add bootindex parameter to net/block/fd device, Gleb Natapov, 2010/10/31
- [Qemu-devel] Re: [PATCHv2 0/8 RFC] boot order specification, Kevin O'Connor, 2010/10/31