[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 36/67] migration: add include directory headers
From: |
Daniel P . Berrangé |
Subject: |
Re: [Qemu-devel] [PATCH 36/67] migration: add include directory headers |
Date: |
Fri, 11 May 2018 18:26:11 +0100 |
User-agent: |
Mutt/1.9.3 (2018-01-21) |
On Fri, May 11, 2018 at 08:23:22PM +0300, Michael S. Tsirkin wrote:
> On Tue, May 08, 2018 at 02:25:07PM +0200, Juan Quintela wrote:
> > "Michael S. Tsirkin" <address@hidden> wrote:
> > > This way they are easier to find using standard rules.
> > >
> > > Signed-off-by: Michael S. Tsirkin <address@hidden>
> >
> > Nack.
> >
> > This are _internal_ files, that shouldn't be used anywere elese.
> >
> > Except .... that we need them to write tests. We only have two scopes
> > on qemu:
> > - internal: only for the subsystem we are at in
> > - pubilc: they can be used everywhere
> >
> > So, tests came in a strange class here, because they need internal
> > implementation, but they are not in the proper directory due to the way
> > we do tests.
> > I *think* that using complete paths is the only reasonable way of doing
> > this.
> >
> > Thanks, Juan.
>
> So how about tests include internal headers in a special way then?
>
> #include "../migration/foo.h" works but makes it clear
> something unusual is going on.
I might suggest that the idea of having a single directory for all tests
is the real problem here. We have structured our source so that each
logically separate area of code has its own subdirectory, and then we
dump all unit tests in one big directory !
So how about moving unit tests into their respective directories, so
then any internal headers they need are just local includes.
Leave the global tests/ directory for qtests and iotests, etc which
don't need to poke at internal source.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [Qemu-devel] [PATCH 28/67] 9pfs: add include directory headers, (continued)
- [Qemu-devel] [PATCH 28/67] 9pfs: add include directory headers, Michael S. Tsirkin, 2018/05/03
- [Qemu-devel] [PATCH 29/67] fsdev: add include directory headers, Michael S. Tsirkin, 2018/05/03
- [Qemu-devel] [PATCH 30/67] audio: add include directory header, Michael S. Tsirkin, 2018/05/03
- [Qemu-devel] [PATCH 35/67] hw/usb: add include directory header, Michael S. Tsirkin, 2018/05/03
- [Qemu-devel] [PATCH 33/67] hw/net: add include directory header, Michael S. Tsirkin, 2018/05/03
- [Qemu-devel] [PATCH 32/67] ui: add include directory header, Michael S. Tsirkin, 2018/05/03
- [Qemu-devel] [PATCH 36/67] migration: add include directory headers, Michael S. Tsirkin, 2018/05/03
- [Qemu-devel] [PATCH 37/67] tcg: add include directory headers, Michael S. Tsirkin, 2018/05/03
- [Qemu-devel] [PATCH 39/67] target: replace command line flags with preprocessor, Michael S. Tsirkin, 2018/05/03
- [Qemu-devel] [PATCH 38/67] helper: replace command line flags with preprocessor, Michael S. Tsirkin, 2018/05/03
- [Qemu-devel] [PATCH 34/67] hw/ppc: add include directory headers, Michael S. Tsirkin, 2018/05/03