diff options
author | Sascha Silbe <silbe@linux.vnet.ibm.com> | 2015-06-02 18:51:00 +0200 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-06-03 18:07:09 +0200 |
commit | b853d4cbf2062813e84f9bb880feff8daf467e05 (patch) | |
tree | 8c9d15f0a2204a1f214039f9f3f1ac9269563cad /target-s390x/kvm.c | |
parent | 2a72ea5f66b3b87a975475bdc1cabacbbb402937 (diff) | |
download | qemu-b853d4cbf2062813e84f9bb880feff8daf467e05.zip qemu-b853d4cbf2062813e84f9bb880feff8daf467e05.tar.gz qemu-b853d4cbf2062813e84f9bb880feff8daf467e05.tar.bz2 |
s390x/kvm: always ignore empty vcpu interrupt state
kvm_s390_vcpu_interrupt_pre_save() and
kvm_s390_vcpu_interrupt_post_load() are essentially no-ops on hosts
without KVM_CAP_S390_IRQ_STATE. Move the capability check after the
check for saved IRQ state in kvm_s390_vcpu_interrupt_post_load() so that
migration between hosts without KVM_CAP_S390_IRQ_STATE (including save /
restore on the same host) continues to work.
Fixes: 3cda44f7bae5 ("s390x/kvm: migrate vcpu interrupt state")
Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target-s390x/kvm.c')
-rw-r--r-- | target-s390x/kvm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 6de7759..070f995 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -2175,13 +2175,14 @@ int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu) struct kvm_s390_irq_state irq_state; int r; + if (cpu->irqstate_saved_size == 0) { + return 0; + } + if (!kvm_check_extension(kvm_state, KVM_CAP_S390_IRQ_STATE)) { return -ENOSYS; } - if (cpu->irqstate_saved_size == 0) { - return 0; - } irq_state.buf = (uint64_t) cpu->irqstate; irq_state.len = cpu->irqstate_saved_size; |