[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 8/9] chardev/char.c: Check for duplicate id before creatin
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v6 8/9] chardev/char.c: Check for duplicate id before creating chardev |
Date: |
Fri, 31 Jul 2020 10:37:34 +0100 |
User-agent: |
Mutt/1.14.5 (2020-06-23) |
On Fri, Jul 31, 2020 at 11:27:04AM +0200, Lukas Straub wrote:
> yank_register_instance (called when creating the new chardev object)
> aborts if the instance already exists. So check for duplicate id before
> creating the new chardev to prevent this.
I feel the right answer here is for yank_register_instance to not
use abort().
Instead have it take a 'Error **errp' and report the error normally.
The caller can then propagate the errors in the same way it does
for the duplicate ID errors. If a particular caller can't handle
errors gracefully, then it can pass "&error_abort" to the
yank_register_instance() to get the same abort semantics as now.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [PATCH v6 0/9] Introduce 'yank' oob qmp command to recover from hanging qemu, Lukas Straub, 2020/07/31
- [PATCH v6 1/9] Introduce yank feature, Lukas Straub, 2020/07/31
- [PATCH v6 2/9] block/nbd.c: Add yank feature, Lukas Straub, 2020/07/31
- [PATCH v6 3/9] chardev/char-socket.c: Add yank feature, Lukas Straub, 2020/07/31
- [PATCH v6 4/9] migration: Add yank feature, Lukas Straub, 2020/07/31
- [PATCH v6 5/9] io/channel-tls.c: make qio_channel_tls_shutdown thread-safe, Lukas Straub, 2020/07/31
- [PATCH v6 6/9] io: Document thread-safety of qio_channel_shutdown, Lukas Straub, 2020/07/31
- [PATCH v6 7/9] MAINTAINERS: Add myself as maintainer for yank feature, Lukas Straub, 2020/07/31
- [PATCH v6 8/9] chardev/char.c: Check for duplicate id before creating chardev, Lukas Straub, 2020/07/31
- Re: [PATCH v6 8/9] chardev/char.c: Check for duplicate id before creating chardev,
Daniel P . Berrangé <=
- [PATCH v6 9/9] tests/test-char.c: Wait for the chardev to connect in char_socket_client_dupid_test, Lukas Straub, 2020/07/31