[libvirt PATCH v2 26/56] src: conditionalize use of O_DIRECT

Pavel Hrdina phrdina at redhat.com
Wed Jan 29 13:25:37 UTC 2020


On Wed, Jan 29, 2020 at 12:23:18PM +0000, Daniel P. Berrangé wrote:
> On Tue, Jan 28, 2020 at 05:55:27PM +0100, Pavel Hrdina wrote:
> > On Tue, Jan 28, 2020 at 01:11:07PM +0000, Daniel P. Berrangé wrote:
> > > The O_DIRECT flag is not available on all platforms, so we
> > > must introduce a compat define the same way gnulib does.
> > > 
> > > Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> > > ---
> > >  src/util/iohelper.c | 4 ++++
> > >  src/util/virfile.c  | 4 ++++
> > >  2 files changed, 8 insertions(+)
> > 
> > I would rather have all the O_* compat defines at one place then
> > scattered through our code.
> > 
> > We have the O_CLOEXEC in src/internal.h, O_DIRECT in these two files
> > and following patch adds guard around O_BINARY in
> > src/util/virfdstream.c.
> > 
> > I'll leave it up to you if decide to group all of them or leave it as
> > it is.
> 
> To do that grouping more generally, we would need to have fcntl.h
> pulled in by  internal.h. That's certainly possible, but we'll
> need to cleanup the includes elsewhere, so not something I'll
> just squash into this series without more review.

Agreed, we can leave it as it is, it will not make the situation worse.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200129/8f3d212c/attachment-0001.sig>


More information about the libvir-list mailing list