All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Crístian Viana" <vianac@linux.vnet.ibm.com>
To: QEMU Development ML <qemu-devel@nongnu.org>
Cc: "Crístian Viana" <vianac@linux.vnet.ibm.com>,
	"Anthony Liguori" <anthony@codemonkey.ws>
Subject: [Qemu-devel] [PATCH v6 1/3] Check if GlobalProperty exists before registering
Date: Wed, 18 Jul 2012 15:02:35 -0300	[thread overview]
Message-ID: <1342634557-31296-1-git-send-email-vianac@linux.vnet.ibm.com> (raw)

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 <vianac@linux.vnet.ibm.com>
---
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

             reply	other threads:[~2012-07-18 18:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 18:02 Crístian Viana [this message]
2012-07-18 18:02 ` [Qemu-devel] [PATCH v6 2/3] Force driftfix=none on previous machines Crístian Viana
2012-07-18 18:02 ` [Qemu-devel] [PATCH v6 3/3] Change driftfix default value to slew Crístian Viana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342634557-31296-1-git-send-email-vianac@linux.vnet.ibm.com \
    --to=vianac@linux.vnet.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.