vhost_vdpa: unset vq irq before freeing irq

Currently we unset vq irq after freeing irq and that will result in
error messages:

pi_update_irte: failed to update PI IRTE
irq bypass consumer (token 000000005a07a12b) unregistration fails: -22

This patch solves this.

Signed-off-by: Wu Zongyong <wuzongyong@linux.alibaba.com>
Link: https://lore.kernel.org/r/02637d38dcf4e4b836c5b3a65055fe92bf812b3b.1631687872.git.wuzongyong@linux.alibaba.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>

authored by Wu Zongyong and committed by Michael S. Tsirkin 97f854be 2f9a174f

+4 -4
+4 -4
drivers/vhost/vdpa.c
··· 173 if (status != 0 && (ops->get_status(vdpa) & ~status) != 0) 174 return -EINVAL; 175 176 if (status == 0) { 177 ret = ops->reset(vdpa); 178 if (ret) ··· 187 if ((status & VIRTIO_CONFIG_S_DRIVER_OK) && !(status_old & VIRTIO_CONFIG_S_DRIVER_OK)) 188 for (i = 0; i < nvqs; i++) 189 vhost_vdpa_setup_vq_irq(v, i); 190 - 191 - if ((status_old & VIRTIO_CONFIG_S_DRIVER_OK) && !(status & VIRTIO_CONFIG_S_DRIVER_OK)) 192 - for (i = 0; i < nvqs; i++) 193 - vhost_vdpa_unsetup_vq_irq(v, i); 194 195 return 0; 196 }
··· 173 if (status != 0 && (ops->get_status(vdpa) & ~status) != 0) 174 return -EINVAL; 175 176 + if ((status_old & VIRTIO_CONFIG_S_DRIVER_OK) && !(status & VIRTIO_CONFIG_S_DRIVER_OK)) 177 + for (i = 0; i < nvqs; i++) 178 + vhost_vdpa_unsetup_vq_irq(v, i); 179 + 180 if (status == 0) { 181 ret = ops->reset(vdpa); 182 if (ret) ··· 183 if ((status & VIRTIO_CONFIG_S_DRIVER_OK) && !(status_old & VIRTIO_CONFIG_S_DRIVER_OK)) 184 for (i = 0; i < nvqs; i++) 185 vhost_vdpa_setup_vq_irq(v, i); 186 187 return 0; 188 }