On Wed, 19 Mar 2025 at 22:57, Cédric Le Goater <c...@redhat.com> wrote: > you are right. I am not satisfied with the header file names. > > It has been problematic and I would prefer all header files to have > a "vfio-" prefix. Sadly, the gcc command line is making it difficult, > or I misunderstood some parts. > > When using : > > #include "hw/vfio/foo.h" > > "hw/vfio/foo.h" could refer to either : > > ./hw/vfio/foo.h > > or > > ./include/hw/vfio/foo.h > > I find it confusing that we can include files from anywhere in > the directory tree :/
* IIUC, gcc(1) picks the _first_ matching header (name) it finds across listed (with -I) include directories. When the header name is quoted ("foo.h"), the search begins from the directory where the source file resides. In the above example, if the command line was: .. -I ./hw/vfio/ -I ./include/hw/vfio/ then foo.h from './hw/vfio/' gets used. If the command line was: -I ./include/hw/vfio/ -I ./hw/vfio/ then foo.h from './include/hw/vfio/' gets used. > May be call it "vfio-migration-internal.h" ? > > or use always : #include "hw/vfio/migration.h" (and remove -I .) ? > > Or rename the "include/hw/vfio/vfio-migration.h" file introduced > in patch 3 for external migration services to some other name. * It helps to have a unique header (file) name across the project. I don't see any vfio-migration.h in the current git master. Thank you. --- - Prasad