]> git.proxmox.com Git - mirror_qemu.git/commit
vhost: avoid to start/stop virtqueue which is not ready
authorJia He <hejianet@gmail.com>
Wed, 28 Feb 2018 09:35:28 +0000 (01:35 -0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 1 Mar 2018 16:17:47 +0000 (18:17 +0200)
commitfb20fbb764aa1eb3014c7544ea3daa58bc7b4cd2
treedce978afd94e39730956d44a495fedef232e16db
parent9e2a2a3e083fec1e8059b331e3998c0849d779c1
vhost: avoid to start/stop virtqueue which is not ready

In our Armv8a server, we try to configure the vhost scsi but fail
to boot up the guest (-machine virt-2.10). The guest's boot failure
is very early, even earlier than grub.

There are 3 virtqueues (ctrl, event and cmd) for virtio scsi device,
but ovmf and seabios will only set the physical address for the 3rd
one (cmd). Then in vhost_virtqueue_start(), virtio_queue_get_desc_addr
will be 0 for ctrl and event vq when qemu negotiates with ovmf. So
vhost_memory_map fails with ENOMEM.

This patch just fixs it by early quitting the virtqueue start/stop
when virtio_queue_get_desc_addr is 0.

Btw, after guest kernel starts, all the 3 queues will be initialized
and set address correctly.

Already tested on Arm64 and X86_64 qemu.

Signed-off-by: Jia He <jia.he@hxt-semitech.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/vhost.c