From: Michael Tokarev <mjt@tls.msk.ru>
To: qemu-devel@nongnu.org
Cc: Michael Tokarev <mjt@tls.msk.ru>
Subject: [PATCH RFC 0/7] move softmmu options processing from os-posix.c to vl.c
Date: Sat, 12 Aug 2023 15:47:54 +0300 [thread overview]
Message-ID: <cover.1691843673.git.mjt@tls.msk.ru> (raw)
qemu_init() calls os_parse_cmd_args(), which is obviously a very vl.c-specicic
piece of code. It looks like when moving vl.c to softmmu/, os-posix.c should've
been moved too (together with os-win32.c). But there are other functions in
os-posix.c which are used by other parts of the code, eg qemu-nbd or
qemu-storage-daemon both uses parts from there. The result is rather ugly.
One of the side-effects is that even if system build is disabled, we still
have to compile util/async-teardown.c, since it is used in os-posix.c, - and
this one can not be built on ia64 due to lack of clone syscall. But qemu-nbd
does not need async-teardown, which is also very softmmu-specific.
This patchset tries to address these defects. It moves the "bottom half" of
vl.c options processing back into vl.c, effectively undoing commit 59a5264b99434
from 2010. We do not have many os-specific options, and this move makes
qemu_init() the only function which processes options, all in the single
place, which is, in my opinion, easier to manage.
Before this move, lower-level constructs (chroot, runas) are being exported.
In the end, we have almost no softmmu-related things in os-posix.c, and the
same functionality can be actually used in qemu-storage-daemon or qemu-nbd.
For qemu-nbd, it is now possible to switch to using -runas/-chroot/etc the
same way as qemu-storage-daemon does, instead of having one more abstraction
named qemu_daemon().
Michael Tokarev (7):
include/sysemu/os-posix.h: move *daemonize* declaration together
os-posix: create and export os_set_runas()
os-posix.c: create and export os_set_chroot()
os-posix.c, softmmu/vl.c: move os_parse_cmd_args() into qemu_init()
softmmu/vl.c: inline include/qemu/qemu-options.h into vl.c
os-posix.c: move code around
util/async-teardown.c: move to softmmu/, only build it when system
build is requested
include/qemu/qemu-options.h | 41 --------
include/sysemu/os-posix.h | 8 +-
include/sysemu/os-win32.h | 1 -
os-posix.c | 152 +++++++++--------------------
{util => softmmu}/async-teardown.c | 0
softmmu/meson.build | 1 +
softmmu/vl.c | 87 ++++++++++++++++-
util/meson.build | 1 -
8 files changed, 134 insertions(+), 157 deletions(-)
delete mode 100644 include/qemu/qemu-options.h
rename {util => softmmu}/async-teardown.c (100%)
--
2.39.2
next reply other threads:[~2023-08-12 12:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-12 12:47 Michael Tokarev [this message]
2023-08-12 12:47 ` [PATCH RFC 1/7] include/sysemu/os-posix.h: move *daemonize* declaration together Michael Tokarev
2023-08-15 16:22 ` Eric Blake
2023-09-01 10:10 ` Michael Tokarev
2023-08-12 12:47 ` [PATCH RFC 2/7] os-posix: create and export os_set_runas() Michael Tokarev
2023-08-15 16:25 ` Eric Blake
2023-08-12 12:47 ` [PATCH RFC 3/7] os-posix.c: create and export os_set_chroot() Michael Tokarev
2023-08-15 16:26 ` Eric Blake
2023-08-12 12:47 ` [PATCH RFC 4/7] os-posix.c, softmmu/vl.c: move os_parse_cmd_args() into qemu_init() Michael Tokarev
2023-08-15 17:03 ` Eric Blake
2023-08-12 12:47 ` [PATCH RFC 5/7] softmmu/vl.c: inline include/qemu/qemu-options.h into vl.c Michael Tokarev
2023-08-15 18:23 ` Eric Blake
2023-08-12 12:48 ` [PATCH RFC 6/7] os-posix.c: move code around Michael Tokarev
2023-08-15 18:25 ` Eric Blake
2023-08-12 12:48 ` [PATCH RFC 7/7] util/async-teardown.c: move to softmmu/, only build it when system build is requested Michael Tokarev
2023-08-15 18:25 ` Eric Blake
2023-09-01 12:56 ` [PATCH RFC 0/7] move softmmu options processing from os-posix.c to vl.c Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1691843673.git.mjt@tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).