Re: [PATCH 4/7] Ensure GET_VLAN_VID_CMD is always defined

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

 



On Thu, Mar 07, 2013 at 06:31:30PM +0100, Peter Krempa wrote:
> On 03/07/13 17:41, Daniel P. Berrange wrote:
> > From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> > 
> > The RHEL4 vintage header files do not define GET_VLAN_VID_CMD.
> > Conditionally define it in our source, since the kernel can
> > raise a runtime error if it isn't supported
> > 
> > Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> > ---
> >   src/util/virnetdev.c | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
> > index 296871c..4cdbb0c 100644
> > --- a/src/util/virnetdev.c
> > +++ b/src/util/virnetdev.c
> > @@ -673,6 +673,9 @@ int virNetDevGetIndex(const char *ifname ATTRIBUTE_UNUSED,
> >   
> >   
> >   #if defined(SIOCGIFVLAN) && defined(HAVE_STRUCT_IFREQ)
> > +# ifndef GET_VLAN_VID_CMD
> > +#  define GET_VLAN_VID_CMD 9
> > +# endif
> >   int virNetDevGetVLanID(const char *ifname, int *vlanid)
> >   {
> >       struct vlan_ioctl_args vlanargs = {
> > 
> 
> As you are attempting just fixing of the client it might be
> feasible to do:
> #if defined(SIOCGIFVLAN) && defined(HAVE_STRUCT_IFREQ) && defined(GET_VLAN_VID_CMD)
> 
> and let the compiler compile the fallback function that
> probably won't be used anyways.

hmm, yes good idea.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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