diff options
author | Mario Smarduch <msmarduch@digitalocean.com> | 2020-06-26 13:19:00 -0700 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-07-10 18:02:15 -0400 |
commit | 2880ffb08995238714b175db703c13fac4725cc1 (patch) | |
tree | 83e75943621705232ee22fa10b861d0d083f9d9b /softmmu | |
parent | 3bcb5840f1b3ef9970da963bf94f637b665387ef (diff) |
util/qemu-error: prepend guest name to error message to identify affected VM owner
This is followup patch to the one submitted back in Oct, 19
https://lists.gnu.org/archive/html/qemu-devel/2019-10/msg02102.html
My mistake here, I took my eyes of the mailing list after I got the
initial thumbs up. This patch follows up on Markus comments in the
above link.
Purpose of this patch:
We want to print guest name for errors, warnings and info messages. This
was the first of two patches the second being MCE errors targeting a VM
with guest name prepended. But in a large fleet we see many other
errors that disable a VM or crash it. In a large fleet and centralized
logging having the guest name enables identify of owner and customer.
Signed-off-by: Mario Smarduch <msmarduch@digitalocean.com>
Message-Id: <20200626201900.8876-1-msmarduch@digitalocean.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r-- | softmmu/vl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c index 96417a7c3a..a7a2e9e44a 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -389,6 +389,12 @@ static QemuOptsList qemu_msg_opts = { .name = "timestamp", .type = QEMU_OPT_BOOL, }, + { + .name = "guest-name", + .type = QEMU_OPT_BOOL, + .help = "Prepends guest name for error messages but only if " + "-name guest is set otherwise option is ignored\n", + }, { /* end of list */ } }, }; @@ -1114,6 +1120,7 @@ static void realtime_init(void) static void configure_msg(QemuOpts *opts) { error_with_timestamp = qemu_opt_get_bool(opts, "timestamp", false); + error_with_guestname = qemu_opt_get_bool(opts, "guest-name", false); } @@ -3592,6 +3599,8 @@ void qemu_init(int argc, char **argv, char **envp) if (!opts) { exit(1); } + /* Capture guest name if -msg guest-name is used later */ + error_guest_name = qemu_opt_get(opts, "guest"); break; case QEMU_OPTION_prom_env: if (nb_prom_envs >= MAX_PROM_ENVS) { |