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: Wed, 11 Jan 2017 17:16:46 +0000
User-agent: Mutt/1.7.1 (2016-10-04)

On Wed, Jan 11, 2017 at 05:12:02PM +0000, Stefan Hajnoczi wrote:
> On Tue, Jan 10, 2017 at 10:51:29AM -0600, Eric Blake wrote:
> > On 01/10/2017 10:37 AM, 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?
> > 
> > Yes - now that there are more than one trace.h files spread across
> > multiple directories, you need a prefix to ensure the correct one gets
> > included.  In this particular case, it also matches consistency in
> > including "io/channel-buffer.h" rather than just "channel-buffer.h".
> 
> "io/channel-buffer.h" is no more consistent or clear than
> "channel-buffer.h".
> 
> Does it mean include/io/channel-buffer.h or
> ./include/io/channel-buffer.h?  You don't know unless you know the
> compiler include paths and which directories have a channel-buffer.h
> file.
> 
> IMO a simple "foo.h" is clearest for ./foo.h.

I've been trying to get such relative includes to work most of today
and not having much luck. The problem is that while it works in 95%
of the time, there are some source files and header files which need
to include trace.h files not in their local directory and we can't
use relative includes for that, since the relative include gets
resolved wrt the source file doing the #include, but the trace.h
file is in $BUILD_DIR.

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]