From nobody Wed May 15 12:02:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693563229825497.82136032558276; Fri, 1 Sep 2023 03:13:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc19V-0001KD-Uu; Fri, 01 Sep 2023 06:13:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19H-0001JB-NB for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:10 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19F-0001Zh-9m for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:07 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 4501F1E72E; Fri, 1 Sep 2023 13:13:38 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 7CE2425066; Fri, 1 Sep 2023 13:13:02 +0300 (MSK) Received: (nullmailer pid 3618987 invoked by uid 1000); Fri, 01 Sep 2023 10:13:02 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Michael Tokarev , Eric Blake Subject: [PATCH 1/8] include/sysemu/os-posix.h: move *daemonize* declarations together Date: Fri, 1 Sep 2023 13:12:55 +0300 Message-Id: <20230901101302.3618955-2-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901101302.3618955-1-mjt@tls.msk.ru> References: <20230901101302.3618955-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1693563231981100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Michael Tokarev Reviewed-by: Eric Blake --- include/sysemu/os-posix.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index 1030d39904..65b9c94e91 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -47,13 +47,12 @@ void os_set_line_buffering(void); void os_setup_early_signal_handling(void); void os_set_proc_name(const char *s); void os_setup_signal_handling(void); +int os_set_daemonize(bool d); +bool is_daemonized(void); void os_daemonize(void); void os_setup_post(void); int os_mlock(void); =20 -int os_set_daemonize(bool d); -bool is_daemonized(void); - /** * qemu_alloc_stack: * @sz: pointer to a size_t holding the requested usable stack size --=20 2.39.2 From nobody Wed May 15 12:02:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693563255386984.1730359592902; Fri, 1 Sep 2023 03:14:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc19a-0001Lw-Px; Fri, 01 Sep 2023 06:13:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19N-0001Jp-3x for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:16 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19J-0001aH-PK for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:12 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 73E7B1E72F; Fri, 1 Sep 2023 13:13:38 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id AFA9125067; Fri, 1 Sep 2023 13:13:02 +0300 (MSK) Received: (nullmailer pid 3618990 invoked by uid 1000); Fri, 01 Sep 2023 10:13:02 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Michael Tokarev , Eric Blake Subject: [PATCH 2/8] os-posix: create and export os_set_runas() Date: Fri, 1 Sep 2023 13:12:56 +0300 Message-Id: <20230901101302.3618955-3-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901101302.3618955-1-mjt@tls.msk.ru> References: <20230901101302.3618955-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1693563256834100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Michael Tokarev Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- include/sysemu/os-posix.h | 1 + os-posix.c | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index 65b9c94e91..d32630f9e7 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -50,6 +50,7 @@ void os_setup_signal_handling(void); int os_set_daemonize(bool d); bool is_daemonized(void); void os_daemonize(void); +bool os_set_runas(const char *optarg); void os_setup_post(void); int os_mlock(void); =20 diff --git a/os-posix.c b/os-posix.c index cfcb96533c..0202bb4898 100644 --- a/os-posix.c +++ b/os-posix.c @@ -102,8 +102,14 @@ void os_set_proc_name(const char *s) #endif } =20 - -static bool os_parse_runas_uid_gid(const char *optarg) +/* + * Prepare to change user ID. optarg can be one of 3 forms: + * - a username, in which case user ID will be changed to its uid, + * with primary and supplementary groups set up too; + * - a nemeric uid, in which case only the uid will be set; + * - a pair of numeric uid:gid. + */ +bool os_set_runas(const char *optarg) { unsigned long lv; const char *ep; @@ -111,6 +117,13 @@ static bool os_parse_runas_uid_gid(const char *optarg) gid_t got_gid; int rc; =20 + user_pwd =3D getpwnam(optarg); + if (user_pwd) { + user_uid =3D -1; + user_gid =3D -1; + return true; + } + rc =3D qemu_strtoul(optarg, &ep, 0, &lv); got_uid =3D lv; /* overflow here is ID in C99 */ if (rc || *ep !=3D ':' || got_uid !=3D lv || got_uid =3D=3D (uid_t)-1)= { @@ -137,11 +150,7 @@ int os_parse_cmd_args(int index, const char *optarg) { switch (index) { case QEMU_OPTION_runas: - user_pwd =3D getpwnam(optarg); - if (user_pwd) { - user_uid =3D -1; - user_gid =3D -1; - } else if (!os_parse_runas_uid_gid(optarg)) { + if (!os_set_runas(optarg)) { error_report("User \"%s\" doesn't exist" " (and is not :)", optarg); --=20 2.39.2 From nobody Wed May 15 12:02:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16935633325458.03441511399501; Fri, 1 Sep 2023 03:15:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc19a-0001Lx-Q4; Fri, 01 Sep 2023 06:13:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19L-0001Jg-5L for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:13 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19I-0001aL-Tg for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:10 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A794F1E730; Fri, 1 Sep 2023 13:13:38 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id E404B25068; Fri, 1 Sep 2023 13:13:02 +0300 (MSK) Received: (nullmailer pid 3618993 invoked by uid 1000); Fri, 01 Sep 2023 10:13:02 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Michael Tokarev , Eric Blake Subject: [PATCH 3/8] os-posix.c: create and export os_set_chroot() Date: Fri, 1 Sep 2023 13:12:57 +0300 Message-Id: <20230901101302.3618955-4-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901101302.3618955-1-mjt@tls.msk.ru> References: <20230901101302.3618955-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1693563334043100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Michael Tokarev Reviewed-by: Eric Blake --- 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 d32630f9e7..8a66763395 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); =20 diff --git a/os-posix.c b/os-posix.c index 0202bb4898..081f3db685 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=3D...' in= stead"); - chroot_dir =3D optarg; + os_set_chroot(optarg); break; case QEMU_OPTION_daemonize: daemonize =3D 1; @@ -184,7 +184,7 @@ int os_parse_cmd_args(int index, const char *optarg) #endif str =3D qemu_opt_get(opts, "chroot"); if (str) { - chroot_dir =3D str; + os_set_chroot(str); } break; } @@ -232,6 +232,11 @@ static void change_process_uid(void) } } =20 +void os_set_chroot(const char *optarg) +{ + chroot_dir =3D optarg; +} + static void change_root(void) { if (chroot_dir) { --=20 2.39.2 From nobody Wed May 15 12:02:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169356327303833.142817036741576; Fri, 1 Sep 2023 03:14:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc19b-0001NA-Tg; Fri, 01 Sep 2023 06:13:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19O-0001K2-NI for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:16 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19M-0001am-6p for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:14 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 351371E731; Fri, 1 Sep 2023 13:13:39 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 1D21025069; Fri, 1 Sep 2023 13:13:03 +0300 (MSK) Received: (nullmailer pid 3618996 invoked by uid 1000); Fri, 01 Sep 2023 10:13:02 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Michael Tokarev , Eric Blake Subject: [PATCH 4/8] os-posix.c, softmmu/vl.c: move os_parse_cmd_args() into qemu_init() Date: Fri, 1 Sep 2023 13:12:58 +0300 Message-Id: <20230901101302.3618955-5-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901101302.3618955-1-mjt@tls.msk.ru> References: <20230901101302.3618955-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1693563274911100003 Content-Type: text/plain; charset="utf-8" This will stop linking softmmu-specific os_parse_cmd_args() into every qemu executable which happens to use other functions from os-posix.c, such as os_set_line_buffering() or os_setup_signal_handling(). Also, since there's no win32-specific options, *all* option parsing is now done in softmmu/vl.c:qemu_init(), which is easier to read without extra indirection, - all options are in the single function now. This effectively reverts commit 59a5264b99434. Signed-off-by: Michael Tokarev Reviewed-by: Eric Blake --- include/sysemu/os-posix.h | 1 - include/sysemu/os-win32.h | 1 - os-posix.c | 82 --------------------------------------- softmmu/vl.c | 76 ++++++++++++++++++++++++++++++++++-- 4 files changed, 73 insertions(+), 87 deletions(-) diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index 8a66763395..6dfdcbb086 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -42,7 +42,6 @@ extern "C" { #endif =20 -int os_parse_cmd_args(int index, const char *optarg); void os_set_line_buffering(void); void os_setup_early_signal_handling(void); void os_set_proc_name(const char *s); diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index 91aa0d7ec0..8ae30fac15 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -101,7 +101,6 @@ static inline void os_setup_signal_handling(void) {} static inline void os_daemonize(void) {} static inline void os_setup_post(void) {} static inline void os_set_proc_name(const char *dummy) {} -static inline int os_parse_cmd_args(int index, const char *optarg) { retur= n -1; } void os_set_line_buffering(void); void os_setup_early_signal_handling(void); =20 diff --git a/os-posix.c b/os-posix.c index 081f3db685..4102fcdb5e 100644 --- a/os-posix.c +++ b/os-posix.c @@ -31,18 +31,13 @@ =20 /* Needed early for CONFIG_BSD etc. */ #include "net/slirp.h" -#include "qemu/qemu-options.h" #include "qemu/error-report.h" #include "qemu/log.h" #include "sysemu/runstate.h" #include "qemu/cutils.h" -#include "qemu/config-file.h" -#include "qemu/option.h" -#include "qemu/module.h" =20 #ifdef CONFIG_LINUX #include -#include "qemu/async-teardown.h" #endif =20 /* @@ -142,59 +137,6 @@ bool os_set_runas(const char *optarg) return true; } =20 -/* - * Parse OS specific command line options. - * return 0 if option handled, -1 otherwise - */ -int os_parse_cmd_args(int index, const char *optarg) -{ - switch (index) { - case QEMU_OPTION_runas: - if (!os_set_runas(optarg)) { - error_report("User \"%s\" doesn't exist" - " (and is not :)", - optarg); - exit(1); - } - break; - case QEMU_OPTION_chroot: - warn_report("option is deprecated, use '-run-with chroot=3D...' in= stead"); - os_set_chroot(optarg); - break; - case QEMU_OPTION_daemonize: - daemonize =3D 1; - break; -#if defined(CONFIG_LINUX) - /* deprecated */ - case QEMU_OPTION_asyncteardown: - init_async_teardown(); - break; -#endif - case QEMU_OPTION_run_with: { - const char *str; - QemuOpts *opts =3D qemu_opts_parse_noisily(qemu_find_opts("run-wit= h"), - optarg, false); - if (!opts) { - exit(1); - } -#if defined(CONFIG_LINUX) - if (qemu_opt_get_bool(opts, "async-teardown", false)) { - init_async_teardown(); - } -#endif - str =3D qemu_opt_get(opts, "chroot"); - if (str) { - os_set_chroot(str); - } - break; - } - default: - return -1; - } - - return 0; -} - static void change_process_uid(void) { assert((user_uid =3D=3D (uid_t)-1) || user_pwd =3D=3D NULL); @@ -371,27 +313,3 @@ int os_mlock(void) return -ENOSYS; #endif } - -static QemuOptsList qemu_run_with_opts =3D { - .name =3D "run-with", - .head =3D QTAILQ_HEAD_INITIALIZER(qemu_run_with_opts.head), - .desc =3D { -#if defined(CONFIG_LINUX) - { - .name =3D "async-teardown", - .type =3D QEMU_OPT_BOOL, - }, -#endif - { - .name =3D "chroot", - .type =3D QEMU_OPT_STRING, - }, - { /* end of list */ } - }, -}; - -static void register_runwith(void) -{ - qemu_add_opts(&qemu_run_with_opts); -} -opts_init(register_runwith); diff --git a/softmmu/vl.c b/softmmu/vl.c index b0b96f67fa..0a74810ca3 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -49,6 +49,7 @@ #include "qemu/error-report.h" #include "qemu/sockets.h" #include "qemu/accel.h" +#include "qemu/async-teardown.h" #include "hw/usb.h" #include "hw/isa/isa.h" #include "hw/scsi/scsi.h" @@ -748,6 +749,33 @@ static QemuOptsList qemu_smp_opts =3D { }, }; =20 +#if defined(CONFIG_POSIX) +static QemuOptsList qemu_run_with_opts =3D { + .name =3D "run-with", + .head =3D QTAILQ_HEAD_INITIALIZER(qemu_run_with_opts.head), + .desc =3D { +#if defined(CONFIG_LINUX) + { + .name =3D "async-teardown", + .type =3D QEMU_OPT_BOOL, + }, +#endif + { + .name =3D "chroot", + .type =3D QEMU_OPT_STRING, + }, + { /* end of list */ } + }, +}; + +#define qemu_add_run_with_opts() qemu_add_opts(&qemu_run_with_opts) + +#else + +#define qemu_add_run_with_opts() + +#endif /* CONFIG_POSIX */ + static void realtime_init(void) { if (enable_mlock) { @@ -2704,6 +2732,7 @@ void qemu_init(int argc, char **argv) qemu_add_opts(&qemu_semihosting_config_opts); qemu_add_opts(&qemu_fw_cfg_opts); qemu_add_opts(&qemu_action_opts); + qemu_add_run_with_opts(); module_call_init(MODULE_INIT_OPTS); =20 error_init(argv[0]); @@ -3522,11 +3551,52 @@ void qemu_init(int argc, char **argv) case QEMU_OPTION_nouserconfig: /* Nothing to be parsed here. Especially, do not error out= below. */ break; - default: - if (os_parse_cmd_args(popt->index, optarg)) { - error_report("Option not supported in this build"); +#if defined(CONFIG_POSIX) + case QEMU_OPTION_runas: + if (!os_set_runas(optarg)) { + error_report("User \"%s\" doesn't exist" + " (and is not :)", + optarg); + exit(1); + } + break; + case QEMU_OPTION_chroot: + warn_report("option is deprecated," + " use '-run-with chroot=3D...' instead"); + os_set_chroot(optarg); + break; + case QEMU_OPTION_daemonize: + os_set_daemonize(true); + break; +#if defined(CONFIG_LINUX) + /* deprecated */ + case QEMU_OPTION_asyncteardown: + init_async_teardown(); + break; +#endif + case QEMU_OPTION_run_with: { + const char *str; + opts =3D qemu_opts_parse_noisily(qemu_find_opts("run-with"= ), + optarg, false); + if (!opts) { exit(1); } +#if defined(CONFIG_LINUX) + if (qemu_opt_get_bool(opts, "async-teardown", false)) { + init_async_teardown(); + } +#endif + str =3D qemu_opt_get(opts, "chroot"); + if (str) { + os_set_chroot(str); + } + break; + } +#endif /* CONFIG_POSIX */ + + default: + error_report("Option not supported in this build"); + exit(1); } } } --=20 2.39.2 From nobody Wed May 15 12:02:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693563284593160.00759914299715; Fri, 1 Sep 2023 03:14:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc19e-0001NN-BT; Fri, 01 Sep 2023 06:13:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19Q-0001KC-Dm for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:19 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19O-0001b3-5v for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:16 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 6247A1E732; Fri, 1 Sep 2023 13:13:39 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id A56052506A; Fri, 1 Sep 2023 13:13:03 +0300 (MSK) Received: (nullmailer pid 3618999 invoked by uid 1000); Fri, 01 Sep 2023 10:13:02 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Michael Tokarev , Eric Blake Subject: [PATCH 5/8] os-posix.c: move code around Date: Fri, 1 Sep 2023 13:12:59 +0300 Message-Id: <20230901101302.3618955-6-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901101302.3618955-1-mjt@tls.msk.ru> References: <20230901101302.3618955-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1693563285650100003 Content-Type: text/plain; charset="utf-8" this moves code blocks so that functions and variables which belongs to the same concept are now close to each other. There's no actual code changes in there. Signed-off-by: Michael Tokarev Reviewed-by: Eric Blake --- os-posix.c | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/os-posix.c b/os-posix.c index 4102fcdb5e..340373d972 100644 --- a/os-posix.c +++ b/os-posix.c @@ -40,17 +40,6 @@ #include #endif =20 -/* - * Must set all three of these at once. - * Legal combinations are unset by name by uid - */ -static struct passwd *user_pwd; /* NULL non-NULL NULL */ -static uid_t user_uid =3D (uid_t)-1; /* -1 -1 >=3D0 */ -static gid_t user_gid =3D (gid_t)-1; /* -1 -1 >=3D0 */ - -static const char *chroot_dir; -static int daemonize; -static int daemon_pipe; =20 void os_setup_early_signal_handling(void) { @@ -97,6 +86,15 @@ void os_set_proc_name(const char *s) #endif } =20 + +/* + * Must set all three of these at once. + * Legal combinations are unset by name by uid + */ +static struct passwd *user_pwd; /* NULL non-NULL NULL */ +static uid_t user_uid =3D (uid_t)-1; /* -1 -1 >=3D0 */ +static gid_t user_gid =3D (gid_t)-1; /* -1 -1 >=3D0 */ + /* * Prepare to change user ID. optarg can be one of 3 forms: * - a username, in which case user ID will be changed to its uid, @@ -174,6 +172,9 @@ static void change_process_uid(void) } } =20 + +static const char *chroot_dir; + void os_set_chroot(const char *optarg) { chroot_dir =3D optarg; @@ -194,6 +195,21 @@ static void change_root(void) =20 } =20 + +static int daemonize; +static int daemon_pipe; + +bool is_daemonized(void) +{ + return daemonize; +} + +int os_set_daemonize(bool d) +{ + daemonize =3D d; + return 0; +} + void os_daemonize(void) { if (daemonize) { @@ -287,17 +303,6 @@ void os_set_line_buffering(void) setvbuf(stdout, NULL, _IOLBF, 0); } =20 -bool is_daemonized(void) -{ - return daemonize; -} - -int os_set_daemonize(bool d) -{ - daemonize =3D d; - return 0; -} - int os_mlock(void) { #ifdef HAVE_MLOCKALL --=20 2.39.2 From nobody Wed May 15 12:02:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693563221858423.16743625055074; Fri, 1 Sep 2023 03:13:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc19Z-0001Lu-KH; Fri, 01 Sep 2023 06:13:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19S-0001KS-AT for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:19 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19Q-0001bI-5l for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:17 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A34441E733; Fri, 1 Sep 2023 13:13:39 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id D26AA2506B; Fri, 1 Sep 2023 13:13:03 +0300 (MSK) Received: (nullmailer pid 3619002 invoked by uid 1000); Fri, 01 Sep 2023 10:13:02 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Michael Tokarev , Eric Blake Subject: [PATCH 6/8] os-posix.c: remove unneeded #includes Date: Fri, 1 Sep 2023 13:13:00 +0300 Message-Id: <20230901101302.3618955-7-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901101302.3618955-1-mjt@tls.msk.ru> References: <20230901101302.3618955-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1693563223976100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Michael Tokarev Reviewed-by: Eric Blake --- os-posix.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/os-posix.c b/os-posix.c index 340373d972..d3490b0a9b 100644 --- a/os-posix.c +++ b/os-posix.c @@ -29,8 +29,6 @@ #include #include =20 -/* Needed early for CONFIG_BSD etc. */ -#include "net/slirp.h" #include "qemu/error-report.h" #include "qemu/log.h" #include "sysemu/runstate.h" --=20 2.39.2 From nobody Wed May 15 12:02:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693563247437463.41006654667115; Fri, 1 Sep 2023 03:14:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc19e-0001NM-Bh; Fri, 01 Sep 2023 06:13:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19U-0001Kf-6e for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:21 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19R-0001bc-F7 for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id CA0B51E734; Fri, 1 Sep 2023 13:13:39 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 1F39D2506C; Fri, 1 Sep 2023 13:13:04 +0300 (MSK) Received: (nullmailer pid 3619005 invoked by uid 1000); Fri, 01 Sep 2023 10:13:02 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Michael Tokarev , Eric Blake Subject: [PATCH 7/8] softmmu/vl.c: inline include/qemu/qemu-options.h into vl.c Date: Fri, 1 Sep 2023 13:13:01 +0300 Message-Id: <20230901101302.3618955-8-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901101302.3618955-1-mjt@tls.msk.ru> References: <20230901101302.3618955-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1693563248226100002 Content-Type: text/plain; charset="utf-8" qemu-options.h just includes qemu-options.def with some #defines. We already do this in vl.c in other place. Since no other file includes qemu-options.h anymore, just inline it in vl.c. This effectively reverts second half of commit 59a5264b99434. Signed-off-by: Michael Tokarev Reviewed-by: Eric Blake --- include/qemu/qemu-options.h | 41 ------------------------------------- softmmu/vl.c | 11 +++++++++- 2 files changed, 10 insertions(+), 42 deletions(-) delete mode 100644 include/qemu/qemu-options.h diff --git a/include/qemu/qemu-options.h b/include/qemu/qemu-options.h deleted file mode 100644 index 4a62c83c45..0000000000 --- a/include/qemu/qemu-options.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * qemu-options.h - * - * Defines needed for command line argument processing. - * - * Copyright (c) 2003-2008 Fabrice Bellard - * Copyright (c) 2010 Jes Sorensen - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ - -#ifndef QEMU_OPTIONS_H -#define QEMU_OPTIONS_H - -enum { - -#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ - opt_enum, -#define DEFHEADING(text) -#define ARCHHEADING(text, arch_mask) - -#include "qemu-options.def" -}; - -#endif diff --git a/softmmu/vl.c b/softmmu/vl.c index 0a74810ca3..78b6570f19 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -91,7 +91,6 @@ #include "qapi/qobject-input-visitor.h" #include "qemu/option.h" #include "qemu/config-file.h" -#include "qemu/qemu-options.h" #include "qemu/main-loop.h" #ifdef CONFIG_VIRTFS #include "fsdev/qemu-fsdev.h" @@ -894,6 +893,16 @@ static void help(int exitcode) exit(exitcode); } =20 +enum { + +#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ + opt_enum, +#define DEFHEADING(text) +#define ARCHHEADING(text, arch_mask) + +#include "qemu-options.def" +}; + #define HAS_ARG 0x0001 =20 typedef struct QEMUOption { --=20 2.39.2 From nobody Wed May 15 12:02:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693563247021424.52747887602925; Fri, 1 Sep 2023 03:14:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc19f-0001OJ-NX; Fri, 01 Sep 2023 06:13:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19W-0001LK-83 for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc19T-0001bq-Bt for qemu-devel@nongnu.org; Fri, 01 Sep 2023 06:13:21 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id F35381E735; Fri, 1 Sep 2023 13:13:39 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 461152506D; Fri, 1 Sep 2023 13:13:04 +0300 (MSK) Received: (nullmailer pid 3619008 invoked by uid 1000); Fri, 01 Sep 2023 10:13:02 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Michael Tokarev , Eric Blake Subject: [PATCH 8/8] util/async-teardown.c: move to softmmu/, only build it when system build is requested Date: Fri, 1 Sep 2023 13:13:02 +0300 Message-Id: <20230901101302.3618955-9-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230901101302.3618955-1-mjt@tls.msk.ru> References: <20230901101302.3618955-1-mjt@tls.msk.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1693563248216100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Michael Tokarev Reviewed-by: Eric Blake --- {util =3D> softmmu}/async-teardown.c | 0 softmmu/meson.build | 1 + util/meson.build | 1 - 3 files changed, 1 insertion(+), 1 deletion(-) rename {util =3D> softmmu}/async-teardown.c (100%) diff --git a/util/async-teardown.c b/softmmu/async-teardown.c similarity index 100% rename from util/async-teardown.c rename to softmmu/async-teardown.c diff --git a/softmmu/meson.build b/softmmu/meson.build index ea5603f021..c18b7ad738 100644 --- a/softmmu/meson.build +++ b/softmmu/meson.build @@ -37,3 +37,4 @@ endif =20 system_ss.add(when: seccomp, if_true: files('qemu-seccomp.c')) system_ss.add(when: fdt, if_true: files('device_tree.c')) +system_ss.add(when: 'CONFIG_LINUX', if_true: files('async-teardown.c')) diff --git a/util/meson.build b/util/meson.build index a375160286..c4827fd70a 100644 --- a/util/meson.build +++ b/util/meson.build @@ -3,7 +3,6 @@ util_ss.add(files('thread-context.c'), numa) if not config_host_data.get('CONFIG_ATOMIC64') util_ss.add(files('atomic64.c')) endif -util_ss.add(when: 'CONFIG_LINUX', if_true: files('async-teardown.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('aio-posix.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('fdmon-poll.c')) if config_host_data.get('CONFIG_EPOLL_CREATE1') --=20 2.39.2