提交 dc1a46b6 编写于 作者: G Gleb Natapov 提交者: Blue Swirl

Add get_fw_dev_path callback to IDE bus.

Signed-off-by: NGleb Natapov <gleb@redhat.com>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 3835510f
......@@ -24,9 +24,12 @@
/* --------------------------------- */
static char *idebus_get_fw_dev_path(DeviceState *dev);
static struct BusInfo ide_bus_info = {
.name = "IDE",
.size = sizeof(IDEBus),
.get_fw_dev_path = idebus_get_fw_dev_path,
};
void ide_bus_new(IDEBus *idebus, DeviceState *dev, int bus_id)
......@@ -35,6 +38,16 @@ void ide_bus_new(IDEBus *idebus, DeviceState *dev, int bus_id)
idebus->bus_id = bus_id;
}
static char *idebus_get_fw_dev_path(DeviceState *dev)
{
char path[30];
snprintf(path, sizeof(path), "%s@%d", qdev_fw_name(dev),
((IDEBus*)dev->parent_bus)->bus_id);
return strdup(path);
}
static int ide_qdev_init(DeviceState *qdev, DeviceInfo *base)
{
IDEDevice *dev = DO_UPCAST(IDEDevice, qdev, qdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册