diff options
| -rw-r--r-- | 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 d791dbf05d9b..f1758fcbc37d 100644 --- a/tools/hv/hv_kvp_daemon.c +++ b/tools/hv/hv_kvp_daemon.c | |||
| @@ -93,6 +93,10 @@ static struct utsname uts_buf; | |||
| 93 | 93 | ||
| 94 | #define KVP_CONFIG_LOC "/var/lib/hyperv" | 94 | #define KVP_CONFIG_LOC "/var/lib/hyperv" |
| 95 | 95 | ||
| 96 | #ifndef KVP_SCRIPTS_PATH | ||
| 97 | #define KVP_SCRIPTS_PATH "/usr/libexec/hypervkvpd/" | ||
| 98 | #endif | ||
| 99 | |||
| 96 | #define MAX_FILE_NAME 100 | 100 | #define MAX_FILE_NAME 100 |
| 97 | #define ENTRIES_PER_BLOCK 50 | 101 | #define ENTRIES_PER_BLOCK 50 |
| 98 | 102 | ||
| @@ -818,7 +822,7 @@ static void kvp_get_ipconfig_info(char *if_name, | |||
| 818 | * . | 822 | * . |
| 819 | */ | 823 | */ |
| 820 | 824 | ||
| 821 | sprintf(cmd, "%s", "hv_get_dns_info"); | 825 | sprintf(cmd, KVP_SCRIPTS_PATH "%s", "hv_get_dns_info"); |
| 822 | 826 | ||
| 823 | /* | 827 | /* |
| 824 | * Execute the command to gather DNS info. | 828 | * Execute the command to gather DNS info. |
| @@ -835,7 +839,7 @@ static void kvp_get_ipconfig_info(char *if_name, | |||
| 835 | * Enabled: DHCP enabled. | 839 | * Enabled: DHCP enabled. |
| 836 | */ | 840 | */ |
| 837 | 841 | ||
| 838 | sprintf(cmd, "%s %s", "hv_get_dhcp_info", if_name); | 842 | sprintf(cmd, KVP_SCRIPTS_PATH "%s %s", "hv_get_dhcp_info", if_name); |
| 839 | 843 | ||
| 840 | file = popen(cmd, "r"); | 844 | file = popen(cmd, "r"); |
| 841 | if (file == NULL) | 845 | if (file == NULL) |
| @@ -1341,7 +1345,8 @@ static int kvp_set_ip_info(char *if_name, struct hv_kvp_ipaddr_value *new_val) | |||
| 1341 | * invoke the external script to do its magic. | 1345 | * invoke the external script to do its magic. |
| 1342 | */ | 1346 | */ |
| 1343 | 1347 | ||
| 1344 | snprintf(cmd, sizeof(cmd), "%s %s", "hv_set_ifconfig", if_file); | 1348 | snprintf(cmd, sizeof(cmd), KVP_SCRIPTS_PATH "%s %s", |
| 1349 | "hv_set_ifconfig", if_file); | ||
| 1345 | if (system(cmd)) { | 1350 | if (system(cmd)) { |
| 1346 | syslog(LOG_ERR, "Failed to execute cmd '%s'; error: %d %s", | 1351 | syslog(LOG_ERR, "Failed to execute cmd '%s'; error: %d %s", |
| 1347 | cmd, errno, strerror(errno)); | 1352 | cmd, errno, strerror(errno)); |
