From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPJsc-0004L0-DP for qemu-devel@nongnu.org; Tue, 01 May 2012 16:41:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPJsa-0006mG-Ca for qemu-devel@nongnu.org; Tue, 01 May 2012 16:41:01 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:55792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPJsa-0006lw-5q for qemu-devel@nongnu.org; Tue, 01 May 2012 16:41:00 -0400 Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 May 2012 14:40:53 -0600 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 894243E40048 for ; Tue, 1 May 2012 14:40:23 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q41KeHoY234642 for ; Tue, 1 May 2012 14:40:19 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q41KesQp029174 for ; Tue, 1 May 2012 14:40:54 -0600 Message-ID: <4FA04A2E.4060607@us.ibm.com> Date: Tue, 01 May 2012 15:40:14 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1335896294-9530-1-git-send-email-aliguori@us.ibm.com> <1335896294-9530-9-git-send-email-aliguori@us.ibm.com> <4FA03A22.9050406@suse.de> In-Reply-To: <4FA03A22.9050406@suse.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 08/14] qdev: convert busses to QEMU Object Model List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: Wanpeng Li , Peter Maydell , qemu-devel@nongnu.org, Paolo Bonzini On 05/01/2012 02:31 PM, Andreas Färber wrote: > Am 01.05.2012 20:18, schrieb Anthony Liguori: >> This is far less interesting than it sounds. We simply add an Object to each >> BusInfo and then register the types appropriately. Most of the interesting >> refactoring will follow in the next patches. >> >> Since we're changing fundamental type names (BusInfo -> BusClass), it all needs >> to convert at once. Fortunately, not a lot of code is affected. >> >> Signed-off-by: Anthony Liguori >> --- > [...] >> diff --git a/hw/intel-hda.c b/hw/intel-hda.c >> index 9405f54..58497e5 100644 >> --- a/hw/intel-hda.c >> +++ b/hw/intel-hda.c >> @@ -29,16 +29,19 @@ >> /* --------------------------------------------------------------------- */ >> /* hda bus */ >> >> -static struct BusInfo hda_codec_bus_info = { >> - .name = "HDA", >> - .size = sizeof(HDACodecBus), >> +#define TYPE_HDA_BUS "HDA" > > I stumbled over this being a pretty generic term for a type name. > "HDA-codec-bus" maybe? It's unfortunately part of the ABI, so it cannot be changed :-( >> diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c >> index f5ee166..97673dd 100644 >> --- a/hw/qdev-monitor.c >> +++ b/hw/qdev-monitor.c > [...] >> @@ -432,16 +433,16 @@ DeviceState *qdev_device_add(QemuOpts *opts) >> if (!bus) { >> return NULL; >> } >> - if (bus->info != k->bus_info) { >> + if (strcmp(object_get_typename(OBJECT(bus)), k->bus_type) != 0){ > > Space before {. Ack. >> >> struct BusState { >> + Object obj; >> DeviceState *parent; >> - BusInfo *info; >> const char *name; >> int allow_hotplug; >> int qdev_allocated; > > Indicate what is /*< private>*/ and what not? Ack. > >> @@ -321,7 +323,7 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev, >> char *qdev_get_fw_dev_path(DeviceState *dev); >> >> /* This is a nasty hack to allow passing a NULL bus to qdev_create. */ >> -extern struct BusInfo system_bus_info; >> +#define TYPE_SYSTEM_BUS "System" > > "System-bus"? > > Regarding the bus names, these have been merely moved here but I'm > raising the topic because they are now in the global name space where > they will potentially conflict with devices and other types. The problem is they are already part of our existing ABI. If we change it, it will break existing bus ids and qdev paths. Regards, Anthony Liguori