KVM: Wait 'til the bitter end to initialize the "new" memslot
authorSean Christopherson <seanjc@google.com>
Mon, 6 Dec 2021 19:54:34 +0000 (20:54 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Dec 2021 09:24:37 +0000 (04:24 -0500)
commit0f9bdef3d933ba10d577b446c703a901fa5fdc30
treeb0df65fd9dd3c2c94f5519017ff5c5d44c70be2f
parent44401a204734ce837e0b36c8418af4fad6a21f95
KVM: Wait 'til the bitter end to initialize the "new" memslot

Initialize the "new" memslot in the !DELETE path only after the various
sanity checks have passed.  This will allow a future commit to allocate
@new dynamically without having to copy a memslot, and without having to
deal with freeing @new in error paths and in the "nothing to change" path
that's hiding in the sanity checks.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <a084d0531ca3a826a7f861eb2b08b5d1c06ef265.1638817641.git.maciej.szmigiero@oracle.com>
virt/kvm/kvm_main.c