[PATCH v3 0/2] Avoid abort on QMP attempt to add an object with duplicate id

Eric Auger posted 2 patches 3 years, 10 months ago
Test FreeBSD passed
Test docker-quick@centos7 failed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200624194809.26600-1-eric.auger@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Markus Armbruster <armbru@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>
There is a newer version of this series
include/qom/object.h       | 24 ++++++++++++++++++++++--
qom/object.c               | 21 ++++++++++++++++-----
qom/object_interfaces.c    |  7 +++++--
tests/qtest/qmp-cmd-test.c | 19 +++++++++++++++++++
4 files changed, 62 insertions(+), 9 deletions(-)
[PATCH v3 0/2] Avoid abort on QMP attempt to add an object with duplicate id
Posted by Eric Auger 3 years, 10 months ago
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.

Best Regards

Eric

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

History:
- 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 (2):
  qom: Introduce object_property_try_add_child()
  tests/qmp-cmd-test: Add qmp/object-add-duplicate-id

 include/qom/object.h       | 24 ++++++++++++++++++++++--
 qom/object.c               | 21 ++++++++++++++++-----
 qom/object_interfaces.c    |  7 +++++--
 tests/qtest/qmp-cmd-test.c | 19 +++++++++++++++++++
 4 files changed, 62 insertions(+), 9 deletions(-)

-- 
2.20.1


Re: [PATCH v3 0/2] Avoid abort on QMP attempt to add an object with duplicate id
Posted by no-reply@patchew.org 3 years, 10 months ago
Patchew URL: https://patchew.org/QEMU/20200624194809.26600-1-eric.auger@redhat.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  TEST    check-qtest-aarch64: tests/qtest/qmp-cmd-test
  TEST    iotest-qcow2: 176
**
ERROR:/tmp/qemu-test/src/tests/qtest/qmp-cmd-test.c:225:test_object_add_with_duplicate_id: assertion failed: (qdict_haskey(resp, "return"))
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/qmp-cmd-test.c:225:test_object_add_with_duplicate_id: assertion failed: (qdict_haskey(resp, "return"))
make: *** [check-qtest-aarch64] Error 1
make: *** Waiting for unfinished jobs....
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
---
  TEST    check-qtest-x86_64: tests/qtest/qmp-test
  TEST    check-qtest-x86_64: tests/qtest/qmp-cmd-test
**
ERROR:/tmp/qemu-test/src/tests/qtest/qmp-cmd-test.c:225:test_object_add_with_duplicate_id: assertion failed: (qdict_haskey(resp, "return"))
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/qmp-cmd-test.c:225:test_object_add_with_duplicate_id: assertion failed: (qdict_haskey(resp, "return"))
make: *** [check-qtest-x86_64] Error 1
  TEST    iotest-qcow2: 220
  TEST    iotest-qcow2: 226
  TEST    iotest-qcow2: 229
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=60ce26ab60e3443d984623b7775c3cae', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-6xdet1tc/src/docker-src.2020-06-24-16.11.32.12570:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=60ce26ab60e3443d984623b7775c3cae
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-6xdet1tc/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    12m28.815s
user    0m8.490s


The full log is available at
http://patchew.org/logs/20200624194809.26600-1-eric.auger@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com