From patchwork Thu Jun 24 04:41:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 56743 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C520BB6F0E for ; Thu, 24 Jun 2010 14:43:13 +1000 (EST) Received: from localhost ([127.0.0.1]:55612 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OReHM-0002nv-VT for incoming@patchwork.ozlabs.org; Thu, 24 Jun 2010 00:43:09 -0400 Received: from [140.186.70.92] (port=37657 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OReFd-0002m8-M2 for qemu-devel@nongnu.org; Thu, 24 Jun 2010 00:41:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OReFZ-0001Ki-Bq for qemu-devel@nongnu.org; Thu, 24 Jun 2010 00:41:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14312) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OReFZ-0001Ka-2P for qemu-devel@nongnu.org; Thu, 24 Jun 2010 00:41:17 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5O4f8Ni014301 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 Jun 2010 00:41:08 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5O4f6XF024784; Thu, 24 Jun 2010 00:41:06 -0400 From: Alex Williamson To: qemu-devel@nongnu.org Date: Wed, 23 Jun 2010 22:41:05 -0600 Message-ID: <20100624044105.16168.95440.stgit@localhost.localdomain> In-Reply-To: <20100624044046.16168.32804.stgit@localhost.localdomain> References: <20100624044046.16168.32804.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: jan.kiszka@siemens.com, armbru@redhat.com, alex.williamson@redhat.com, kraxel@redhat.com, cam@cs.ualberta.ca, paul@codesourcery.com Subject: [Qemu-devel] [PATCH 02/15] qdev: Add a get_dev_path() function to BusInfo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This function is meant to provide a stable device path for buses which are able to implement it. If a bus has a globally unique addresses scheme, one address level may be sufficient to provide a path. Other buses may need to recursively traverse up the qdev tree. Signed-off-by: Alex Williamson --- hw/qdev.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/qdev.h b/hw/qdev.h index be5ad67..d64619f 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -49,10 +49,13 @@ struct DeviceState { }; typedef void (*bus_dev_printfn)(Monitor *mon, DeviceState *dev, int indent); +typedef char *(*bus_get_dev_path)(DeviceState *dev); + struct BusInfo { const char *name; size_t size; bus_dev_printfn print_dev; + bus_get_dev_path get_dev_path; Property *props; };