tools: acrn-manager: change path of vm conf files

The path of vm conf files changed from "/opt/acrn/conf" to "/usr/share/acrn/conf",
since "/opt" is not generally used on clearlinux.

Tracked-On: #2040
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Yan, Like
2018-12-12 15:25:05 +08:00
committed by wenlingz
parent 2f30dcdb37
commit 04fef4f363
5 changed files with 28 additions and 31 deletions

View File

@@ -143,7 +143,6 @@ void acrnd_vm_timer_func(struct work_arg *arg)
}
}
#define TIMER_LIST_FILE "/opt/acrn/conf/timer_list"
static pthread_mutex_t timer_file_mutex = PTHREAD_MUTEX_INITIALIZER;
/* load/store_timer_list to file to keep timers if SOS poweroff */
@@ -157,7 +156,7 @@ static int load_timer_list(void)
pthread_mutex_lock(&timer_file_mutex);
fp = fopen(TIMER_LIST_FILE, "r");
fp = fopen(ACRN_CONF_TIMER_LIST, "r");
if (!fp) {
perror("Open timer list file");
ret = -1;
@@ -402,7 +401,7 @@ static int store_timer_list(void)
int ret = 0;
pthread_mutex_lock(&timer_file_mutex);
fp = fopen(TIMER_LIST_FILE, "w+");
fp = fopen(ACRN_CONF_TIMER_LIST, "w+");
if (!fp) {
perror("Open timer list file");
ret = -1;
@@ -429,7 +428,7 @@ static int store_timer_list(void)
if (sys_wakeup) {
set_sos_timer(sys_wakeup);
} else {
unlink(TIMER_LIST_FILE);
unlink(ACRN_CONF_TIMER_LIST);
}
fclose(fp);
@@ -584,7 +583,7 @@ void handle_acrnd_resume(struct mngr_msg *msg, int client_fd, void *param)
if (wakeup_reason & CBC_WK_RSN_RTC) {
/* wakeup by RTC timer */
if (!stat(TIMER_LIST_FILE, &st)
if (!stat(ACRN_CONF_TIMER_LIST, &st)
&& S_ISREG(st.st_mode)) {
ack.data.err = load_timer_list();
if (ack.data.err == 0) {
@@ -602,7 +601,7 @@ void handle_acrnd_resume(struct mngr_msg *msg, int client_fd, void *param)
}
reply_ack:
unlink(TIMER_LIST_FILE);
unlink(ACRN_CONF_TIMER_LIST);
if (client_fd > 0)
mngr_send_msg(client_fd, &ack, NULL, 0);
@@ -677,7 +676,7 @@ int main(int argc, char *argv[])
return -1;
}
unlink(TIMER_LIST_FILE);
unlink(ACRN_CONF_TIMER_LIST);
atexit(handle_on_exit);