From patchwork Sun Nov 14 15:39:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 323552 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAEFdt9M023801 for ; Sun, 14 Nov 2010 15:39:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756121Ab0KNPjr (ORCPT ); Sun, 14 Nov 2010 10:39:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58645 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756004Ab0KNPjq (ORCPT ); Sun, 14 Nov 2010 10:39:46 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAEFdgsC017164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 14 Nov 2010 10:39:42 -0500 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAEFdfSc014934; Sun, 14 Nov 2010 10:39:42 -0500 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 31010133A05; Sun, 14 Nov 2010 17:39:41 +0200 (IST) From: Gleb Natapov To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, blauwirbel@gmail.com, armbru@redhat.com, alex.williamson@redhat.com, mst@redhat.com, kevin@koconnor.net Subject: [PATCHv4 04/15] Add get_fw_dev_path callback to ISA bus in qdev. Date: Sun, 14 Nov 2010 17:39:30 +0200 Message-Id: <1289749181-12070-5-git-send-email-gleb@redhat.com> In-Reply-To: <1289749181-12070-1-git-send-email-gleb@redhat.com> References: <1289749181-12070-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 14 Nov 2010 15:39:55 +0000 (UTC) diff --git a/hw/isa-bus.c b/hw/isa-bus.c index c0ac7e9..c423c1b 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c @@ -31,11 +31,13 @@ static ISABus *isabus; target_phys_addr_t isa_mem_base = 0; static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent); +static char *isabus_get_fw_dev_path(DeviceState *dev); static struct BusInfo isa_bus_info = { .name = "ISA", .size = sizeof(ISABus), .print_dev = isabus_dev_print, + .get_fw_dev_path = isabus_get_fw_dev_path, }; ISABus *isa_bus_new(DeviceState *dev) @@ -188,4 +190,18 @@ static void isabus_register_devices(void) sysbus_register_withprop(&isabus_bridge_info); } +static char *isabus_get_fw_dev_path(DeviceState *dev) +{ + ISADevice *d = (ISADevice*)dev; + char path[40]; + int off; + + off = snprintf(path, sizeof(path), "%s", qdev_fw_name(dev)); + if (d->nioports) { + snprintf(path + off, sizeof(path) - off, "@%04x", d->ioports[0]); + } + + return strdup(path); +} + device_init(isabus_register_devices)