qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file
Date: Tue, 10 Jan 2017 16:51:05 +0000
User-agent: Mutt/1.7.1 (2016-10-04)

On Tue, Jan 10, 2017 at 04:37:13PM +0000, Stefan Hajnoczi wrote:
> On Fri, Jan 06, 2017 at 03:54:58PM +0000, Daniel P. Berrange wrote:
> > diff --git a/io/channel-buffer.c b/io/channel-buffer.c
> > index 43d7959..b4e50d6 100644
> > --- a/io/channel-buffer.c
> > +++ b/io/channel-buffer.c
> > @@ -22,7 +22,7 @@
> >  #include "io/channel-buffer.h"
> >  #include "io/channel-watch.h"
> >  #include "qemu/sockets.h"
> > -#include "trace.h"
> > +#include "io/trace.h"
> 
> Is this change necessary?
> 
> I think the per-subdir trace.h file should be generated in
> $BUILD_DIR/<sub-dir>/trace.h and gcc -I. can locate that file.

It doesn't work with builddir != srcdir builds, because -I. is resolved
to the srcdir, but the trace.h is in builddir. The -I$BUILDDIR<sub-dir>
is also added to the compiler search path, but it is after pretty much
all other search paths. The end result is that if you simply use
"trace.h" instad of "io/trace.h" you'll end up finding the trace.h
from the top level source directory, instead of from your subdir.

I think the include path should probably be changed such that the
-IBUILDDIR/<subdir> is immediately after -I., and I tried to make
such a change, but failed to come up with a simple patch that worked.

In the end I thought it would be clearer to be explicit about the
subdir we're pulling trace.h from anyway, since it is fairly common
practice  in QEMU to have the <subdir> in the #include filename.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]