Patchwork kvm: Print something before calling abort() if KVM_RUN fails

login
register
mail settings
Submitter Michael Ellerman
Date Dec. 16, 2011, 12:20 a.m.
Message ID <1323994820-22750-1-git-send-email-michael@ellerman.id.au>
Download mbox | patch
Permalink /patch/131766/
State New
Headers show

Comments

Michael Ellerman - Dec. 16, 2011, 12:20 a.m.
It's a little unfriendly to call abort() without printing any sort of
error message. So turn the DPRINTK() into an fprintf(stderr, ...).

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 kvm-all.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Stefan Hajnoczi - Dec. 16, 2011, 10:46 a.m.
On Fri, Dec 16, 2011 at 11:20:20AM +1100, Michael Ellerman wrote:
> It's a little unfriendly to call abort() without printing any sort of
> error message. So turn the DPRINTK() into an fprintf(stderr, ...).
> 
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
>  kvm-all.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

Thanks, applied to the trivial patches tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

Stefan

Patch

diff --git a/kvm-all.c b/kvm-all.c
index 4c466d6..ac048bc 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -977,7 +977,8 @@  int kvm_cpu_exec(CPUState *env)
                 ret = EXCP_INTERRUPT;
                 break;
             }
-            DPRINTF("kvm run failed %s\n", strerror(-run_ret));
+            fprintf(stderr, "error: kvm run failed %s\n",
+                    strerror(-run_ret));
             abort();
         }