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<pbonz...@redhat.com>
---
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