Skip to content

Avoid abort on QMP attempt to add an object with duplicate id

Eric Auger qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 2 repliesIn review
  2. v43 patches 4 repliesSuperseded
  3. v32 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v22 patches8 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3qom: Introduce object_property_try_add_child()include/qom/object.h qom/object.c qom/object_interfaces.c+45 -92 replies
2/3tests/qmp-cmd-test: Add qmp/object-add-duplicate-idtests/qtest/qmp-cmd-test.c+19 -00 replies
3/3tests/qmp-cmd-test: Add qmp/object-add-failure-modestests/qtest/qmp-cmd-test.c+97 -170 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchMarkus ArmbrusterThomas HuthGreg Kurz
1/3R-b R-b T-b
2/3R-b A-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH v5 0/3] Avoid abort on QMP attempt to add an object with duplicate id

Attempting to add an object through QMP with an id that is already used leads to a qemu abort. This is a regression since d2623129a7de ("qom: Drop parameter @errp of object_property_add() & friends").

The first patch fixes the issue and the second patch adds a test to check the error is gracefully returned to the QMP client.

The last patch can be considered independently. It merges all the object-add tests into a single test function and cover new failure cases.

Best Regards

Eric

This series can be found at:
https://github.com/eauger/qemu/tree/qom-graceful-v5

History:

- v4 -> v5:
- Use 1MB instead of 4GB as size in the hope it removes the patchew error

- v3 -> v4:
- addressed style comment from Markus
- added patch 3

- v2 -> v3:
- don't take the object reference on failure in object_property_try_add_child
- add g_assert_nonnull(resp) in 2/2 while keeping Thomas A-b

- v1 -> v2:
- use the try terminology.
- turn object_property_try_add() into a non-static function
- add the test

Eric Auger (3):
qom: Introduce object_property_try_add_child() tests/qmp-cmd-test: Add qmp/object-add-duplicate-id tests/qmp-cmd-test: Add qmp/object-add-failure-modes

 include/qom/object.h       |  26 ++++++++-
 qom/object.c               |  21 +++++--
 qom/object_interfaces.c    |   7 ++-
 tests/qtest/qmp-cmd-test.c | 109 +++++++++++++++++++++++++++++++++++--
 4 files changed, 149 insertions(+), 14 deletions(-)
Signature · 1 line
2.20.1