All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: Li Qiang <liq3ea@163.com>,
	lvivier@redhat.com, peter.maydell@linaro.org,
	jasowang@redhat.com, liq3ea@gmail.com, qemu-devel@nongnu.org,
	marcandre.lureau@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 3/3] util: check the return value of fcntl in qemu_set_{block, nonblock}
Date: Mon, 14 Jan 2019 18:24:36 -0500	[thread overview]
Message-ID: <20190114182425-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <ed598a9a-ea9d-044e-1677-679a658676b0@redhat.com>

On Wed, Jan 02, 2019 at 03:07:24PM +0100, Thomas Huth wrote:
> On 2018-12-15 13:03, Li Qiang wrote:
> > Assert that the return value is not an error. This is like commit
> > 7e6478e7d4f for qemu_set_cloexec.
> > 
> > Signed-off-by: Li Qiang <liq3ea@163.com>
> > ---
> >  util/oslib-posix.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> > index c1bee2a581..4ce1ba9ca4 100644
> > --- a/util/oslib-posix.c
> > +++ b/util/oslib-posix.c
> > @@ -233,14 +233,18 @@ void qemu_set_block(int fd)
> >  {
> >      int f;
> >      f = fcntl(fd, F_GETFL);
> > -    fcntl(fd, F_SETFL, f & ~O_NONBLOCK);
> > +    assert(f != -1);
> > +    f = fcntl(fd, F_SETFL, f & ~O_NONBLOCK);
> > +    assert(f != -1);
> >  }
> >  
> >  void qemu_set_nonblock(int fd)
> >  {
> >      int f;
> >      f = fcntl(fd, F_GETFL);
> > -    fcntl(fd, F_SETFL, f | O_NONBLOCK);
> > +    assert(f != -1);
> > +    f = fcntl(fd, F_SETFL, f | O_NONBLOCK);
> > +    assert(f != -1);
> >  }
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> Michael, could you take this patch series through your vhost tree? Or
> shall I pick them up for the qtests tree? In the latter case, please
> provide an ACK for the second patch.

Did not see it merged so I merged it.

  parent reply	other threads:[~2019-01-14 23:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-15 12:03 [Qemu-devel] [PATCH v2 0/3] vhost-user-test fix Li Qiang
2018-12-15 12:03 ` [Qemu-devel] [PATCH v2 1/3] tests: vhost-user-test: initialize 'fd' in chr_read Li Qiang
2019-01-02 13:50   ` Thomas Huth
2019-01-02 14:55     ` Michael S. Tsirkin
2019-01-03  4:23     ` Li Qiang
2018-12-15 12:03 ` [Qemu-devel] [PATCH v2 2/3] vhost-user: fix ioeventfd_enabled Li Qiang
2019-01-14 23:22   ` Michael S. Tsirkin
2018-12-15 12:03 ` [Qemu-devel] [PATCH v2 3/3] util: check the return value of fcntl in qemu_set_{block, nonblock} Li Qiang
2019-01-02 14:07   ` Thomas Huth
2019-01-02 14:55     ` Michael S. Tsirkin
2019-01-14 23:24     ` Michael S. Tsirkin [this message]
2018-12-24  1:08 ` [Qemu-devel] [PATCH v2 0/3] vhost-user-test fix Li Qiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190114182425-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=liq3ea@163.com \
    --cc=liq3ea@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.