[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 4/4] monitor: add lock to protect mon_fdsets
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH v7 4/4] monitor: add lock to protect mon_fdsets |
Date: |
Fri, 25 May 2018 11:30:22 +0800 |
User-agent: |
Mutt/1.9.5 (2018-04-13) |
On Thu, May 24, 2018 at 10:28:37AM +0100, Stefan Hajnoczi wrote:
> On Thu, May 24, 2018 at 12:39:52PM +0800, Peter Xu wrote:
> > int monitor_fdset_get_fd(int64_t fdset_id, int flags)
> > {
> > -#ifndef _WIN32
> > +#ifdef _WIN32
> > + return -ENOENT;
>
> stubs/fdset.c:monitor_fdset_get_fd() should return -ENOENT instead of -1
> now.
Yes that's intended. That's actually a suggestion from Markus since
changing the return code will simplify the code. I mentioned it in
the commit message too:
"""
The monitor_fdset_get_fd() handling is a bit tricky: now we need to call
qemu_mutex_unlock() which might pollute errno, so we need to make sure
the correct errno be passed up to the callers. To make things simpler,
we let monitor_fdset_get_fd() return the -errno directly when error
happens, then in qemu_open() we translate it back into errno.
"""
Thanks,
--
Peter Xu
- [Qemu-devel] [PATCH v7 3/4] monitor: more comments on lock-free fleids/funcs, (continued)
[Qemu-devel] [PATCH v7 4/4] monitor: add lock to protect mon_fdsets, Peter Xu, 2018/05/24
Re: [Qemu-devel] [PATCH v7 0/4] monitor: let Monitor be thread safe, no-reply, 2018/05/24