vhost: set the correct queue index in case of migration with multiqueue
commit25a2a920dddcf72896d94b37b6048a8147bc3198
authorThibaut Collet <thibaut.collet@6wind.com>
Mon, 19 Oct 2015 12:59:27 +0000 (19 14:59 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 22 Oct 2015 11:34:50 +0000 (22 14:34 +0300)
treedf17c3e9b309fcb257410ce745cbc474d020d4d7
parente3fce97cf500c61f23df8e0245e08625fc375295
vhost: set the correct queue index in case of migration with multiqueue

When a live migration is started the log address to mark dirty pages is provided
to the vhost backend through the vhost_dev_set_log function.
This function is called for each queue pairs but the queue index is wrongly set:
always set to the first queue pair. Then vhost backend lost descriptor addresses
of the queue pairs greater than 1 and behaviour of the vhost backend is
unpredictable.

The queue index is computed by taking account of the vq_index (to retrieve the
queue pair index) and calling the vhost_get_vq_index method of the backend.

Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
Cc: qemu-stable@nongnu.org
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/vhost.c