qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.0] qom: Fix crash with qom-list and link properties
@ 2014-04-10 18:47 Cole Robinson
  2014-04-10 19:08 ` Marcel Apfelbaum
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Cole Robinson @ 2014-04-10 18:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Cole Robinson, m.gibula, Andreas Färber, Stefan Hajnoczi,
	Marcel Apfelbaum

Commit 9561fda8d90e176bef598ba87c42a1bd6ad03ef7 changed the type of
'opaque' for link properties, but missed updating this call site.
Reproducer:

./x86_64-softmmu/qemu-system-x86_64 -qmp unix:./qmp.sock,server &
./scripts/qmp/qmp-shell ./qmp.sock
(QEMU) qom-list path=//machine/i440fx/pci.0/child[2]

Reported-by: Marcin Gibuła <m.gibula@beyond.pl>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 qom/object.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qom/object.c b/qom/object.c
index f4de619..9a730e7 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1225,7 +1225,8 @@ Object *object_resolve_path_component(Object *parent, const gchar *part)
     }
 
     if (object_property_is_link(prop)) {
-        return *(Object **)prop->opaque;
+        LinkProperty *lprop = prop->opaque;
+        return *lprop->child;
     } else if (object_property_is_child(prop)) {
         return prop->opaque;
     } else {
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-11 17:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-10 18:47 [Qemu-devel] [PATCH for-2.0] qom: Fix crash with qom-list and link properties Cole Robinson
2014-04-10 19:08 ` Marcel Apfelbaum
2014-04-11 16:38 ` Peter Maydell
2014-04-11 16:57 ` Andreas Färber
2014-04-11 17:05   ` Cole Robinson
2014-04-11 17:12     ` Andreas Färber
2014-04-11 17:05   ` Peter Maydell

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).