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

2018-01-18 Thread Daniel P. Berrange
On Wed, Nov 01, 2017 at 02:25:24PM +, 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

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

2017-11-01 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 and also c