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

login
register
mail settings
Submitter Paolo Bonzini
Date March 9, 2013, 6:48 a.m.
Message ID <1362811730-6716-2-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/226309/
State New
Headers show

Comments

Paolo Bonzini - March 9, 2013, 6:48 a.m.
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(-)

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