kvm: Allocate memslots and buses before calling kvm_arch_init_vm
authorJim Mattson <jmattson@google.com>
Thu, 24 Oct 2019 23:03:26 +0000 (16:03 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Oct 2019 11:32:33 +0000 (13:32 +0200)
commit9121923c457d1d8667a6e3a67302c29e5c5add6b
tree821962f16d7e52fa2ce92eb0a942390bb614d01e
parent671ddc700fd08b94967b1e2a937020e30c838609
kvm: Allocate memslots and buses before calling kvm_arch_init_vm

This reorganization will allow us to call kvm_arch_destroy_vm in the
event that kvm_create_vm fails after calling kvm_arch_init_vm.

Suggested-by: Junaid Shahid <junaids@google.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Junaid Shahid <junaids@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c