From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrYaI-00023X-V0 for qemu-devel@nongnu.org; Wed, 18 Jul 2012 14:02:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrYaH-0002d6-SH for qemu-devel@nongnu.org; Wed, 18 Jul 2012 14:02:50 -0400 Received: from e24smtp03.br.ibm.com ([32.104.18.24]:37997) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrYaH-0002cG-Gv for qemu-devel@nongnu.org; Wed, 18 Jul 2012 14:02:49 -0400 Received: from /spool/local by e24smtp03.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Jul 2012 15:02:44 -0300 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id B2BD8352004B for ; Wed, 18 Jul 2012 14:02:38 -0400 (EDT) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.8.31.93]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6IHxIwq3092674 for ; Wed, 18 Jul 2012 14:59:18 -0300 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6II2dO8016578 for ; Wed, 18 Jul 2012 15:02:40 -0300 From: =?UTF-8?q?Cr=C3=ADstian=20Viana?= Date: Wed, 18 Jul 2012 15:02:35 -0300 Message-Id: <1342634557-31296-1-git-send-email-vianac@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v6 1/3] Check if GlobalProperty exists before registering List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Development ML Cc: =?UTF-8?q?Cr=C3=ADstian=20Viana?= , Anthony Liguori If a GlobalProperty has already been registered, it won't have its value overwritten. This is done to enforce that the properties specified in the command line will "win" over the ones specified by the machine properties, if set with the parameter "-M". Signed-off-by: Crístian Viana --- Changes since v5: - Updated commit message of PATCH 1/3 - Rebased on master hw/qdev-properties.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index 3571cf3..8356879 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -1212,6 +1212,14 @@ static QTAILQ_HEAD(, GlobalProperty) global_props = QTAILQ_HEAD_INITIALIZER(glob static void qdev_prop_register_global(GlobalProperty *prop) { + GlobalProperty *p; + + QTAILQ_FOREACH(p, &global_props, next) { + if (strcmp(prop->driver, p->driver) == 0) { + return; + } + } + QTAILQ_INSERT_TAIL(&global_props, prop, next); } -- 1.7.9.5