|
@@ -159,7 +159,7 @@ int os_parse_cmd_args(int index, const char *optarg)
|
|
break;
|
|
break;
|
|
case QEMU_OPTION_chroot:
|
|
case QEMU_OPTION_chroot:
|
|
warn_report("option is deprecated, use '-run-with chroot=...' instead");
|
|
warn_report("option is deprecated, use '-run-with chroot=...' instead");
|
|
- chroot_dir = optarg;
|
|
|
|
|
|
+ os_set_chroot(optarg);
|
|
break;
|
|
break;
|
|
case QEMU_OPTION_daemonize:
|
|
case QEMU_OPTION_daemonize:
|
|
daemonize = 1;
|
|
daemonize = 1;
|
|
@@ -184,7 +184,7 @@ int os_parse_cmd_args(int index, const char *optarg)
|
|
#endif
|
|
#endif
|
|
str = qemu_opt_get(opts, "chroot");
|
|
str = qemu_opt_get(opts, "chroot");
|
|
if (str) {
|
|
if (str) {
|
|
- chroot_dir = str;
|
|
|
|
|
|
+ os_set_chroot(str);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -232,6 +232,11 @@ static void change_process_uid(void)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void os_set_chroot(const char *optarg)
|
|
|
|
+{
|
|
|
|
+ chroot_dir = optarg;
|
|
|
|
+}
|
|
|
|
+
|
|
static void change_root(void)
|
|
static void change_root(void)
|
|
{
|
|
{
|
|
if (chroot_dir) {
|
|
if (chroot_dir) {
|