netlink-based ifconfig() routine replacement
Federico Simoncelli
fsimonce at redhat.com
Fri Jul 22 15:29:13 UTC 2011
I didn't check the code, but I believe we should use something
more standard that is already shipped in rhel: ethtool.
>>> import ethtool
>>> ethtool.get_interfaces_info('lo')[0].ipv4_address
'127.0.0.1'
>>> ethtool.get_interfaces_info('eth0')[0].ipv4_broadcast
'192.168.123.255'
Are there missing features in ethtool?
Did you check the performances?
--
Federico
----- Original Message -----
> From: "Peter V. Saveliev" <peet at altlinux.org>
> To: "Dan Kenigsberg" <danken at redhat.com>
> Cc: vdsm-patches at lists.fedorahosted.org
> Sent: Wednesday, July 20, 2011 7:14:20 PM
> Subject: Re: netlink-based ifconfig() routine replacement
> On 19.07.2011 16:58, Dan Kenigsberg wrote:
> <skip />
> > Please check your code with pyflakes (you can do make pyflakes),
> > there
> > are a couple of warnings there.
>
> Fixed
>
> >
> > Please add your new nlconfig file to vdsm.spec and Makefile.
>
> Fixed
> <skip />
> > You could have minimized the size of the patch even further, if you
> > had
> > used netinfo.nlconfig whereever needed - there is no need to import
> > nlconfig from here. I think it would be nicer to have nlconfig
> > "internal" to netinfo.
> <skip />
> > I'm not sure we are ready to remove ifconfig just yet (see
> > deployUtil
> > comment). How about importing nlconfig.nlconfig as ifconfig ?
>
> Yes, you're right. Done (just as «from nlconfig import nlconfig as
> ifconfig»)
>
> <skip />
> > deployUtil.py should keep running on RHEL-5, with python 2.4, and
> > vdsm22 -
> > that does not have nlconfig. That's why I'd like the new code to
> > hidden
> > within netinfo.ifconfig.
>
> Ok
>
> The diff between «master» branch and «nlconfig» branch attached.
>
>
> Also fixed sequence number checking on netlink messages — without it
> log
> messages (that are generated by kernel for some network events) could
> interfere with nlconfig() request.
> --
> Peter V. Saveliev
>
> _______________________________________________
> vdsm-patches mailing list
> vdsm-patches at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/vdsm-patches
More information about the vdsm-patches
mailing list