diff mbox

[uq/master,1/2] kvm: detect errors from kvm_arch_process_async_events

Message ID 1362811730-6716-2-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini March 9, 2013, 6:48 a.m. UTC
The next patch will call a ioctl from kvm_arch_process_async_events.
Trap errors and abort the program if one comes.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 kvm-all.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/kvm-all.c b/kvm-all.c
index 4decfdc..bc1534c 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1536,7 +1536,13 @@  int kvm_cpu_exec(CPUArchState *env)
 
     DPRINTF("kvm_cpu_exec()\n");
 
-    if (kvm_arch_process_async_events(cpu)) {
+    ret = kvm_arch_process_async_events(cpu);
+    if (ret) {
+        if (ret < 0) {
+            fprintf(stderr, "error: kvm process events failed %s\n",
+                    strerror(-ret));
+            abort();
+        }
         cpu->exit_request = 0;
         return EXCP_HLT;
     }