[libvirt] [PATCH 2/4] virtnetdev: Add support functions for mac and portprofile associations on a hostdev

Roopa Prabhu roprabhu at cisco.com
Mon Mar 5 20:12:09 UTC 2012




On 3/5/12 11:50 AM, "Roopa Prabhu" <roprabhu at cisco.com> wrote:

> 
> 
> 
> On 3/5/12 10:23 AM, "Laine Stump" <laine at laine.org> wrote:
> 
>> On 03/04/2012 10:15 PM, Roopa Prabhu wrote:
>>> From: Roopa Prabhu <roprabhu at cisco.com>
>>> 
>>> This patch adds the following:
>>> - functions to set and get vf configs
>>> - Functions to replace and store vf configs (Only mac address is handled
>>> today.
>>>   But the functions can be easily extended for vlans and other vf configs)
>>> - function to dump link dev info (This is moved from
>>> virnetdevvportprofile.c)
>>> 
>>> Signed-off-by: Roopa Prabhu <roprabhu at cisco.com>
>>> ---
>>>  src/util/virnetdev.c |  531
>>> ++++++++++++++++++++++++++++++++++++++++++++++++++
>>>  src/util/virnetdev.h |   19 ++
>>>  2 files changed, 549 insertions(+), 1 deletions(-)
>> 
>> (BTW, I never thought about doing it this way before, but I'm glad you
>> added the function here in a separate patch from the patch that removes
>> it from virnetdevvportprofile.c - that makes it easy to open the two
>> patches side-by-side and verify that it really is moving the same code
>> (well, mostly).)
>> 
>>> 
>>> 
>>> diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
>>> index 9d76d47..25f2155 100644
>>> --- a/src/util/virnetdev.c
>>> +++ b/src/util/virnetdev.c
>>> @@ -1127,8 +1127,497 @@ virNetDevGetPhysicalFunction(const char *ifname,
>>> char
>>> **pfname)
>>>  
>>>      return ret;
>>>  }
>>> -#else /* !__linux__ */
>> 
>> The functions here that use libnl need to be inside of
>> 
>>   #if defined(__linux__) && defined(HAVE_LIBNL)
>> 
>> since there are linux platforms that don't have libnl, or don't have the
>> proper LIBNL (RHEL5, in particular, still has libnl-1.0)
>> 
> 
> I was hoping someone will point out what #defines to use here. So thanks. I
> will add HAVE_LIBNL. We also need it for IFLA_VF_MAC and VLAN. They were
> under HAVE_VIRTPORT before. Can you suggest what I can do here ?
>  
> 
Correction: They were under WITH_VIRUALPORT (which has a configure option
and a check for IFLA_VF_PORT_MAX).

We will need a check for IFLA_VF_MAX here.

I think I will try putting this under defined(IFLA_VF_MAX). This should
cover IFLA_VF_MAC and IFLA_VF_VLAN I think. If you have any other
suggestions let me know.

Thanks,
Roopa





More information about the libvir-list mailing list