diff options
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r-- | drivers/kvm/kvm_main.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 401e3cdc4607..ffbdadd87971 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -381,6 +381,7 @@ static void kvm_destroy_vm(struct kvm *kvm) | |||
381 | kvm_io_bus_destroy(&kvm->pio_bus); | 381 | kvm_io_bus_destroy(&kvm->pio_bus); |
382 | kvm_io_bus_destroy(&kvm->mmio_bus); | 382 | kvm_io_bus_destroy(&kvm->mmio_bus); |
383 | kfree(kvm->vpic); | 383 | kfree(kvm->vpic); |
384 | kfree(kvm->vioapic); | ||
384 | kvm_free_vcpus(kvm); | 385 | kvm_free_vcpus(kvm); |
385 | kvm_free_physmem(kvm); | 386 | kvm_free_physmem(kvm); |
386 | kfree(kvm); | 387 | kfree(kvm); |
@@ -2771,8 +2772,14 @@ static long kvm_vm_ioctl(struct file *filp, | |||
2771 | case KVM_CREATE_IRQCHIP: | 2772 | case KVM_CREATE_IRQCHIP: |
2772 | r = -ENOMEM; | 2773 | r = -ENOMEM; |
2773 | kvm->vpic = kvm_create_pic(kvm); | 2774 | kvm->vpic = kvm_create_pic(kvm); |
2774 | if (kvm->vpic) | 2775 | if (kvm->vpic) { |
2775 | r = 0; | 2776 | r = kvm_ioapic_init(kvm); |
2777 | if (r) { | ||
2778 | kfree(kvm->vpic); | ||
2779 | kvm->vpic = NULL; | ||
2780 | goto out; | ||
2781 | } | ||
2782 | } | ||
2776 | else | 2783 | else |
2777 | goto out; | 2784 | goto out; |
2778 | break; | 2785 | break; |
@@ -2787,7 +2794,9 @@ static long kvm_vm_ioctl(struct file *filp, | |||
2787 | kvm_pic_set_irq(pic_irqchip(kvm), | 2794 | kvm_pic_set_irq(pic_irqchip(kvm), |
2788 | irq_event.irq, | 2795 | irq_event.irq, |
2789 | irq_event.level); | 2796 | irq_event.level); |
2790 | /* TODO: IOAPIC */ | 2797 | kvm_ioapic_set_irq(kvm->vioapic, |
2798 | irq_event.irq, | ||
2799 | irq_event.level); | ||
2791 | r = 0; | 2800 | r = 0; |
2792 | } | 2801 | } |
2793 | break; | 2802 | break; |