diff mbox

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

Message ID 1323994820-22750-1-git-send-email-michael@ellerman.id.au
State New
Headers show

Commit Message

Michael Ellerman Dec. 16, 2011, 12:20 a.m. UTC
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(-)

Comments

Stefan Hajnoczi Dec. 16, 2011, 10:46 a.m. UTC | #1
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
diff mbox

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();
         }