KVM: Add a special exit reason when exiting due to an interrupt
authorAvi Kivity <avi@qumranet.com>
Sun, 4 Mar 2007 12:24:03 +0000 (14:24 +0200)
committerAvi Kivity <avi@qumranet.com>
Thu, 3 May 2007 07:52:24 +0000 (10:52 +0300)
This is redundant, as we also return -EINTR from the ioctl, but it
allows us to examine the exit_reason field on resume without seeing
old data.

Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/svm.c
drivers/kvm/vmx.c
include/linux/kvm.h

index b09928f..0311665 100644 (file)
@@ -1619,12 +1619,14 @@ again:
                if (signal_pending(current)) {
                        ++kvm_stat.signal_exits;
                        post_kvm_run_save(vcpu, kvm_run);
+                       kvm_run->exit_reason = KVM_EXIT_INTR;
                        return -EINTR;
                }
 
                if (dm_request_for_irq_injection(vcpu, kvm_run)) {
                        ++kvm_stat.request_irq_exits;
                        post_kvm_run_save(vcpu, kvm_run);
+                       kvm_run->exit_reason = KVM_EXIT_INTR;
                        return -EINTR;
                }
                kvm_resched(vcpu);
index cf9568f..e69bab6 100644 (file)
@@ -1941,12 +1941,14 @@ again:
                        if (signal_pending(current)) {
                                ++kvm_stat.signal_exits;
                                post_kvm_run_save(vcpu, kvm_run);
+                               kvm_run->exit_reason = KVM_EXIT_INTR;
                                return -EINTR;
                        }
 
                        if (dm_request_for_irq_injection(vcpu, kvm_run)) {
                                ++kvm_stat.request_irq_exits;
                                post_kvm_run_save(vcpu, kvm_run);
+                               kvm_run->exit_reason = KVM_EXIT_INTR;
                                return -EINTR;
                        }
 
Simple merge