* [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state
@ 2012-09-05 2:39 K. Y. Srinivasan
0 siblings, 0 replies; 8+ messages in thread
From: K. Y. Srinivasan @ 2012-09-05 2:39 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, olaf, apw, ben, thozza, dcbw
Cc: K. Y. Srinivasan
To keep the KVP daemon code free of distro specific details, we invoke an
external script to retrieve the DHCP state. This is an example script that
was used to test the KVP code. This script has to be implemented in a Distro
specific fashion. For instance on distros that ship with Network Manager enabled,
this script can be based on NM APIs.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
---
tools/hv/hv_get_dhcp_info.sh | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
create mode 100755 tools/hv/hv_get_dhcp_info.sh
diff --git a/tools/hv/hv_get_dhcp_info.sh b/tools/hv/hv_get_dhcp_info.sh
new file mode 100755
index 0000000..ccd3e95
--- /dev/null
+++ b/tools/hv/hv_get_dhcp_info.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# This example script retrieves the DHCP state of a given interface.
+# In the interest of keeping the KVP daemon code free of distro specific
+# information; the kvp daemon code invokes this external script to gather
+# DHCP setting for the specific interface.
+#
+# Input: Name of the interface
+#
+# Output: The script prints the string "Enabled" to stdout to indicate
+# that DHCP is enabled on the interface. If DHCP is not enabled,
+# the script prints the string "Disabled" to stdout.
+#
+# Each Distro is expected to implement this script in a distro specific
+# fashion. For instance on Distros that ship with Network Manager enabled,
+# this script can be based on the Network Manager APIs for retrieving DHCP
+# information.
+
+if_file="/etc/sysconfig/network-scripts/ifcfg-"$1
+
+dhcp=$(grep "dhcp" $if_file 2>/dev/null)
+
+if [ "$dhcp" != "" ];
+then
+echo "Enabled"
+else
+echo "Disabled"
+fi
--
1.7.4.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V4 00/10] Tools: hv: kvp
@ 2012-09-04 21:45 K. Y. Srinivasan
2012-09-04 21:46 ` [PATCH V4 01/10] Tools: hv: Get rid of some unused variables K. Y. Srinivasan
0 siblings, 1 reply; 8+ messages in thread
From: K. Y. Srinivasan @ 2012-09-04 21:45 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, olaf, apw, ben, thozza, dcbw
Cc: K. Y. Srinivasan
This is a resubmission of the subset of the patches that were not
accepted in an earlier submission. The main objection last time was
that the KVP daemon code invoked external scripts for some of the
operations and that I had not included those scripts in the patchset.
This current approach of not encumbering the KVP daemon code with
Distro specific details was discussed on this mailing list and here is
the summary:
1) Using Network Manager APIs in the KVP daemon code directly would
minimize environments where KVP functionality could be deployed since
Network Manager is not available in all of the Distro images of interest;
especially server images.
2) The current architecture of invoking external scripts for what is
essentially a distro specific operation retains full flexibility of
deploying KVP on all Distros of interest while not sacrificing our ability to
use Network Manager APIs. For instance a Distro could choose to implement these
external scripts using NM AMPIs.
In this patchset I have included the external scripts that I had used to test the
KVP functionality as example scripts. These are meant as just examples.
K. Y. Srinivasan (10):
Tools: hv: Get rid of some unused variables
Tools: hv: Correctly type string variables
Tools: hv: Add an example script to retrieve DNS entries
Tools: hv: Gather DNS information
Tools: hv: Add an example script to retrieve dhcp state
Tools: hv: Gather DHCP information
Tools: hv: Add an example script to configure an interface
Tools: hv: Implement the KVP verb - KVP_OP_SET_IP_INFO
Tools: hv: Rename the function kvp_get_ip_address()
Tools: hv: Implement the KVP verb - KVP_OP_GET_IP_INFO
include/linux/hyperv.h | 2 +
tools/hv/hv_get_dhcp_info.sh | 25 ++
tools/hv/hv_get_dns_info.sh | 13 +
tools/hv/hv_kvp_daemon.c | 607 +++++++++++++++++++++++++++++++++++++++++-
tools/hv/hv_set_ifconfig.sh | 68 +++++
5 files changed, 703 insertions(+), 12 deletions(-)
create mode 100755 tools/hv/hv_get_dhcp_info.sh
create mode 100755 tools/hv/hv_get_dns_info.sh
create mode 100755 tools/hv/hv_set_ifconfig.sh
--
1.7.4.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH V4 01/10] Tools: hv: Get rid of some unused variables
2012-09-04 21:45 [PATCH V4 00/10] Tools: hv: kvp K. Y. Srinivasan
@ 2012-09-04 21:46 ` K. Y. Srinivasan
2012-09-04 21:46 ` [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state K. Y. Srinivasan
0 siblings, 1 reply; 8+ messages in thread
From: K. Y. Srinivasan @ 2012-09-04 21:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, olaf, apw, ben, thozza, dcbw
Cc: K. Y. Srinivasan
Get rid of unused variables.
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
---
tools/hv/hv_kvp_daemon.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 65d54c8..d12d714 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -196,7 +196,7 @@ static void kvp_update_mem_state(int pool)
}
static int kvp_file_init(void)
{
- int ret, fd;
+ int fd;
FILE *filep;
size_t records_read;
__u8 *fname;
@@ -312,7 +312,6 @@ static int kvp_key_add_or_modify(int pool, __u8 *key, int key_size, __u8 *value,
int value_size)
{
int i;
- int j, k;
int num_records;
struct kvp_record *record;
int num_blocks;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state
2012-09-04 21:46 ` [PATCH V4 01/10] Tools: hv: Get rid of some unused variables K. Y. Srinivasan
@ 2012-09-04 21:46 ` K. Y. Srinivasan
2012-09-04 22:59 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: K. Y. Srinivasan @ 2012-09-04 21:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, olaf, apw, ben, thozza, dcbw
Cc: K. Y. Srinivasan
To keep the KVP daemon code free of distro specific details, we invoke an
external script to retrieve the DHCP state. This is an example script that
was used to test the KVP code. This script has to be implemented in a Distro
specific fashion. For instance on distros that ship with Network Manager enabled,
this script can be based on NM APIs.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
---
tools/hv/hv_get_dhcp_info.sh | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
create mode 100755 tools/hv/hv_get_dhcp_info.sh
diff --git a/tools/hv/hv_get_dhcp_info.sh b/tools/hv/hv_get_dhcp_info.sh
new file mode 100755
index 0000000..3de4587
--- /dev/null
+++ b/tools/hv/hv_get_dhcp_info.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# This example script retrieves the DHCP state of a given interface.
+# In the interest of keeping the KVP daemon code free of distro specific
+# information; the kvp daemon code invokes this external script to gather
+# DHCP setting for the specific interface.
+#
+# Input: Name of the interface
+#
+# Output: The script prints the string "Enabled" to stdout to indicate
+# that DHCP is enabled on the interface.
+#
+# Each Distro is expected to implement this script in a distro specific
+# fashion. For instance on Distros that ship with Network Manager enabled,
+# this script can be based on the Network Manager APIs for retrieving DHCP
+# information.
+
+if_file="/etc/sysconfig/network-scripts/ifcfg-"$1
+
+dhcp=$(grep "dhcp" $if_file 2>/dev/null)
+
+if [ "$dhcp" != "" ];
+then
+echo "Enabled"
+fi
--
1.7.4.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state
2012-09-04 21:46 ` [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state K. Y. Srinivasan
@ 2012-09-04 22:59 ` Greg KH
2012-09-04 23:39 ` KY Srinivasan
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2012-09-04 22:59 UTC (permalink / raw)
To: K. Y. Srinivasan; +Cc: linux-kernel, devel, olaf, apw, ben, thozza, dcbw
On Tue, Sep 04, 2012 at 02:46:37PM -0700, K. Y. Srinivasan wrote:
> To keep the KVP daemon code free of distro specific details, we invoke an
> external script to retrieve the DHCP state. This is an example script that
> was used to test the KVP code. This script has to be implemented in a Distro
> specific fashion. For instance on distros that ship with Network Manager enabled,
> this script can be based on NM APIs.
>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
> ---
> tools/hv/hv_get_dhcp_info.sh | 25 +++++++++++++++++++++++++
> 1 files changed, 25 insertions(+), 0 deletions(-)
> create mode 100755 tools/hv/hv_get_dhcp_info.sh
>
> diff --git a/tools/hv/hv_get_dhcp_info.sh b/tools/hv/hv_get_dhcp_info.sh
> new file mode 100755
> index 0000000..3de4587
> --- /dev/null
> +++ b/tools/hv/hv_get_dhcp_info.sh
> @@ -0,0 +1,25 @@
> +#!/bin/bash
> +
> +# This example script retrieves the DHCP state of a given interface.
> +# In the interest of keeping the KVP daemon code free of distro specific
> +# information; the kvp daemon code invokes this external script to gather
> +# DHCP setting for the specific interface.
> +#
> +# Input: Name of the interface
> +#
> +# Output: The script prints the string "Enabled" to stdout to indicate
> +# that DHCP is enabled on the interface.
What happens if DHCP is not enabled on the interface? Shouldn't that
also return something other than "success"?
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state
2012-09-04 22:59 ` Greg KH
@ 2012-09-04 23:39 ` KY Srinivasan
2012-09-05 0:04 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: KY Srinivasan @ 2012-09-04 23:39 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, devel, olaf, apw, ben, thozza, dcbw
> -----Original Message-----
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Tuesday, September 04, 2012 6:59 PM
> To: KY Srinivasan
> Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> apw@canonical.com; ben@decadent.org.uk; thozza@redhat.com;
> dcbw@redhat.com
> Subject: Re: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp
> state
>
> On Tue, Sep 04, 2012 at 02:46:37PM -0700, K. Y. Srinivasan wrote:
> > To keep the KVP daemon code free of distro specific details, we invoke an
> > external script to retrieve the DHCP state. This is an example script that
> > was used to test the KVP code. This script has to be implemented in a Distro
> > specific fashion. For instance on distros that ship with Network Manager
> enabled,
> > this script can be based on NM APIs.
> >
> > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
> > ---
> > tools/hv/hv_get_dhcp_info.sh | 25 +++++++++++++++++++++++++
> > 1 files changed, 25 insertions(+), 0 deletions(-)
> > create mode 100755 tools/hv/hv_get_dhcp_info.sh
> >
> > diff --git a/tools/hv/hv_get_dhcp_info.sh b/tools/hv/hv_get_dhcp_info.sh
> > new file mode 100755
> > index 0000000..3de4587
> > --- /dev/null
> > +++ b/tools/hv/hv_get_dhcp_info.sh
> > @@ -0,0 +1,25 @@
> > +#!/bin/bash
> > +
> > +# This example script retrieves the DHCP state of a given interface.
> > +# In the interest of keeping the KVP daemon code free of distro specific
> > +# information; the kvp daemon code invokes this external script to gather
> > +# DHCP setting for the specific interface.
> > +#
> > +# Input: Name of the interface
> > +#
> > +# Output: The script prints the string "Enabled" to stdout to indicate
> > +# that DHCP is enabled on the interface.
>
> What happens if DHCP is not enabled on the interface? Shouldn't that
> also return something other than "success"?
The script is expected to write "Enabled" to stdout to indicate if DHCP is enabled; if this
is not the case, implicitly we assume DHCP is not enabled (since this is a binary state).
Regards,
K. Y
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state
2012-09-04 23:39 ` KY Srinivasan
@ 2012-09-05 0:04 ` Greg KH
2012-09-05 0:29 ` KY Srinivasan
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2012-09-05 0:04 UTC (permalink / raw)
To: KY Srinivasan; +Cc: olaf, thozza, linux-kernel, dcbw, apw, devel, ben
On Tue, Sep 04, 2012 at 11:39:12PM +0000, KY Srinivasan wrote:
>
>
> > -----Original Message-----
> > From: Greg KH [mailto:gregkh@linuxfoundation.org]
> > Sent: Tuesday, September 04, 2012 6:59 PM
> > To: KY Srinivasan
> > Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> > apw@canonical.com; ben@decadent.org.uk; thozza@redhat.com;
> > dcbw@redhat.com
> > Subject: Re: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp
> > state
> >
> > On Tue, Sep 04, 2012 at 02:46:37PM -0700, K. Y. Srinivasan wrote:
> > > To keep the KVP daemon code free of distro specific details, we invoke an
> > > external script to retrieve the DHCP state. This is an example script that
> > > was used to test the KVP code. This script has to be implemented in a Distro
> > > specific fashion. For instance on distros that ship with Network Manager
> > enabled,
> > > this script can be based on NM APIs.
> > >
> > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > > Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
> > > ---
> > > tools/hv/hv_get_dhcp_info.sh | 25 +++++++++++++++++++++++++
> > > 1 files changed, 25 insertions(+), 0 deletions(-)
> > > create mode 100755 tools/hv/hv_get_dhcp_info.sh
> > >
> > > diff --git a/tools/hv/hv_get_dhcp_info.sh b/tools/hv/hv_get_dhcp_info.sh
> > > new file mode 100755
> > > index 0000000..3de4587
> > > --- /dev/null
> > > +++ b/tools/hv/hv_get_dhcp_info.sh
> > > @@ -0,0 +1,25 @@
> > > +#!/bin/bash
> > > +
> > > +# This example script retrieves the DHCP state of a given interface.
> > > +# In the interest of keeping the KVP daemon code free of distro specific
> > > +# information; the kvp daemon code invokes this external script to gather
> > > +# DHCP setting for the specific interface.
> > > +#
> > > +# Input: Name of the interface
> > > +#
> > > +# Output: The script prints the string "Enabled" to stdout to indicate
> > > +# that DHCP is enabled on the interface.
> >
> > What happens if DHCP is not enabled on the interface? Shouldn't that
> > also return something other than "success"?
>
> The script is expected to write "Enabled" to stdout to indicate if DHCP is enabled; if this
> is not the case, implicitly we assume DHCP is not enabled (since this is a binary state).
It's not really "binary" given that you are expecting "Enabled" or
nothing, right? "Disabled" would make a bit more sense perhaps?
Having a script return "nothing at all" to show the failure of a state
doesn't seem the wisest thing, does it?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state
2012-09-05 0:04 ` Greg KH
@ 2012-09-05 0:29 ` KY Srinivasan
2012-09-05 2:25 ` KY Srinivasan
0 siblings, 1 reply; 8+ messages in thread
From: KY Srinivasan @ 2012-09-05 0:29 UTC (permalink / raw)
To: Greg KH; +Cc: olaf, thozza, linux-kernel, dcbw, apw, devel, ben
> -----Original Message-----
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Tuesday, September 04, 2012 8:04 PM
> To: KY Srinivasan
> Cc: olaf@aepfle.de; thozza@redhat.com; linux-kernel@vger.kernel.org;
> dcbw@redhat.com; apw@canonical.com; devel@linuxdriverproject.org;
> ben@decadent.org.uk
> Subject: Re: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp
> state
>
> On Tue, Sep 04, 2012 at 11:39:12PM +0000, KY Srinivasan wrote:
> >
> >
> > > -----Original Message-----
> > > From: Greg KH [mailto:gregkh@linuxfoundation.org]
> > > Sent: Tuesday, September 04, 2012 6:59 PM
> > > To: KY Srinivasan
> > > Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org;
> olaf@aepfle.de;
> > > apw@canonical.com; ben@decadent.org.uk; thozza@redhat.com;
> > > dcbw@redhat.com
> > > Subject: Re: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve
> dhcp
> > > state
> > >
> > > On Tue, Sep 04, 2012 at 02:46:37PM -0700, K. Y. Srinivasan wrote:
> > > > To keep the KVP daemon code free of distro specific details, we invoke an
> > > > external script to retrieve the DHCP state. This is an example script that
> > > > was used to test the KVP code. This script has to be implemented in a Distro
> > > > specific fashion. For instance on distros that ship with Network Manager
> > > enabled,
> > > > this script can be based on NM APIs.
> > > >
> > > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > > > Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
> > > > ---
> > > > tools/hv/hv_get_dhcp_info.sh | 25 +++++++++++++++++++++++++
> > > > 1 files changed, 25 insertions(+), 0 deletions(-)
> > > > create mode 100755 tools/hv/hv_get_dhcp_info.sh
> > > >
> > > > diff --git a/tools/hv/hv_get_dhcp_info.sh b/tools/hv/hv_get_dhcp_info.sh
> > > > new file mode 100755
> > > > index 0000000..3de4587
> > > > --- /dev/null
> > > > +++ b/tools/hv/hv_get_dhcp_info.sh
> > > > @@ -0,0 +1,25 @@
> > > > +#!/bin/bash
> > > > +
> > > > +# This example script retrieves the DHCP state of a given interface.
> > > > +# In the interest of keeping the KVP daemon code free of distro specific
> > > > +# information; the kvp daemon code invokes this external script to gather
> > > > +# DHCP setting for the specific interface.
> > > > +#
> > > > +# Input: Name of the interface
> > > > +#
> > > > +# Output: The script prints the string "Enabled" to stdout to indicate
> > > > +# that DHCP is enabled on the interface.
> > >
> > > What happens if DHCP is not enabled on the interface? Shouldn't that
> > > also return something other than "success"?
> >
> > The script is expected to write "Enabled" to stdout to indicate if DHCP is
> enabled; if this
> > is not the case, implicitly we assume DHCP is not enabled (since this is a binary
> state).
>
> It's not really "binary" given that you are expecting "Enabled" or
> nothing, right? "Disabled" would make a bit more sense perhaps?
In the KVP daemon code, I currently only check for "Enabled" to see if
DHCP is enabled.
>
> Having a script return "nothing at all" to show the failure of a state
> doesn't seem the wisest thing, does it?
I can certainly resubmit this patch with the change you are suggesting. This patch adds a new file
and does not impact any of the other patches that follows this. Would you want me to resubmit all of the
remaining patches starting with this one.
Regards,
K. Y
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state
2012-09-05 0:29 ` KY Srinivasan
@ 2012-09-05 2:25 ` KY Srinivasan
2012-09-05 19:12 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: KY Srinivasan @ 2012-09-05 2:25 UTC (permalink / raw)
To: KY Srinivasan, Greg KH; +Cc: olaf, thozza, linux-kernel, dcbw, apw, devel, ben
> -----Original Message-----
> From: devel [mailto:devel-bounces@linuxdriverproject.org] On Behalf Of KY
> Srinivasan
> Sent: Tuesday, September 04, 2012 8:29 PM
> To: Greg KH
> Cc: olaf@aepfle.de; thozza@redhat.com; linux-kernel@vger.kernel.org;
> dcbw@redhat.com; apw@canonical.com; devel@linuxdriverproject.org;
> ben@decadent.org.uk
> Subject: RE: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp
> state
>
>
>
> > -----Original Message-----
> > From: Greg KH [mailto:gregkh@linuxfoundation.org]
> > Sent: Tuesday, September 04, 2012 8:04 PM
> > To: KY Srinivasan
> > Cc: olaf@aepfle.de; thozza@redhat.com; linux-kernel@vger.kernel.org;
> > dcbw@redhat.com; apw@canonical.com; devel@linuxdriverproject.org;
> > ben@decadent.org.uk
> > Subject: Re: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp
> > state
> >
> > On Tue, Sep 04, 2012 at 11:39:12PM +0000, KY Srinivasan wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Greg KH [mailto:gregkh@linuxfoundation.org]
> > > > Sent: Tuesday, September 04, 2012 6:59 PM
> > > > To: KY Srinivasan
> > > > Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org;
> > olaf@aepfle.de;
> > > > apw@canonical.com; ben@decadent.org.uk; thozza@redhat.com;
> > > > dcbw@redhat.com
> > > > Subject: Re: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve
> > dhcp
> > > > state
> > > >
> > > > On Tue, Sep 04, 2012 at 02:46:37PM -0700, K. Y. Srinivasan wrote:
> > > > > To keep the KVP daemon code free of distro specific details, we invoke an
> > > > > external script to retrieve the DHCP state. This is an example script that
> > > > > was used to test the KVP code. This script has to be implemented in a
> Distro
> > > > > specific fashion. For instance on distros that ship with Network Manager
> > > > enabled,
> > > > > this script can be based on NM APIs.
> > > > >
> > > > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > > > > Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
> > > > > ---
> > > > > tools/hv/hv_get_dhcp_info.sh | 25 +++++++++++++++++++++++++
> > > > > 1 files changed, 25 insertions(+), 0 deletions(-)
> > > > > create mode 100755 tools/hv/hv_get_dhcp_info.sh
> > > > >
> > > > > diff --git a/tools/hv/hv_get_dhcp_info.sh
> b/tools/hv/hv_get_dhcp_info.sh
> > > > > new file mode 100755
> > > > > index 0000000..3de4587
> > > > > --- /dev/null
> > > > > +++ b/tools/hv/hv_get_dhcp_info.sh
> > > > > @@ -0,0 +1,25 @@
> > > > > +#!/bin/bash
> > > > > +
> > > > > +# This example script retrieves the DHCP state of a given interface.
> > > > > +# In the interest of keeping the KVP daemon code free of distro specific
> > > > > +# information; the kvp daemon code invokes this external script to
> gather
> > > > > +# DHCP setting for the specific interface.
> > > > > +#
> > > > > +# Input: Name of the interface
> > > > > +#
> > > > > +# Output: The script prints the string "Enabled" to stdout to indicate
> > > > > +# that DHCP is enabled on the interface.
> > > >
> > > > What happens if DHCP is not enabled on the interface? Shouldn't that
> > > > also return something other than "success"?
> > >
> > > The script is expected to write "Enabled" to stdout to indicate if DHCP is
> > enabled; if this
> > > is not the case, implicitly we assume DHCP is not enabled (since this is a binary
> > state).
> >
> > It's not really "binary" given that you are expecting "Enabled" or
> > nothing, right? "Disabled" would make a bit more sense perhaps?
>
> In the KVP daemon code, I currently only check for "Enabled" to see if
> DHCP is enabled.
>
> >
> > Having a script return "nothing at all" to show the failure of a state
> > doesn't seem the wisest thing, does it?
>
> I can certainly resubmit this patch with the change you are suggesting. This patch
> adds a new file
> and does not impact any of the other patches that follows this. Would you want
> me to resubmit all of the
> remaining patches starting with this one.
I have resent this patch with the change you have suggested. Since this patch is a
standalone patch I have not resent the other patches that follow this patch. Let me
know if you want me to resend the remaining patches.
Regards,
K. Y
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/devel
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state
2012-09-05 2:25 ` KY Srinivasan
@ 2012-09-05 19:12 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2012-09-05 19:12 UTC (permalink / raw)
To: KY Srinivasan; +Cc: olaf, thozza, linux-kernel, dcbw, apw, devel, ben
On Wed, Sep 05, 2012 at 02:25:28AM +0000, KY Srinivasan wrote:
> > I can certainly resubmit this patch with the change you are suggesting. This patch
> > adds a new file
> > and does not impact any of the other patches that follows this. Would you want
> > me to resubmit all of the
> > remaining patches starting with this one.
>
> I have resent this patch with the change you have suggested. Since this patch is a
> standalone patch I have not resent the other patches that follow this patch. Let me
> know if you want me to resend the remaining patches.
Please resend all of them, I no longer have them in my to-apply queue.
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-09-05 19:14 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-05 2:39 [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state K. Y. Srinivasan
-- strict thread matches above, loose matches on Subject: below --
2012-09-04 21:45 [PATCH V4 00/10] Tools: hv: kvp K. Y. Srinivasan
2012-09-04 21:46 ` [PATCH V4 01/10] Tools: hv: Get rid of some unused variables K. Y. Srinivasan
2012-09-04 21:46 ` [PATCH V4 05/10] Tools: hv: Add an example script to retrieve dhcp state K. Y. Srinivasan
2012-09-04 22:59 ` Greg KH
2012-09-04 23:39 ` KY Srinivasan
2012-09-05 0:04 ` Greg KH
2012-09-05 0:29 ` KY Srinivasan
2012-09-05 2:25 ` KY Srinivasan
2012-09-05 19:12 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).