qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, pl@kamp.de, qemu-devel@nongnu.org,
	stefanha@redhat.com, mreitz@redhat.com
Subject: [Qemu-devel] [PATCH v2 1/3] block-backend: Expose bdrv_write_zeroes()
Date: Thu, 19 Mar 2015 13:33:31 +0100	[thread overview]
Message-ID: <1426768413-31079-2-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1426768413-31079-1-git-send-email-kwolf@redhat.com>

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/block-backend.c          | 11 +++++++++++
 include/sysemu/block-backend.h |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/block/block-backend.c b/block/block-backend.c
index 48b6e4c..93e46f3 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -515,6 +515,17 @@ int blk_write(BlockBackend *blk, int64_t sector_num, const uint8_t *buf,
     return bdrv_write(blk->bs, sector_num, buf, nb_sectors);
 }
 
+int blk_write_zeroes(BlockBackend *blk, int64_t sector_num,
+                     int nb_sectors, BdrvRequestFlags flags)
+{
+    int ret = blk_check_request(blk, sector_num, nb_sectors);
+    if (ret < 0) {
+        return ret;
+    }
+
+    return bdrv_write_zeroes(blk->bs, sector_num, nb_sectors, flags);
+}
+
 static void error_callback_bh(void *opaque)
 {
     struct BlockBackendAIOCB *acb = opaque;
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 77e9b9c..b4a4d5e 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -87,6 +87,8 @@ int blk_read_unthrottled(BlockBackend *blk, int64_t sector_num, uint8_t *buf,
                          int nb_sectors);
 int blk_write(BlockBackend *blk, int64_t sector_num, const uint8_t *buf,
               int nb_sectors);
+int blk_write_zeroes(BlockBackend *blk, int64_t sector_num,
+                     int nb_sectors, BdrvRequestFlags flags);
 BlockAIOCB *blk_aio_write_zeroes(BlockBackend *blk, int64_t sector_num,
                                  int nb_sectors, BdrvRequestFlags flags,
                                  BlockCompletionFunc *cb, void *opaque);
-- 
1.8.3.1

  reply	other threads:[~2015-03-19 12:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 12:33 [Qemu-devel] [PATCH v2 0/3] qemu-img convert: Rewrite copying logic Kevin Wolf
2015-03-19 12:33 ` Kevin Wolf [this message]
2015-03-19 13:27   ` [Qemu-devel] [PATCH v2 1/3] block-backend: Expose bdrv_write_zeroes() Max Reitz
2015-03-19 12:33 ` [Qemu-devel] [PATCH v2 2/3] qemu-img convert: Rewrite copying logic Kevin Wolf
2015-03-19 13:53   ` Max Reitz
2015-03-19 12:33 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotests: Some qemu-img convert tests Kevin Wolf
2015-03-19 14:44   ` Max Reitz
2015-03-19 14:44     ` Max Reitz
2015-04-02  9:53 ` [Qemu-devel] [PATCH v2 0/3] qemu-img convert: Rewrite copying logic Kevin Wolf

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=1426768413-31079-2-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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).