Received: from [140.186.70.92] (port=44299 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSCvJ-0002Hf-D2 for qemu-devel@nongnu.org; Fri, 25 Jun 2010 13:42:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OSCOe-00061q-GF for qemu-devel@nongnu.org; Fri, 25 Jun 2010 13:08:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23891) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSCOe-00061i-7N for qemu-devel@nongnu.org; Fri, 25 Jun 2010 13:08:56 -0400 From: Alex Williamson Date: Fri, 25 Jun 2010 11:08:52 -0600 Message-ID: <20100625170852.8325.77207.stgit@localhost.localdomain> In-Reply-To: <20100625170544.8325.62081.stgit@localhost.localdomain> References: <20100625170544.8325.62081.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v2 03/16] qdev: Add a get_dev_path() function to BusInfo List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: alex.williamson@redhat.com 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; };