diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2025-07-07 14:14:12 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2025-07-15 10:22:33 +0400 |
commit | df892b3954e5b2782165e6c59e5ffd55c2f7ec5a (patch) | |
tree | 8b6aebc1d28d5c741c2d550c27fbb6ca54ef2f4c | |
parent | 0ba45b79452b7f1fb7d45a1a555cbd88ccedb228 (diff) | |
download | qemu-df892b3954e5b2782165e6c59e5ffd55c2f7ec5a.zip qemu-df892b3954e5b2782165e6c59e5ffd55c2f7ec5a.tar.gz qemu-df892b3954e5b2782165e6c59e5ffd55c2f7ec5a.tar.bz2 |
tpm: "qemu -tpmdev help" should return success
Like other "-foo help" CLI, the qemu process should return 0 for
"-tpmdev help".
While touching this, switch to is_help_option() utility function as
suggested by Peter Maydell.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250707101412.2055581-1-marcandre.lureau@redhat.com>
-rw-r--r-- | system/tpm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/system/tpm.c b/system/tpm.c index 8df0f6e..903b29c 100644 --- a/system/tpm.c +++ b/system/tpm.c @@ -21,6 +21,7 @@ #include "system/tpm.h" #include "qemu/config-file.h" #include "qemu/error-report.h" +#include "qemu/help_option.h" static QLIST_HEAD(, TPMBackend) tpm_backends = QLIST_HEAD_INITIALIZER(tpm_backends); @@ -179,9 +180,9 @@ int tpm_config_parse(QemuOptsList *opts_list, const char *optstr) { QemuOpts *opts; - if (!strcmp(optstr, "help")) { + if (is_help_option(optstr)) { tpm_display_backend_drivers(); - return -1; + exit(EXIT_SUCCESS); } opts = qemu_opts_parse_noisily(opts_list, optstr, true); if (!opts) { |