Re: [Qemu-devel] [PATCH] io: Fix QIOChannelFile when creating and opening read-write

2017-11-01 Thread Ross Lagerwall
On 11/01/2017 10:04 AM, Daniel P. Berrange wrote: On Tue, Oct 31, 2017 at 04:09:02PM +, Ross Lagerwall wrote: The code wrongly passes the mode to open() only if O_WRONLY is set. Instead, the mode should be passed when O_CREAT is set (or O_TMPFILE on Linux). Fix this by always passing the mod

Re: [Qemu-devel] [PATCH] io: Fix QIOChannelFile when creating and opening read-write

2017-11-01 Thread Daniel P. Berrange
On Tue, Oct 31, 2017 at 04:09:02PM +, Ross Lagerwall wrote: > The code wrongly passes the mode to open() only if O_WRONLY is set. > Instead, the mode should be passed when O_CREAT is set (or O_TMPFILE on > Linux). Fix this by always passing the mode since open() will correctly > ignore the mode

Re: [Qemu-devel] [PATCH] io: Fix QIOChannelFile when creating and opening read-write

2017-10-31 Thread Marc-André Lureau
Hi (adding the maintainer in cc, scripts/get_maintainer.pl -f io/channel-file.c) On Tue, Oct 31, 2017 at 5:09 PM, Ross Lagerwall wrote: > The code wrongly passes the mode to open() only if O_WRONLY is set. > Instead, the mode should be passed when O_CREAT is set (or O_TMPFILE on > Linux). Fix t

[Qemu-devel] [PATCH] io: Fix QIOChannelFile when creating and opening read-write

2017-10-31 Thread Ross Lagerwall
The code wrongly passes the mode to open() only if O_WRONLY is set. Instead, the mode should be passed when O_CREAT is set (or O_TMPFILE on Linux). Fix this by always passing the mode since open() will correctly ignore the mode if it is not needed. Add a testcase which exercises this bug. While at