Re: [PATCH] chardev: don't abort on attempt to add duplicated chardev

2020-07-08 Thread Markus Armbruster
Marc-André Lureau  writes:

> This is a regression from commit
> d2623129a7dec1d3041ad1221dda1ca49c667532 ("qom: Drop parameter @errp of
> object_property_add() & friends").
>
> (qemu) chardev-add id=null,backend=null
> (qemu) chardev-add id=null,backend=null
> Unexpected error in object_property_try_add() at 
> /home/elmarco/src/qemu/qom/object.c:1166:
> attempt to add duplicate property 'null' to object (type 'container')
>
> That case is currently not covered in the test suite, but will be with
> the queued patch "char: fix use-after-free with dup chardev &
> reconnect".
>

Please add

  Fixes: d2623129a7dec1d3041ad1221dda1ca49c667532

Bonus: you can then shorten the hash above for readability.

> Signed-off-by: Marc-André Lureau 
> ---
>  chardev/char.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/chardev/char.c b/chardev/char.c
> index e3051295ac3..876e41bb592 100644
> --- a/chardev/char.c
> +++ b/chardev/char.c
> @@ -998,7 +998,10 @@ static Chardev *chardev_new(const char *id, const char 
> *typename,
>  }
>  
>  if (id) {
> -object_property_add_child(get_chardevs_root(), id, obj);
> +object_property_try_add_child(get_chardevs_root(), id, obj, 
> _err);

Suggest to break this line before _err.

> +if (local_err) {
> +goto end;
> +}
>  object_unref(obj);
>  }

Sorry for breaking this.

Reviewed-by: Markus Armbruster 




Re: [PATCH] chardev: don't abort on attempt to add duplicated chardev

2020-07-06 Thread no-reply
Patchew URL: 
https://patchew.org/QEMU/20200706182156.334207-1-marcandre.lur...@redhat.com/



Hi,

This series failed the docker-mingw@fedora 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
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC  hw/acpi/ipmi.o
  CC  hw/acpi/acpi-stub.o
/tmp/qemu-test/src/chardev/char.c: In function 'chardev_new':
/tmp/qemu-test/src/chardev/char.c:1001:9: error: implicit declaration of 
function 'object_property_try_add_child'; did you mean 
'object_property_add_child'? [-Werror=implicit-function-declaration]
 1001 | object_property_try_add_child(get_chardevs_root(), id, obj, 
_err);
  | ^
  | object_property_add_child
/tmp/qemu-test/src/chardev/char.c:1001:9: error: nested extern declaration of 
'object_property_try_add_child' [-Werror=nested-externs]
cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:69: chardev/char.o] Error 1
make: *** Waiting for unfinished jobs
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 669, in 
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', 
'--label', 'com.qemu.instance.uuid=5a5c146077564649a10f33f7cd376a96', '-u', 
'1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', 
'-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 
'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', 
'/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', 
'/var/tmp/patchew-tester-tmp-w3u96ywu/src/docker-src.2020-07-06-14.28.31.32389:/var/tmp/qemu:z,ro',
 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit 
status 2.
filter=--filter=label=com.qemu.instance.uuid=5a5c146077564649a10f33f7cd376a96
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-w3u96ywu/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real3m3.035s
user0m8.386s


The full log is available at
http://patchew.org/logs/20200706182156.334207-1-marcandre.lur...@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-de...@redhat.com

Re: [PATCH] chardev: don't abort on attempt to add duplicated chardev

2020-07-06 Thread no-reply
Patchew URL: 
https://patchew.org/QEMU/20200706182156.334207-1-marcandre.lur...@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 ===

  CC  tpm.o
  CC  device_tree.o
/tmp/qemu-test/src/chardev/char.c: In function 'chardev_new':
/tmp/qemu-test/src/chardev/char.c:1001:9: error: implicit declaration of 
function 'object_property_try_add_child' [-Werror=implicit-function-declaration]
 object_property_try_add_child(get_chardevs_root(), id, obj, 
_err);
 ^
/tmp/qemu-test/src/chardev/char.c:1001:9: error: nested extern declaration of 
'object_property_try_add_child' [-Werror=nested-externs]
cc1: all warnings being treated as errors
make: *** [chardev/char.o] Error 1
make: *** Waiting for unfinished jobs
  CC  cpus-common.o
  CC  accel/accel.o
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', 
'--label', 'com.qemu.instance.uuid=9c2bd824c6b0443b9d75ae3ed63f68ae', '-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-iez5j30m/src/docker-src.2020-07-06-14.28.46.1356:/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=9c2bd824c6b0443b9d75ae3ed63f68ae
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-iez5j30m/src'
make: *** [docker-run-test-quick@centos7] Error 2

real2m14.145s
user0m8.128s


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

[PATCH] chardev: don't abort on attempt to add duplicated chardev

2020-07-06 Thread Marc-André Lureau
This is a regression from commit
d2623129a7dec1d3041ad1221dda1ca49c667532 ("qom: Drop parameter @errp of
object_property_add() & friends").

(qemu) chardev-add id=null,backend=null
(qemu) chardev-add id=null,backend=null
Unexpected error in object_property_try_add() at 
/home/elmarco/src/qemu/qom/object.c:1166:
attempt to add duplicate property 'null' to object (type 'container')

That case is currently not covered in the test suite, but will be with
the queued patch "char: fix use-after-free with dup chardev &
reconnect".

Signed-off-by: Marc-André Lureau 
---
 chardev/char.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/chardev/char.c b/chardev/char.c
index e3051295ac3..876e41bb592 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -998,7 +998,10 @@ static Chardev *chardev_new(const char *id, const char 
*typename,
 }
 
 if (id) {
-object_property_add_child(get_chardevs_root(), id, obj);
+object_property_try_add_child(get_chardevs_root(), id, obj, 
_err);
+if (local_err) {
+goto end;
+}
 object_unref(obj);
 }
 
-- 
2.27.0.90.geebb51ba8c