From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PULL 04/10] vl: Convert machine help code to use object property iterators
Date: Wed, 18 Nov 2015 21:22:35 +0100 [thread overview]
Message-ID: <1447878161-5009-5-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1447878161-5009-1-git-send-email-afaerber@suse.de>
From: "Daniel P. Berrange" <berrange@redhat.com>
Stop directly accessing the Object::properties field data
structure and instead use the formal object property iterator
APIs. This insulates the code from future data structure
changes in the Object struct.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
vl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/vl.c b/vl.c
index 7d993a5..4211ff1 100644
--- a/vl.c
+++ b/vl.c
@@ -1536,12 +1536,14 @@ MachineInfoList *qmp_query_machines(Error **errp)
static int machine_help_func(QemuOpts *opts, MachineState *machine)
{
ObjectProperty *prop;
+ ObjectPropertyIterator *iter;
if (!qemu_opt_has_help_opt(opts)) {
return 0;
}
- QTAILQ_FOREACH(prop, &OBJECT(machine)->properties, node) {
+ iter = object_property_iter_init(OBJECT(machine));
+ while ((prop = object_property_iter_next(iter))) {
if (!prop->set) {
continue;
}
@@ -1554,6 +1556,7 @@ static int machine_help_func(QemuOpts *opts, MachineState *machine)
error_printf("\n");
}
}
+ object_property_iter_free(iter);
return 1;
}
--
2.6.2
next prev parent reply other threads:[~2015-11-18 20:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-18 20:22 [Qemu-devel] [PULL for-2.5 00/10] QOM devices patch queue 2015-11-18 Andreas Färber
2015-11-18 20:22 ` [Qemu-devel] [PULL 01/10] qdev: Change Property::offset field to ptrdiff_t type Andreas Färber
2015-11-18 20:22 ` [Qemu-devel] [PULL 02/10] qom: Introduce ObjectPropertyIterator struct for iteration Andreas Färber
2015-11-18 20:22 ` [Qemu-devel] [PULL 03/10] qmp: Convert QMP code to use object property iterators Andreas Färber
2015-11-18 20:22 ` Andreas Färber [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-11-18 20:39 [Qemu-devel] [PULL for-2.5 00/10] QOM devices patch queue 2015-11-18 Andreas Färber
2015-11-18 20:39 ` [Qemu-devel] [PULL 04/10] vl: Convert machine help code to use object property iterators Andreas Färber
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=1447878161-5009-5-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=pbonzini@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).