KVM: Portability: move vpic and vioapic to kvm_arch
This patches moves two fields vpid and vioapic to kvm_arch
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Acked-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index c0e95fb..b37c0093 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -1386,12 +1386,12 @@
}
case KVM_CREATE_IRQCHIP:
r = -ENOMEM;
- kvm->vpic = kvm_create_pic(kvm);
- if (kvm->vpic) {
+ kvm->arch.vpic = kvm_create_pic(kvm);
+ if (kvm->arch.vpic) {
r = kvm_ioapic_init(kvm);
if (r) {
- kfree(kvm->vpic);
- kvm->vpic = NULL;
+ kfree(kvm->arch.vpic);
+ kvm->arch.vpic = NULL;
goto out;
}
} else
@@ -1409,7 +1409,7 @@
kvm_pic_set_irq(pic_irqchip(kvm),
irq_event.irq,
irq_event.level);
- kvm_ioapic_set_irq(kvm->vioapic,
+ kvm_ioapic_set_irq(kvm->arch.vioapic,
irq_event.irq,
irq_event.level);
mutex_unlock(&kvm->lock);
@@ -3084,8 +3084,8 @@
void kvm_arch_destroy_vm(struct kvm *kvm)
{
- kfree(kvm->vpic);
- kfree(kvm->vioapic);
+ kfree(kvm->arch.vpic);
+ kfree(kvm->arch.vioapic);
kvm_free_vcpus(kvm);
kvm_free_physmem(kvm);
kfree(kvm);