Skip to content

qom: Fix ambiguous path detection when ambiguous=NULL

Eduardo Habkost qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tests: Test case for object_resolve_path*()tests/check-qom-proplist.c+41 -05 replies
2/2qom: Fix ambiguous path detection when ambiguous=NULLqom/object.c tests/check-qom-proplist.c+11 -91 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMark Cave-AylandIgor Mammedov
SeriesT-b
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/2] qom: Fix ambiguous path detection when ambiguous=NULL

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.

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(-)
Signature · 1 line
2.9.4