From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: [PATCHv8 06/16] Add get_fw_dev_path callback to IDE bus. Date: Wed, 8 Dec 2010 13:34:59 +0200 Message-ID: <1291808109-22563-7-git-send-email-gleb@redhat.com> References: <1291808109-22563-1-git-send-email-gleb@redhat.com> Cc: kvm@vger.kernel.org, blauwirbel@gmail.com, anthony@codemonkey.ws, kevin@koconnor.net To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55158 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754396Ab0LHLfR (ORCPT ); Wed, 8 Dec 2010 06:35:17 -0500 In-Reply-To: <1291808109-22563-1-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Gleb Natapov --- hw/ide/qdev.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 88ff657..01a181b 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -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); -- 1.7.2.3