qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 07/16] qdev: allow reusing get/set for legacy pr


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 07/16] qdev: allow reusing get/set for legacy property
Date: Fri, 03 Feb 2012 09:11:05 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

On 02/02/2012 11:38 PM, Andreas Färber wrote:
Am 02.02.2012 17:45, schrieb Paolo Bonzini:
In some cases, a legacy property does need a special print method
but not a special parse method.  In this case, we can reuse the get/set
from the static (non-legacy) property.

If neither parse nor print is needed, though, do not register the
legacy property at all.  The previous patch ensures that the right
fallback will be used.

Signed-off-by: Paolo Bonzini<address@hidden>
---
  hw/qdev-monitor.c    |    5 ++---
  hw/qdev-properties.c |    6 +++---
  hw/qdev.c            |   11 +++++++----
  3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index 64505b4..e21bd50 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -489,8 +489,8 @@ static void qdev_print_props(Monitor *mon, DeviceState 
*dev, Property *props,
  {
      if (!props)
          return;
-    while (props->name) {
-        Error *err;
+    for (; props->name; props++) {
+        Error *err = NULL;

Do either of these fix a bug? Should be mentioned or avoided. [...]

Bugfix?

Yes, I squashed these in the wrong patch, thanks for catching it.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]