[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 0/4] monitor: do not rely on O_NONBLOCK for p
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 0/4] monitor: do not rely on O_NONBLOCK for passed file descriptors |
Date: |
Wed, 27 Mar 2013 05:48:19 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
On 03/27/2013 03:10 AM, Stefan Hajnoczi wrote:
> There are several places where QEMU accidentally relies on the O_NONBLOCK
> state
> of passed file descriptors. Exposing O_NONBLOCK state makes it part of the
> QMP
> API whenever getfd or fdset_add_fd are used!
>
> Whether or not QEMU will use O_NONBLOCK is an implementation detail and should
> be hidden from QMP clients.
>
> This patch series addresses this in 3 steps:
>
> 1. Fix callers of monitor_handle_fd_param(), monitor_fdset_get_fd(), and
> monitor_get_fd() that depend on O_NONBLOCK being set. Luckily there are
> only two instances and they are fixed in Patches 1 & 2.
Description is now off after rebase, but the cover letter isn't
committed, so no big deal.
>
> 2. Rename socket_set_nonblock() to qemu_set_nonblock() just like
> qemu_set_cloexec(). This makes code cleaner when working with arbitrary
> file descriptors that may not be sockets. See Patch 3.
>
> 3. Clear O_NONBLOCK when a chardev receives file descriptors. From now on
> QEMU
> can assume that passed file descriptors are in blocking mode. Simply use
> qemu_set_nonblock(fd) if you want to enable O_NONBLOCK. See Patch 4.
Series: Reviewed-by: Eric Blake <address@hidden>
> v2:
> * Rename socket_set_nonblock() in Patch 1 to avoid code churn [eblake]
> * Avoid qemu_set_block(-1) calls that clobber errno [quintela]
>
> Stefan Hajnoczi (4):
> oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()
> net: ensure "socket" backend uses non-blocking fds
> qemu-socket: set passed fd non-blocking in socket_connect()
> chardev: clear O_NONBLOCK on SCM_RIGHTS file descriptors
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v2 0/4] monitor: do not rely on O_NONBLOCK for passed file descriptors, Stefan Hajnoczi, 2013/03/27
- [Qemu-devel] [PATCH v2 1/4] oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock(), Stefan Hajnoczi, 2013/03/27
- [Qemu-devel] [PATCH v2 4/4] chardev: clear O_NONBLOCK on SCM_RIGHTS file descriptors, Stefan Hajnoczi, 2013/03/27
- [Qemu-devel] [PATCH v2 3/4] qemu-socket: set passed fd non-blocking in socket_connect(), Stefan Hajnoczi, 2013/03/27
- [Qemu-devel] [PATCH v2 2/4] net: ensure "socket" backend uses non-blocking fds, Stefan Hajnoczi, 2013/03/27
- Re: [Qemu-devel] [PATCH v2 0/4] monitor: do not rely on O_NONBLOCK for passed file descriptors,
Eric Blake <=
- Re: [Qemu-devel] [PATCH v2 0/4] monitor: do not rely on O_NONBLOCK for passed file descriptors, Luiz Capitulino, 2013/03/27