public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: KY Srinivasan <kys@microsoft.com>
Cc: Olaf Hering <olaf@aepfle.de>,
	Greg KH <gregkh@linuxfoundation.org>,
	"apw@canonical.com" <apw@canonical.com>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"virtualization@lists.osdl.org" <virtualization@lists.osdl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH 00/13] drivers: hv: kvp
Date: Sun, 22 Jul 2012 03:50:58 +0100	[thread overview]
Message-ID: <1342925458.11373.210.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <426367E2313C2449837CD2DE46E7EAF9155EF7C6@SN2PRD0310MB382.namprd03.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 3244 bytes --]

On Tue, 2012-07-03 at 15:24 +0000, KY Srinivasan wrote:
> 
> > -----Original Message-----
> > From: Ben Hutchings [mailto:ben@decadent.org.uk]
> > Sent: Monday, July 02, 2012 3:57 PM
> > To: KY Srinivasan
> > Cc: Olaf Hering; Greg KH; apw@canonical.com; devel@linuxdriverproject.org;
> > virtualization@lists.osdl.org; linux-kernel@vger.kernel.org;
> > netdev@vger.kernel.org
> > Subject: Re: [PATCH 00/13] drivers: hv: kvp
> > 
> > On Mon, Jul 02, 2012 at 03:22:25PM +0000, KY Srinivasan wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Olaf Hering [mailto:olaf@aepfle.de]
> > > > Sent: Thursday, June 28, 2012 10:24 AM
> > > > To: KY Srinivasan
> > > > Cc: Greg KH; apw@canonical.com; devel@linuxdriverproject.org;
> > > > virtualization@lists.osdl.org; linux-kernel@vger.kernel.org
> > > > Subject: Re: [PATCH 00/13] drivers: hv: kvp
> > > >
> > > > On Tue, Jun 26, KY Srinivasan wrote:
> > > >
> > > > > > From: Greg KH [mailto:gregkh@linuxfoundation.org]
> > > > > > The fact that it was Red Hat specific was the main part, this should be
> > > > > > done in a standard way, with standard tools, right?
> > > > >
> > > > > The reason I asked this question was to make sure I address these
> > > > > issues in addition to whatever I am debugging now. I use the standard
> > > > > tools and calls to retrieve all the IP configuration. As I look at
> > > > > each distribution the files they keep persistent IP configuration
> > > > > Information is different and that is the reason I chose to start with
> > > > > RedHat. If there is a standard way to store the configuration, I will
> > > > > do that.
> > > >
> > > >
> > > > KY,
> > > >
> > > > instead of using system() in kvp_get_ipconfig_info and kvp_set_ip_info,
> > > > wouldnt it be easier to call an external helper script which does all
> > > > the distribution specific work? Just define some API to pass values to
> > > > the script, and something to read values collected by the script back
> > > > into the daemon.
> > >
> > > On the "Get" side I mostly use standard commands/APIs to get all the
> > information:
> > >
> > > 1) IP address information and subnet mask: getifaddrs()
> > > 2) DNS information:  Parsing /etc/resolv.conf
> > > 3) /sbin/ip command for all the routing information
> > 
> > If you're interested in the *current* configuration then (1) and (3)
> > are OK but you should really use the rtnetlink API.
> > 
> > However, I suspect that Hyper-V assumes that current and persistent
> > configuration are the same thing, which is obviously not true in
> > general on Linux.  But if NetworkManager is running then you can
> > assume they are.
> 
> I am only interested in the currently active information. Why do you
> recommend the use of rtnetlink API over the "ip" command. If I am not
> mistaken, the ip command uses netlink to get the information. 
[...]

'Screen-scraping' the output of administrative tools is not good
practice.  It may be the best you can do when writing a shell script,
but for a C program it's generaly less reliable and often more difficult
than using the underlying C API.

Ben.

-- 
Ben Hutchings
73.46% of all statistics are made up.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2012-07-22  2:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1340314200-27078-1-git-send-email-kys@microsoft.com>
     [not found] ` <20120621224737.GA5933@kroah.com>
     [not found]   ` <426367E2313C2449837CD2DE46E7EAF9155EC47A@SN2PRD0310MB382.namprd03.prod.outlook.com>
     [not found]     ` <20120622132547.GA2639@kroah.com>
     [not found]       ` <426367E2313C2449837CD2DE46E7EAF9155ED14D@SN2PRD0310MB382.namprd03.prod.outlook.com>
     [not found]         ` <20120626213954.GA4840@kroah.com>
     [not found]           ` <426367E2313C2449837CD2DE46E7EAF9155ED64A@SN2PRD0310MB382.namprd03.prod.outlook.com>
     [not found]             ` <20120626222205.GA5948@kroah.com>
     [not found]               ` <426367E2313C2449837CD2DE46E7EAF9155ED68D@SN2PRD0310MB382.namprd03.prod.outlook.com>
     [not found]                 ` <20120628142340.GA21537@aepfle.de>
2012-07-02 15:22                   ` [PATCH 00/13] drivers: hv: kvp KY Srinivasan
2012-07-02 19:57                     ` Ben Hutchings
2012-07-03 15:24                       ` KY Srinivasan
2012-07-22  2:50                         ` Ben Hutchings [this message]
2012-07-22 15:08                           ` KY Srinivasan
2012-07-03 13:20                     ` Olaf Hering
2012-07-03 15:03                       ` Stephen Hemminger
2012-07-03 15:35                         ` KY Srinivasan
2012-07-03 15:32                       ` KY Srinivasan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342925458.11373.210.camel@deadeye.wl.decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=apw@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=virtualization@lists.osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox