From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO0r2-0005cp-Gw for qemu-devel@nongnu.org; Tue, 26 Jan 2016 05:28:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO0qz-0004uE-Bg for qemu-devel@nongnu.org; Tue, 26 Jan 2016 05:28:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO0qz-0004uA-6H for qemu-devel@nongnu.org; Tue, 26 Jan 2016 05:28:05 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id B0852C0ED3F4 for ; Tue, 26 Jan 2016 10:28:04 +0000 (UTC) Date: Tue, 26 Jan 2016 11:28:01 +0100 From: Igor Mammedov Message-ID: <20160126112801.0654d81f@nial.brq.redhat.com> In-Reply-To: <20160123145956.GK3869@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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Eduardo Habkost Cc: mst@redhat.com, ghammer@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com, lersek@redhat.com 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. Alternatively we could add qdev_prop_prepend_global_list() API and add static defaults calling it from board's machine-init.