From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bN94k-0004Qc-7S for qemu-devel@nongnu.org; Tue, 12 Jul 2016 21:35:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bN94F-00070e-LD for qemu-devel@nongnu.org; Tue, 12 Jul 2016 21:34:58 -0400 Date: Wed, 13 Jul 2016 09:33:52 +0800 From: Fam Zheng Message-ID: <20160713013352.GA16038@ad.usersys.redhat.com> References: <1468323255-20454-1-git-send-email-caoj.fnst@cn.fujitsu.com> <57850FB6.3000403@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57850FB6.3000403@redhat.com> Subject: Re: [Qemu-devel] [PATCH] aio-posix: fill error message that is missed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Cao jin , qemu-devel@nongnu.org, qemu-block@nongnu.org, stefanha@redhat.com On Tue, 07/12 09:41, Eric Blake wrote: > On 07/12/2016 05:34 AM, Cao jin wrote: > > The current judegement of caller is meaningless, make it useful. > > Is this something you can trigger? If so, what command line? If not, > how did you find it? > > Spelled 'judgment', not 'judegement'; but rather than just fixing the > typo, it might read better as: > > The lone caller of aio_context_setup() only checks whether an error was > set, but aio_context_setup() is not setting an error. > > > > > Signed-off-by: Cao jin > > --- > > aio-posix.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/aio-posix.c b/aio-posix.c > > index 6006122..8b0deb7 100644 > > --- a/aio-posix.c > > +++ b/aio-posix.c > > @@ -18,6 +18,7 @@ > > #include "block/block.h" > > #include "qemu/queue.h" > > #include "qemu/sockets.h" > > +#include "qapi/error.h" > > #ifdef CONFIG_EPOLL_CREATE1 > > #include > > #endif > > @@ -491,6 +492,7 @@ void aio_context_setup(AioContext *ctx, Error **errp) > > assert(!ctx->epollfd); > > ctx->epollfd = epoll_create1(EPOLL_CLOEXEC); > > if (ctx->epollfd == -1) { > > + error_setg_errno(errp, errno, "Failed to create epoll instance"); > > ctx->epoll_available = false; > > } else { > > ctx->epoll_available = true; > > However, I'm not even sure your patch is right. The mere fact that we > have ctx->epoll_available makes it sound like we WANT to be able to > gracefully fall back when epoll is not available, rather than raising an > error message. Yes. This patch doesn't make sense to me. What can be done is 1) remove errp parameter as it's not used; 2) fprintf(stderr, ...) or error_report(....) here if epoll_create1 failed. Fam