virtio-blk: add DISCARD and WRITE_ZEROES features
commit37b06f8d46fe602e630e4bdce24e80a3e0f70cc2
authorStefano Garzarella <sgarzare@redhat.com>
Thu, 21 Feb 2019 10:33:10 +0000 (21 11:33 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 22 Feb 2019 09:42:17 +0000 (22 09:42 +0000)
treebde57b128fe2c03099fa13772c894593af0d479b
parent20764be0421c3d5d97f84219d55a412f3cd2ca9a
virtio-blk: add DISCARD and WRITE_ZEROES features

This patch adds the support of DISCARD and WRITE_ZEROES commands,
that have been introduced in the virtio-blk protocol to have
better performance when using SSD backend.

We support only one segment per request since multiple segments
are not widely used and there are no userspace APIs that allow
applications to submit multiple segments in a single call.

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-id: 20190221103314.58500-7-sgarzare@redhat.com
Message-Id: <20190221103314.58500-7-sgarzare@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/block/virtio-blk.c
include/hw/virtio/virtio-blk.h