qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] qom: Fix ambiguous path detection when ambiguous=NULL
@ 2017-07-07 21:30 Eduardo Habkost
  2017-07-07 21:30 ` [Qemu-devel] [PATCH 1/2] tests: Test case for object_resolve_path*() Eduardo Habkost
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Eduardo Habkost @ 2017-07-07 21:30 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Andreas Färber, Igor Mammedov,
	Mark Cave-Ayland

object_resolve_path*() ambiguous path detection breaks when
ambiguous==NULL and the object tree have 3 objects of the same type and
only 2 of them are under the same parent.  e.g.:

 /container/obj1 (TYPE_FOO)
 /container/obj2 (TYPE_FOO)
 /obj2 (TYPE_FOO)

With the above tree, object_resolve_path_type("", TYPE_FOO, NULL) will
incorrectly return /obj2, because the search inside "/container" will
return NULL, and the match at "/obj2" won't be detected as ambiguous.

Fix that by always calling object_resolve_partial_path() with a non-NULL
ambiguous parameter.

Test case included.

Reported-by: Igor Mammedov <imammedo@redhat.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Eduardo Habkost (2):
  tests: Test case for object_resolve_path*()
  qom: Fix ambiguous path detection when ambiguous=NULL

 qom/object.c               | 17 ++++++++---------
 tests/check-qom-proplist.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 9 deletions(-)

-- 
2.9.4

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

end of thread, other threads:[~2017-07-13 12:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-07 21:30 [Qemu-devel] [PATCH 0/2] qom: Fix ambiguous path detection when ambiguous=NULL Eduardo Habkost
2017-07-07 21:30 ` [Qemu-devel] [PATCH 1/2] tests: Test case for object_resolve_path*() Eduardo Habkost
2017-07-10  8:10   ` Igor Mammedov
2017-07-10 14:45     ` Eduardo Habkost
2017-07-10 14:48       ` Igor Mammedov
2017-07-10 15:33       ` [Qemu-devel] [PATCH] fixup! qom: Fix ambiguous path detection when ambiguous=NULL Eduardo Habkost
2017-07-10 16:26         ` Igor Mammedov
2017-07-07 21:30 ` [Qemu-devel] [PATCH 2/2] " Eduardo Habkost
2017-07-10  8:18   ` Igor Mammedov
2017-07-10  6:42 ` [Qemu-devel] [PATCH 0/2] " Mark Cave-Ayland
2017-07-10 18:23 ` Eduardo Habkost
2017-07-13 12:09   ` Paolo Bonzini

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