All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, drjones@redhat.com,
	kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH] kvm: print suberror on all internal errors
Date: Tue, 21 Jan 2014 18:20:38 +0100	[thread overview]
Message-ID: <52DEAC66.2030903@redhat.com> (raw)
In-Reply-To: <1390324291-9847-1-git-send-email-rkrcmar@redhat.com>

On 01/21/14 18:11, Radim Krčmář wrote:
> KVM introduced internal error exit reason and suberror at the same time,
> and later extended it with internal error data.
> QEMU does not report suberror on hosts between these two events because
> we check for the extension. (half a year in 2009, but it is misleading)
> 
> Fix by removing KVM_CAP_INTERNAL_ERROR_DATA condition on printf.
> 
> (partially improved by bb44e0d12df70 and ba4047cf848a3 in the past)
> 
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
>  kvm-all.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/kvm-all.c b/kvm-all.c
> index 0bfb060..0a91d8e 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -1539,17 +1539,16 @@ static void kvm_handle_io(uint16_t port, void *data, int direction, int size,
>  
>  static int kvm_handle_internal_error(CPUState *cpu, struct kvm_run *run)
>  {
> -    fprintf(stderr, "KVM internal error.");
> +    fprintf(stderr, "KVM internal error. Suberror: %d\n",
> +            run->internal.suberror);
> +
>      if (kvm_check_extension(kvm_state, KVM_CAP_INTERNAL_ERROR_DATA)) {
>          int i;
>  
> -        fprintf(stderr, " Suberror: %d\n", run->internal.suberror);
>          for (i = 0; i < run->internal.ndata; ++i) {
>              fprintf(stderr, "extra data[%d]: %"PRIx64"\n",
>                      i, (uint64_t)run->internal.data[i]);
>          }
> -    } else {
> -        fprintf(stderr, "\n");
>      }
>      if (run->internal.suberror == KVM_INTERNAL_ERROR_EMULATION) {
>          fprintf(stderr, "emulation failure\n");
> 

Based on earlier discussion

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

WARNING: multiple messages have this Message-ID (diff)
From: Laszlo Ersek <lersek@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: pbonzini@redhat.com, drjones@redhat.com, qemu-devel@nongnu.org,
	kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH] kvm: print suberror on all internal errors
Date: Tue, 21 Jan 2014 18:20:38 +0100	[thread overview]
Message-ID: <52DEAC66.2030903@redhat.com> (raw)
In-Reply-To: <1390324291-9847-1-git-send-email-rkrcmar@redhat.com>

On 01/21/14 18:11, Radim Krčmář wrote:
> KVM introduced internal error exit reason and suberror at the same time,
> and later extended it with internal error data.
> QEMU does not report suberror on hosts between these two events because
> we check for the extension. (half a year in 2009, but it is misleading)
> 
> Fix by removing KVM_CAP_INTERNAL_ERROR_DATA condition on printf.
> 
> (partially improved by bb44e0d12df70 and ba4047cf848a3 in the past)
> 
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
>  kvm-all.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/kvm-all.c b/kvm-all.c
> index 0bfb060..0a91d8e 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -1539,17 +1539,16 @@ static void kvm_handle_io(uint16_t port, void *data, int direction, int size,
>  
>  static int kvm_handle_internal_error(CPUState *cpu, struct kvm_run *run)
>  {
> -    fprintf(stderr, "KVM internal error.");
> +    fprintf(stderr, "KVM internal error. Suberror: %d\n",
> +            run->internal.suberror);
> +
>      if (kvm_check_extension(kvm_state, KVM_CAP_INTERNAL_ERROR_DATA)) {
>          int i;
>  
> -        fprintf(stderr, " Suberror: %d\n", run->internal.suberror);
>          for (i = 0; i < run->internal.ndata; ++i) {
>              fprintf(stderr, "extra data[%d]: %"PRIx64"\n",
>                      i, (uint64_t)run->internal.data[i]);
>          }
> -    } else {
> -        fprintf(stderr, "\n");
>      }
>      if (run->internal.suberror == KVM_INTERNAL_ERROR_EMULATION) {
>          fprintf(stderr, "emulation failure\n");
> 

Based on earlier discussion

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

  reply	other threads:[~2014-01-21 17:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 17:11 [PATCH] kvm: print suberror on all internal errors Radim Krčmář
2014-01-21 17:11 ` [Qemu-devel] " Radim Krčmář
2014-01-21 17:20 ` Laszlo Ersek [this message]
2014-01-21 17:20   ` Laszlo Ersek
2014-01-22 13:03 ` Paolo Bonzini
2014-01-22 13:03   ` [Qemu-devel] " Paolo Bonzini

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=52DEAC66.2030903@redhat.com \
    --to=lersek@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkrcmar@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.