Re: [PATCH 03/10] cleanup: Don't include libvirt/libvirt.h

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

 



On 04/16/2013 07:41 AM, Osier Yang wrote:
> Which is already included by "internal.h", later patch will add
> syntax-check to avoid it.
> ---

> +++ b/src/nodeinfo.h
> @@ -24,7 +24,6 @@
>  #ifndef __VIR_NODEINFO_H__
>  # define __VIR_NODEINFO_H__
>  
> -# include "libvirt/libvirt.h"
>  # include "capabilities.h"

I took a second look at this after 4/10; thankfully, here you are still
self-contained, via indirection, since capabilities.h includes internal.h.

>  
>  int nodeGetInfo(virConnectPtr conn, virNodeInfoPtr nodeinfo);
> diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
> index 3057345..d6d9b0c 100644
> --- a/src/phyp/phyp_driver.c
> +++ b/src/phyp/phyp_driver.c
> @@ -49,7 +49,6 @@
>  #include "viralloc.h"
>  #include "virlog.h"
>  #include "driver.h"
> -#include "libvirt/libvirt.h"

This is clean (internal.h is several lines earlier)

>  #include "virerror.h"
>  #include "viruuid.h"
>  #include "domain_conf.h"
> diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
> index b957b8e..d384225 100644
> --- a/src/remote/remote_protocol.x
> +++ b/src/remote/remote_protocol.x
> @@ -36,7 +36,6 @@
>   * 'REMOTE_'.  This makes names quite long.
>   */
>  
> -%#include <libvirt/libvirt.h>
>  %#include "internal.h"

This is clean.

>  %#include <arpa/inet.h>
>  
> diff --git a/src/util/virkeycode.h b/src/util/virkeycode.h
> index a2e1391..6947cfe 100644
> --- a/src/util/virkeycode.h
> +++ b/src/util/virkeycode.h
> @@ -23,7 +23,6 @@
>  # define __VIR_UTIL_VIRTKEYCODE_H__
>  
>  # include "virutil.h"
> -# include "libvirt/libvirt.h"

This relies on indirect inclusion via virutil.h.  We've used indirect
inclusion before (in fact, internal.h lets us indirectly include common
headers like <errno.h> instead of repeating it everywhere), so that's
fine (I know some other projects like all .h files to be self-contained
without indirect inclusion, but that's a style choice; I'm not proposing
that libvirt adopt it).

So my ACK still stands.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]