[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 1/8] monitor: simplify functions for getting a dup'd fdset
From: |
Richard Henderson |
Subject: |
Re: [PATCH v6 1/8] monitor: simplify functions for getting a dup'd fdset entry |
Date: |
Thu, 3 Sep 2020 09:51:00 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 9/3/20 8:22 AM, Daniel P. Berrangé wrote:
> Currently code has to call monitor_fdset_get_fd, then dup
> the return fd, and then add the duplicate FD back into the
> fdset. This dance is overly verbose for the caller and
> introduces extra failure modes which can be avoided by
> folding all the logic into monitor_fdset_dup_fd_add and
> removing monitor_fdset_get_fd entirely.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> include/monitor/monitor.h | 3 +-
> include/qemu/osdep.h | 1 +
> monitor/misc.c | 58 +++++++++++++++++----------------------
> stubs/fdset.c | 8 ++----
> util/osdep.c | 19 ++-----------
> 5 files changed, 32 insertions(+), 57 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
- [PATCH v6 0/8] block: improve error reporting for unsupported O_DIRECT, Daniel P . Berrangé, 2020/09/03
- [PATCH v6 1/8] monitor: simplify functions for getting a dup'd fdset entry, Daniel P . Berrangé, 2020/09/03
- [PATCH v6 2/8] util: split off a helper for dealing with O_CLOEXEC flag, Daniel P . Berrangé, 2020/09/03
- [PATCH v6 4/8] util: refactor qemu_open_old to split off variadic args handling, Daniel P . Berrangé, 2020/09/03
- [PATCH v6 6/8] util: introduce qemu_open and qemu_create with error reporting, Daniel P . Berrangé, 2020/09/03
- [PATCH v6 5/8] util: add Error object for qemu_open_internal error reporting, Daniel P . Berrangé, 2020/09/03
- [PATCH v6 7/8] util: give a specific error message when O_DIRECT doesn't work, Daniel P . Berrangé, 2020/09/03