Skip to content
Snippets Groups Projects
Commit 5b156390 authored by Michael Tokarev's avatar Michael Tokarev Committed by Paolo Bonzini
Browse files

os-posix.c: create and export os_set_chroot()


Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Message-ID: <20230901101302.3618955-4-mjt@tls.msk.ru>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 22d02515
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,7 @@ int os_set_daemonize(bool d);
bool is_daemonized(void);
void os_daemonize(void);
bool os_set_runas(const char *optarg);
void os_set_chroot(const char *optarg);
void os_setup_post(void);
int os_mlock(void);
......
......@@ -159,7 +159,7 @@ int os_parse_cmd_args(int index, const char *optarg)
break;
case QEMU_OPTION_chroot:
warn_report("option is deprecated, use '-run-with chroot=...' instead");
chroot_dir = optarg;
os_set_chroot(optarg);
break;
case QEMU_OPTION_daemonize:
daemonize = 1;
......@@ -184,7 +184,7 @@ int os_parse_cmd_args(int index, const char *optarg)
#endif
str = qemu_opt_get(opts, "chroot");
if (str) {
chroot_dir = str;
os_set_chroot(str);
}
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)
{
if (chroot_dir) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment