virtio-pci: fix queue_enable write
commit10d35e581901c09ee3817ac7cddd296d05291a9d
authorJason Wang <jasowang@redhat.com>
Wed, 10 Jun 2020 05:43:51 +0000 (10 13:43 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 12 Jun 2020 14:17:06 +0000 (12 10:17 -0400)
tree932e18385ea035b978b33709f1023e9604255ff5
parent12fcf49c1a016cc05638b965f4e7b909794bffa2
virtio-pci: fix queue_enable write

Spec said: The driver uses this to selectively prevent the device from
executing requests from this virtqueue. 1 - enabled; 0 - disabled.

Though write 0 to queue_enable is forbidden by the spec, we should not
assume that the value is 1.

Fix this by ignore the write value other than 1.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20200610054351.15811-1-jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio-pci.c