From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PULL 3/8] block: remove qcow2 .bdrv_make_empty implementation
Date: Fri, 31 Jan 2014 22:19:44 +0100 [thread overview]
Message-ID: <1391203189-6552-4-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1391203189-6552-1-git-send-email-stefanha@redhat.com>
From: Jeff Cody <jcody@redhat.com>
The QCOW2 .bdrv_make_empty implementation always returns 0 for success,
but does not actually do anything.
The proper way to not support an optional driver function stub is to
just not implement it, so let's remove the stub.
Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/qcow2.c | 21 ---------------------
1 file changed, 21 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 2da62b8..99a1ad1 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1689,26 +1689,6 @@ static int qcow2_create(const char *filename, QEMUOptionParameter *options,
return ret;
}
-static int qcow2_make_empty(BlockDriverState *bs)
-{
-#if 0
- /* XXX: not correct */
- BDRVQcowState *s = bs->opaque;
- uint32_t l1_length = s->l1_size * sizeof(uint64_t);
- int ret;
-
- memset(s->l1_table, 0, l1_length);
- if (bdrv_pwrite(bs->file, s->l1_table_offset, s->l1_table, l1_length) < 0)
- return -1;
- ret = bdrv_truncate(bs->file, s->l1_table_offset + l1_length);
- if (ret < 0)
- return ret;
-
- l2_cache_reset(bs);
-#endif
- return 0;
-}
-
static coroutine_fn int qcow2_co_write_zeroes(BlockDriverState *bs,
int64_t sector_num, int nb_sectors, BdrvRequestFlags flags)
{
@@ -2252,7 +2232,6 @@ static BlockDriver bdrv_qcow2 = {
.bdrv_has_zero_init = bdrv_has_zero_init_1,
.bdrv_co_get_block_status = qcow2_co_get_block_status,
.bdrv_set_key = qcow2_set_key,
- .bdrv_make_empty = qcow2_make_empty,
.bdrv_co_readv = qcow2_co_readv,
.bdrv_co_writev = qcow2_co_writev,
--
1.8.5.3
next prev parent reply other threads:[~2014-01-31 21:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 21:19 [Qemu-devel] [PULL 0/8] Block patches Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 1/8] Describe flaws in qcow/qcow2 encryption in the docs Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 2/8] block: remove QED .bdrv_make_empty implementation Stefan Hajnoczi
2014-01-31 21:19 ` Stefan Hajnoczi [this message]
2014-01-31 21:19 ` [Qemu-devel] [PULL 4/8] block/vmdk: add basic .bdrv_check support Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 5/8] qemu-iotests: Drop assert_no_active_commit in case 040 Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 6/8] block/vhdx: Error checking fixes Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 7/8] dataplane: Comment fix Stefan Hajnoczi
2014-01-31 21:19 ` [Qemu-devel] [PULL 8/8] qemu-iotests: only run 071 on qcow2 Stefan Hajnoczi
2014-02-05 16:38 ` [Qemu-devel] [PULL 0/8] Block patches Peter Maydell
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=1391203189-6552-4-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=aliguori@amazon.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).