Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Markus Armbruster
Daniel P. Berrangé writes: [...] > Honestly I'd probably prefer these methods to take an "Error **errp" > and propagate to the caller but that's alot more work. I'd rather return 0 on success, -errno on failure in these cases.

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Markus Armbruster
Peter Maydell writes: > On Thu, 13 Dec 2018 at 12:39, Daniel P. Berrangé wrote: >> The problem with this assertion is that there's many places which >> call qemu_set_nonblock, so you don't know which code to look at, >> as we don't know the caller. > > In an ideal world assert would print a

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Peter Maydell
On Thu, 13 Dec 2018 at 12:39, Daniel P. Berrangé wrote: > The problem with this assertion is that there's many places which > call qemu_set_nonblock, so you don't know which code to look at, > as we don't know the caller. In an ideal world assert would print a stack backtrace :-) thanks -- PMM

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Daniel P . Berrangé
On Thu, Dec 13, 2018 at 01:28:23PM +0100, Markus Armbruster wrote: > Peter Maydell writes: > > > On Thu, 13 Dec 2018 at 10:19, Daniel P. Berrangé > > wrote: > >> > >> On Wed, Dec 12, 2018 at 06:09:37PM -0800, Li Qiang wrote: > >> > Assert that the return value is not an error. This is like

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Markus Armbruster
Peter Maydell writes: > On Thu, 13 Dec 2018 at 10:19, Daniel P. Berrangé wrote: >> >> On Wed, Dec 12, 2018 at 06:09:37PM -0800, 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 >> >

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Peter Maydell
On Thu, 13 Dec 2018 at 10:19, Daniel P. Berrangé wrote: > > On Wed, Dec 12, 2018 at 06:09:37PM -0800, 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 > > --- > > util/oslib-posix.c | 8

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Li Qiang
Daniel P. Berrangé 于2018年12月13日周四 下午6:17写道: > On Thu, Dec 13, 2018 at 05:56:24PM +0800, Li Qiang wrote: > > Peter Maydell 于2018年12月13日周四 下午5:31写道: > > > > > On Thu, 13 Dec 2018 at 06:58, wrote: > > > > > > > > Patchew URL: > > > >

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Daniel P . Berrangé
On Wed, Dec 12, 2018 at 06:09:37PM -0800, 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 > --- > util/oslib-posix.c | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Daniel P . Berrangé
On Thu, Dec 13, 2018 at 05:56:24PM +0800, Li Qiang wrote: > Peter Maydell 于2018年12月13日周四 下午5:31写道: > > > On Thu, 13 Dec 2018 at 06:58, wrote: > > > > > > Patchew URL: > > https://patchew.org/QEMU/1544666977-4816-1-git-send-email-liq...@gmail.com/ > > > > > > > > > > > > Hi, > > > > > > This

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Li Qiang
Peter Maydell 于2018年12月13日周四 下午5:31写道: > On Thu, 13 Dec 2018 at 06:58, wrote: > > > > Patchew URL: > https://patchew.org/QEMU/1544666977-4816-1-git-send-email-liq...@gmail.com/ > > > > > > > > Hi, > > > > This series failed the docker-quick@centos7 build test. Please find the > testing commands

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Peter Maydell
On Thu, 13 Dec 2018 at 06:58, wrote: > > Patchew URL: > https://patchew.org/QEMU/1544666977-4816-1-git-send-email-liq...@gmail.com/ > > > > Hi, > > This series failed the docker-quick@centos7 build test. Please find the > testing commands and > their output below. If you have Docker installed,

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread no-reply
Patchew URL: https://patchew.org/QEMU/1544666977-4816-1-git-send-email-liq...@gmail.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT

[Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-12 Thread Li Qiang
Assert that the return value is not an error. This is like commit 7e6478e7d4f for qemu_set_cloexec. Signed-off-by: Li Qiang --- 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