qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>,
	Thomas Huth <thuth@redhat.com>
Subject: [Qemu-devel] [PATCH v5 00/10] virtio-blk: add DISCARD and WRITE_ZEROES features
Date: Mon, 18 Feb 2019 15:02:51 +0100	[thread overview]
Message-ID: <20190218140301.197408-1-sgarzare@redhat.com> (raw)

This series adds the support of DISCARD and WRITE_ZEROES commands
and extends the virtio-blk-test to test these new commands.

v5:
- rebased on master
- handled the config size for DISCARD and WRITE_ZEROES features as in
  virtio-net (patches 4 and 5) [Michael, Stefan]
- fixed an endianness issues on the WRITE_ZEROES test (patches 8 and 9)
- added a test for DISCARD command to only test the status returned by the
  request (patch 10)
- others patches are unchanged (patches 1, 2, 3, 6, 7)

v4:
- fixed error with mingw compiler in patch 4
  gcc and clang want %lu, but mingw wants %llu for BDRV_REQUEST_MAX_SECTORS.
  Since is less than INT_MAX, I casted it to integer and I used %d in the
  format string of error_setg. (mingw now is happy)

v3:
- rebased on master (I removed Based-on tag since the new virtio headers from
  linux v5.0-rc1 are merged)
- added patch 2 to add host_features field (as in virtio-net) [Michael]
- fixed patch 3 (previously 2/5) using the new host_features field
- fixed patch 4 (previously 3/5) following the Stefan's comments:
                - fixed name of functions and fields
                - used vdev and s pointers
                - removed "wz-may-unmap" property
                - split "dwz-max-sectors" in two properties

v2:
- added patch 1 to use virtio_blk_handle_rw_error() with discard operation
- added patch 2 to make those new features machine-type dependent (thanks David)
- fixed patch 3 (previously patch 1/2) adding more checks, block_acct_start()
                for WRITE_ZEROES requests, and configurable parameters to
                initialize the limits (max_sectors, wzeroes_may_unmap).
                (thanks Stefan)
                I moved in a new function the code to handle a single segment,
                in order to simplify the support of multiple segments in the
                future.
- added patch 4 to change the assert on data_size following the discussion with
                Thomas, Changpeng, Michael, and Stefan (thanks all)
- fixed patch 5 (previously patch 2/2) using local dwz_hdr variable instead of
                dynamic allocation (thanks Thomas)

Thanks,
Stefano

Stefano Garzarella (10):
  virtio-blk: add acct_failed param to virtio_blk_handle_rw_error()
  virtio-blk: add host_features field in VirtIOBlock
  virtio-blk: add "discard" and "write-zeroes" properties
  virtio-net: make VirtIOFeature usable for other virtio devices
  virtio-blk: set config size depending on the features enabled
  virtio-blk: add DISCARD and WRITE_ZEROES features
  tests/virtio-blk: change assert on data_size in virtio_blk_request()
  tests/virtio-blk: add virtio_blk_fix_dwz_hdr() function
  tests/virtio-blk: add test for WRITE_ZEROES command
  tests/virtio-blk: add test for DISCARD command

 hw/block/virtio-blk.c          | 245 ++++++++++++++++++++++++++++++---
 hw/core/machine.c              |   2 +
 hw/net/virtio-net.c            |  31 +----
 hw/virtio/virtio.c             |  15 ++
 include/hw/virtio/virtio-blk.h |   6 +-
 include/hw/virtio/virtio.h     |  15 ++
 tests/virtio-blk-test.c        | 127 ++++++++++++++++-
 7 files changed, 391 insertions(+), 50 deletions(-)

-- 
2.20.1

             reply	other threads:[~2019-02-18 14:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-18 14:02 Stefano Garzarella [this message]
2019-02-18 14:02 ` [Qemu-devel] [PATCH v5 01/10] virtio-blk: add acct_failed param to virtio_blk_handle_rw_error() Stefano Garzarella
2019-02-18 14:02 ` [Qemu-devel] [PATCH v5 02/10] virtio-blk: add host_features field in VirtIOBlock Stefano Garzarella
2019-02-18 14:02 ` [Qemu-devel] [PATCH v5 03/10] virtio-blk: add "discard" and "write-zeroes" properties Stefano Garzarella
2019-02-18 14:02 ` [Qemu-devel] [PATCH v5 04/10] virtio-net: make VirtIOFeature usable for other virtio devices Stefano Garzarella
2019-02-20 16:00   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2019-02-18 14:02 ` [Qemu-devel] [PATCH v5 05/10] virtio-blk: set config size depending on the features enabled Stefano Garzarella
2019-02-20 16:02   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2019-02-18 14:02 ` [Qemu-devel] [PATCH v5 06/10] virtio-blk: add DISCARD and WRITE_ZEROES features Stefano Garzarella
2019-02-18 14:02 ` [Qemu-devel] [PATCH v5 07/10] tests/virtio-blk: change assert on data_size in virtio_blk_request() Stefano Garzarella
2019-02-18 14:02 ` [Qemu-devel] [PATCH v5 08/10] tests/virtio-blk: add virtio_blk_fix_dwz_hdr() function Stefano Garzarella
2019-02-20 16:11   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2019-02-18 14:03 ` [Qemu-devel] [PATCH v5 09/10] tests/virtio-blk: add test for WRITE_ZEROES command Stefano Garzarella
2019-02-18 14:03 ` [Qemu-devel] [PATCH v5 10/10] tests/virtio-blk: add test for DISCARD command Stefano Garzarella
2019-02-20 16:11   ` Stefan Hajnoczi
2019-02-18 15:05 ` [Qemu-devel] [PATCH v5 00/10] virtio-blk: add DISCARD and WRITE_ZEROES features no-reply
2019-02-20 16:30 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2019-02-20 21:05   ` Stefano Garzarella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190218140301.197408-1-sgarzare@redhat.com \
    --to=sgarzare@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).