summaryrefslogtreecommitdiffstats
path: root/vl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/vl.c b/vl.c
index 444b7507da..e725ecbc08 100644
--- a/vl.c
+++ b/vl.c
@@ -2318,7 +2318,7 @@ static void qemu_add_data_dir(const char *path)
return; /* duplicate */
}
}
- data_dir[data_dir_idx++] = path;
+ data_dir[data_dir_idx++] = g_strdup(path);
}
static inline bool nonempty_str(const char *str)
@@ -3078,7 +3078,7 @@ int main(int argc, char **argv, char **envp)
Error *main_loop_err = NULL;
Error *err = NULL;
bool list_data_dirs = false;
- char **dirs;
+ char *dir, **dirs;
typedef struct BlockdevOptions_queue {
BlockdevOptions *bdo;
Location loc;
@@ -4181,9 +4181,12 @@ int main(int argc, char **argv, char **envp)
for (i = 0; dirs[i] != NULL; i++) {
qemu_add_data_dir(dirs[i]);
}
+ g_strfreev(dirs);
/* try to find datadir relative to the executable path */
- qemu_add_data_dir(os_find_datadir());
+ dir = os_find_datadir();
+ qemu_add_data_dir(dir);
+ g_free(dir);
/* add the datadir specified when building */
qemu_add_data_dir(CONFIG_QEMU_DATADIR);
@@ -4608,8 +4611,6 @@ int main(int argc, char **argv, char **envp)
current_machine->boot_order = boot_order;
current_machine->cpu_model = cpu_model;
- parse_numa_opts(current_machine);
-
/* parse features once if machine provides default cpu_type */
if (machine_class->default_cpu_type) {
current_machine->cpu_type = machine_class->default_cpu_type;
@@ -4618,6 +4619,7 @@ int main(int argc, char **argv, char **envp)
cpu_parse_cpu_model(machine_class->default_cpu_type, cpu_model);
}
}
+ parse_numa_opts(current_machine);
machine_run_board_init(current_machine);
@@ -4792,6 +4794,7 @@ int main(int argc, char **argv, char **envp)
monitor_cleanup();
qemu_chr_cleanup();
user_creatable_cleanup();
+ migration_object_finalize();
/* TODO: unref root container, check all devices are ok */
return 0;