Re: [PATCH 1/2] cleanup conf/device_conf.h reference from util/virnetdev.h

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

 



Hi All,

This patch needs some rework as the Makefile.am change would result in
build failures
on virhostdev.h and virclosecallbacks.h. It didnt fail for me earlier
as the autogen was run
prior to the changes.

I'll be sending a v2 with the fixes for build failures.

Thanks,
Shiva

On Wed, Mar 11, 2015 at 2:40 PM, Shivaprasad G Bhat
<shivaprasadbhat@xxxxxxxxx> wrote:
> Its wrong to reference the conf/* files from util/* files. Clean up the
> Makefile.am. Also, move the struct definitions to utils and include the util
> file in conf instead. There is a similar incorrect reference to
> domain_conf.h from virclosecallbacks.h which is to be addressed in a future
> patch.
>
> Signed-off-by: Shivaprasad G Bhat <sbhat@xxxxxxxxxxxxxxxxxx>
> ---
>  src/Makefile.am        |    3 +--
>  src/conf/device_conf.h |   21 +--------------------
>  src/util/virnetdev.h   |   21 ++++++++++++++++++++-
>  3 files changed, 22 insertions(+), 23 deletions(-)
>
> diff --git a/src/Makefile.am b/src/Makefile.am
> index d38432e..85d6b44 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -1014,8 +1014,7 @@ libvirt_util_la_SOURCES =                                 \
>  libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
>                 $(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
>                 $(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)  \
> -               $(SYSTEMD_DAEMON_CFLAGS) $(POLKIT_CFLAGS) \
> -               -I$(srcdir)/conf
> +               $(SYSTEMD_DAEMON_CFLAGS) $(POLKIT_CFLAGS)
>  libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
>                 $(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
>                 $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \
> diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h
> index 7256cdc..a650189 100644
> --- a/src/conf/device_conf.h
> +++ b/src/conf/device_conf.h
> @@ -31,19 +31,7 @@
>  # include "virutil.h"
>  # include "virthread.h"
>  # include "virbuffer.h"
> -
> -typedef enum {
> -    VIR_INTERFACE_STATE_UNKNOWN = 1,
> -    VIR_INTERFACE_STATE_NOT_PRESENT,
> -    VIR_INTERFACE_STATE_DOWN,
> -    VIR_INTERFACE_STATE_LOWER_LAYER_DOWN,
> -    VIR_INTERFACE_STATE_TESTING,
> -    VIR_INTERFACE_STATE_DORMANT,
> -    VIR_INTERFACE_STATE_UP,
> -    VIR_INTERFACE_STATE_LAST
> -} virInterfaceState;
> -
> -VIR_ENUM_DECL(virInterfaceState)
> +# include "virnetdev.h"
>
>  typedef struct _virDevicePCIAddress virDevicePCIAddress;
>  typedef virDevicePCIAddress *virDevicePCIAddressPtr;
> @@ -55,13 +43,6 @@ struct _virDevicePCIAddress {
>      int          multi;  /* virTristateSwitch */
>  };
>
> -typedef struct _virInterfaceLink virInterfaceLink;
> -typedef virInterfaceLink *virInterfaceLinkPtr;
> -struct _virInterfaceLink {
> -    virInterfaceState state; /* link state */
> -    unsigned int speed;      /* link speed in Mbits per second */
> -};
> -
>  int virDevicePCIAddressIsValid(virDevicePCIAddressPtr addr);
>
>  int virDevicePCIAddressParseXML(xmlNodePtr node,
> diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
> index de8b480..42cc1f8 100644
> --- a/src/util/virnetdev.h
> +++ b/src/util/virnetdev.h
> @@ -29,7 +29,6 @@
>  # include "virnetlink.h"
>  # include "virmacaddr.h"
>  # include "virpci.h"
> -# include "device_conf.h"
>
>  # ifdef HAVE_STRUCT_IFREQ
>  typedef struct ifreq virIfreq;
> @@ -73,6 +72,26 @@ struct _virNetDevRxFilter {
>      } vlan;
>  };
>
> +typedef enum {
> +    VIR_INTERFACE_STATE_UNKNOWN = 1,
> +    VIR_INTERFACE_STATE_NOT_PRESENT,
> +    VIR_INTERFACE_STATE_DOWN,
> +    VIR_INTERFACE_STATE_LOWER_LAYER_DOWN,
> +    VIR_INTERFACE_STATE_TESTING,
> +    VIR_INTERFACE_STATE_DORMANT,
> +    VIR_INTERFACE_STATE_UP,
> +    VIR_INTERFACE_STATE_LAST
> +} virInterfaceState;
> +
> +VIR_ENUM_DECL(virInterfaceState)
> +
> +typedef struct _virInterfaceLink virInterfaceLink;
> +typedef virInterfaceLink *virInterfaceLinkPtr;
> +struct _virInterfaceLink {
> +    virInterfaceState state; /* link state */
> +    unsigned int speed;      /* link speed in Mbits per second */
> +};
> +
>  int virNetDevSetupControl(const char *ifname,
>                            virIfreq *ifr)
>      ATTRIBUTE_RETURN_CHECK;
>
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

--
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]