virtio_ring: split: introduce virtqueue_resize_split()
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>
Mon, 1 Aug 2022 06:38:36 +0000 (14:38 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 11 Aug 2022 08:06:39 +0000 (04:06 -0400)
commit6fea20e5611fc5c8264f04a878a98c06b6209eed
tree755fbd0c07bc95e2349ec6724ef856bc8351726c
parentaf36b16f6c1e51975a3815eb21c21c47f3114393
virtio_ring: split: introduce virtqueue_resize_split()

virtio ring split supports resize.

Only after the new vring is successfully allocated based on the new num,
we will release the old vring. In any case, an error is returned,
indicating that the vring still points to the old vring.

In the case of an error, re-initialize(virtqueue_reinit_split()) the
virtqueue to ensure that the vring can be used.

Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20220801063902.129329-17-xuanzhuo@linux.alibaba.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_ring.c