Received: from eggs.gnu.org ([2001:4830:134:3::10]:40798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO4MR-0007gu-O2 for qemu-devel@nongnu.org; Tue, 26 Jan 2016 09:12:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO4MO-00044T-9w for qemu-devel@nongnu.org; Tue, 26 Jan 2016 09:12:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO4MO-000449-4Q for qemu-devel@nongnu.org; Tue, 26 Jan 2016 09:12:44 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 4F831C001273 for ; Tue, 26 Jan 2016 14:12:43 +0000 (UTC) Date: Tue, 26 Jan 2016 12:12:40 -0200 From: Eduardo Habkost Message-ID: <20160126141240.GM3869@thinpad.lan.raisama.net> References: <1453208789-42479-1-git-send-email-imammedo@redhat.com> <1453208789-42479-8-git-send-email-imammedo@redhat.com> <20160123145956.GK3869@thinpad.lan.raisama.net> <20160126112801.0654d81f@nial.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160126112801.0654d81f@nial.brq.redhat.com> Subject: Re: [Qemu-devel] [PATCH v17 7/9] add MachineClass->default_props for setting default device properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: mst@redhat.com, ghammer@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com, lersek@redhat.com On Tue, Jan 26, 2016 at 11:28:01AM +0100, Igor Mammedov wrote: > On Sat, 23 Jan 2016 12:59:56 -0200 > Eduardo Habkost wrote: > > > On Tue, Jan 19, 2016 at 02:06:27PM +0100, Igor Mammedov wrote: > > > Signed-off-by: Igor Mammedov > > > --- > > > include/hw/boards.h | 1 + > > > vl.c | 4 ++++ > > > 2 files changed, 5 insertions(+) > > > > > > diff --git a/include/hw/boards.h b/include/hw/boards.h > > > index 0f30959..d495611 100644 > > > --- a/include/hw/boards.h > > > +++ b/include/hw/boards.h > > > @@ -90,6 +90,7 @@ struct MachineClass { > > > const char *default_machine_opts; > > > const char *default_boot_order; > > > const char *default_display; > > > + GlobalProperty *default_props; > > > GlobalProperty *compat_props; > > > > Could you explain (in a comment?) the purpose of each field? They > > seem to do exactly the same thing, so why couldn't they become a > > single linked list, where the compat classes just append new > > items to the existing default_props list? > > > > (If we build default_props by appending instead of overwriting > > the parent class list, we will be able to finally eliminate > > PC_COMPAT_* macro nesting) > The only reason I've added it as separate field is to keep the > current way compat_props are working instead of rewriting > not related to this series part. > OK to me, but I would like to have the reason for having two very similar fields documented in struct MachineClass. > Alternatively we could add qdev_prop_prepend_global_list() API > and add static defaults calling it from board's machine-init. If we can choose between having stuff in MachineClass and adding extra machine-init code, I prefer to have it in MachineClass. -- Eduardo