Skip to content

Commit

Permalink
s390x/kvm: always ignore empty vcpu interrupt state
Browse files Browse the repository at this point in the history
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: 3cda44f ("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>
  • Loading branch information
Sascha Silbe authored and borntraeger committed Jun 3, 2015
1 parent 2a72ea5 commit b853d4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions target-s390x/kvm.c
Expand Up @@ -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;

Expand Down

0 comments on commit b853d4c

Please sign in to comment.