[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCHv2 5/8] Add get_dev_path callback to IDE bus.
From: |
Gleb Natapov |
Subject: |
[Qemu-devel] [PATCHv2 5/8] Add get_dev_path callback to IDE bus. |
Date: |
Sun, 31 Oct 2010 13:40:06 +0200 |
Signed-off-by: Gleb Natapov <address@hidden>
---
hw/ide/qdev.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 3ad2138..7db2f19 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -24,9 +24,12 @@
/* --------------------------------- */
+static char *idebus_get_dev_path(DeviceState *dev);
+
static struct BusInfo ide_bus_info = {
.name = "IDE",
.size = sizeof(IDEBus),
+ .get_dev_path = idebus_get_dev_path,
};
void ide_bus_new(IDEBus *idebus, DeviceState *dev, uint8_t bus_id)
@@ -35,6 +38,17 @@ void ide_bus_new(IDEBus *idebus, DeviceState *dev, uint8_t
bus_id)
idebus->bus_id = bus_id;
}
+static char *idebus_get_dev_path(DeviceState *dev)
+{
+ IDEDevice *d = (IDEDevice*)dev;
+ char path[30];
+
+ snprintf(path, sizeof(path), "address@hidden:%d", qdev_driver_name(dev),
+ ((IDEBus*)dev->parent_bus)->bus_id, d->unit);
+
+ return strdup(path);
+}
+
static int ide_qdev_init(DeviceState *qdev, DeviceInfo *base)
{
IDEDevice *dev = DO_UPCAST(IDEDevice, qdev, qdev);
--
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, 2010/10/31
- [Qemu-devel] [PATCHv2 5/8] Add get_dev_path callback to IDE bus.,
Gleb Natapov <=
- [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