[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/51] os-posix.c: create and export os_set_chroot()
From: |
Paolo Bonzini |
Subject: |
[PULL 08/51] os-posix.c: create and export os_set_chroot() |
Date: |
Thu, 7 Sep 2023 14:59:17 +0200 |
From: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230901101302.3618955-4-mjt@tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/sysemu/os-posix.h | 1 +
os-posix.c | 9 +++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index d32630f9e76..8a667633953 100644
--- a/include/sysemu/os-posix.h
+++ b/include/sysemu/os-posix.h
@@ -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);
diff --git a/os-posix.c b/os-posix.c
index f0ee5c8b002..ed0787ecfd9 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -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) {
--
2.41.0
- [PULL 00/51] Build system, i386 changes for 2023-09-07, Paolo Bonzini, 2023/09/07
- [PULL 01/51] linux-user, bsd-user: disable on unsupported host architectures, Paolo Bonzini, 2023/09/07
- [PULL 03/51] target/i386: generalize operand size "ph" for use in CVTPS2PD, Paolo Bonzini, 2023/09/07
- [PULL 02/51] target/i386: raise FERR interrupt with iothread locked, Paolo Bonzini, 2023/09/07
- [PULL 05/51] target/i386: Add support for AMX-COMPLEX in CPUID enumeration, Paolo Bonzini, 2023/09/07
- [PULL 04/51] target/i386: fix memory operand size for CVTPS2PD, Paolo Bonzini, 2023/09/07
- [PULL 06/51] include/sysemu/os-posix.h: move *daemonize* declarations together, Paolo Bonzini, 2023/09/07
- [PULL 08/51] os-posix.c: create and export os_set_chroot(),
Paolo Bonzini <=
- [PULL 10/51] os-posix.c: move code around, Paolo Bonzini, 2023/09/07
- [PULL 09/51] os-posix.c, softmmu/vl.c: move os_parse_cmd_args() into qemu_init(), Paolo Bonzini, 2023/09/07
- [PULL 14/51] contrib/plugins: remove -soname argument, Paolo Bonzini, 2023/09/07
- [PULL 07/51] os-posix.c: create and export os_set_runas(), Paolo Bonzini, 2023/09/07
- [PULL 12/51] softmmu/vl.c: inline include/qemu/qemu-options.h into vl.c, Paolo Bonzini, 2023/09/07
- [PULL 15/51] contrib/plugins/cache: Fix string format, Paolo Bonzini, 2023/09/07
- [PULL 17/51] contrib/plugins/howvec: Fix string format, Paolo Bonzini, 2023/09/07
- [PULL 16/51] contrib/plugins/drcov: Fix string format, Paolo Bonzini, 2023/09/07
- [PULL 21/51] meson: update unsupported host/CPU messages, Paolo Bonzini, 2023/09/07
- [PULL 25/51] configure: remove boolean variables for targets, Paolo Bonzini, 2023/09/07