* [Qemu-devel] [PATCH] kvm: print suberror on all internal errors
@ 2014-01-21 17:11 ` Radim Krčmář
0 siblings, 0 replies; 6+ messages in thread
From: Radim Krčmář @ 2014-01-21 17:11 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, drjones, kvm
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");
--
1.8.5.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [Qemu-devel] [PATCH] kvm: print suberror on all internal errors
2014-01-21 17:11 ` [Qemu-devel] " Radim Krčmář
@ 2014-01-21 17:20 ` Laszlo Ersek
-1 siblings, 0 replies; 6+ messages in thread
From: Laszlo Ersek @ 2014-01-21 17:20 UTC (permalink / raw)
To: Radim Krčmář; +Cc: qemu-devel, pbonzini, drjones, kvm
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>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Qemu-devel] [PATCH] kvm: print suberror on all internal errors
@ 2014-01-21 17:20 ` Laszlo Ersek
0 siblings, 0 replies; 6+ messages in thread
From: Laszlo Ersek @ 2014-01-21 17:20 UTC (permalink / raw)
To: Radim Krčmář; +Cc: pbonzini, drjones, qemu-devel, kvm
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] kvm: print suberror on all internal errors
2014-01-21 17:11 ` [Qemu-devel] " Radim Krčmář
@ 2014-01-22 13:03 ` Paolo Bonzini
-1 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-01-22 13:03 UTC (permalink / raw)
To: Radim Krčmář, qemu-devel; +Cc: kvm, drjones
Il 21/01/2014 18:11, Radim Krčmář ha scritto:
> 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");
>
Applied to uq/master, thanks (please remember uq/master in the subject
line in the future).
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Qemu-devel] [PATCH] kvm: print suberror on all internal errors
@ 2014-01-22 13:03 ` Paolo Bonzini
0 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-01-22 13:03 UTC (permalink / raw)
To: Radim Krčmář, qemu-devel; +Cc: drjones, kvm
Il 21/01/2014 18:11, Radim Krčmář ha scritto:
> 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");
>
Applied to uq/master, thanks (please remember uq/master in the subject
line in the future).
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread