vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration
commitecebe53fe99379243695e817450124d69e061e39
authorShenming Lu <lushenming@huawei.com>
Wed, 10 Mar 2021 03:02:33 +0000 (10 11:02 +0800)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 16 Mar 2021 16:06:44 +0000 (16 10:06 -0600)
tree69bd3b2883ba79b52d115b2def362c31eeef7955
parent8ce1ff990eff6affbdd0492fe4fc95e113235e35
vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration

In VFIO migration resume phase and some guest startups, there are
already unmasked vectors in the vector table when calling
vfio_msix_enable(). So in order to avoid inefficiently disabling
and enabling vectors repeatedly, let's allocate all needed vectors
first and then enable these unmasked vectors one by one without
disabling.

Signed-off-by: Shenming Lu <lushenming@huawei.com>
Message-Id: <20210310030233.1133-4-lushenming@huawei.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/pci.c