Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1534218
| From | kys@exchange.microsoft.com |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 15/15] Tools: hv: kvp: configurable external scripts path |
| Date | 2016-12-01 16:40 +0100 |
| Message-ID | <sJBCO-5Lz-35@gated-at.bofh.it> (permalink) |
| References | <sJBCN-5Lz-9@gated-at.bofh.it> <sJBCN-5Lz-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Alex Fluter <afluter@yandex.com>
error when running hypervkvpd:
$ sudo ./hv_kvp_daemon -n
sh: hv_get_dns_info: command not found
sh: hv_get_dhcp_info: command not found
sh: hv_get_dns_info: command not found
sh: hv_get_dhcp_info: command not found
The external scripts are not installed in system path,
adding a configurable macro.
Signed-off-by: Alex Fluter <afluter@yandex.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
tools/hv/hv_kvp_daemon.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index d791dbf..f1758fc 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -93,6 +93,10 @@ enum {
#define KVP_CONFIG_LOC "/var/lib/hyperv"
+#ifndef KVP_SCRIPTS_PATH
+#define KVP_SCRIPTS_PATH "/usr/libexec/hypervkvpd/"
+#endif
+
#define MAX_FILE_NAME 100
#define ENTRIES_PER_BLOCK 50
@@ -818,7 +822,7 @@ static void kvp_get_ipconfig_info(char *if_name,
* .
*/
- sprintf(cmd, "%s", "hv_get_dns_info");
+ sprintf(cmd, KVP_SCRIPTS_PATH "%s", "hv_get_dns_info");
/*
* Execute the command to gather DNS info.
@@ -835,7 +839,7 @@ static void kvp_get_ipconfig_info(char *if_name,
* Enabled: DHCP enabled.
*/
- sprintf(cmd, "%s %s", "hv_get_dhcp_info", if_name);
+ sprintf(cmd, KVP_SCRIPTS_PATH "%s %s", "hv_get_dhcp_info", if_name);
file = popen(cmd, "r");
if (file == NULL)
@@ -1341,7 +1345,8 @@ static int kvp_set_ip_info(char *if_name, struct hv_kvp_ipaddr_value *new_val)
* invoke the external script to do its magic.
*/
- snprintf(cmd, sizeof(cmd), "%s %s", "hv_set_ifconfig", if_file);
+ snprintf(cmd, sizeof(cmd), KVP_SCRIPTS_PATH "%s %s",
+ "hv_set_ifconfig", if_file);
if (system(cmd)) {
syslog(LOG_ERR, "Failed to execute cmd '%s'; error: %d %s",
cmd, errno, strerror(errno));
--
1.7.4.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/15] Drivers: hv: CPU management fixes and a new uio driver kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
[PATCH 01/15] Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg() kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
[PATCH 10/15] hv: switch to cpuhp state machine for synic init/cleanup kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
[PATCH 14/15] uio-hv-generic: new userspace i/o driver for VMBus kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
[PATCH 09/15] hv: change clockevents unbind tactics kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
[PATCH 15/15] Tools: hv: kvp: configurable external scripts path kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
[PATCH 06/15] hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels() kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
Re: [PATCH 06/15] hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels() Greg KH <gregkh@linuxfoundation.org> - 2016-12-01 21:40 +0100
RE: [PATCH 06/15] hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels() KY Srinivasan <kys@microsoft.com> - 2016-12-02 07:30 +0100
[PATCH 03/15] hyperv: Fix spelling of HV_UNKOWN kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
[PATCH 11/15] hv: make CPU offlining prevention fine-grained kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
csiph-web