|
|
9ae3a8 |
From 6470641f3ae91f9024ac19c9884a583074930c78 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Jeffrey Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
Date: Tue, 11 Feb 2014 16:14:30 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 24/28] block: remove qcow2 .bdrv_make_empty implementation
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Jeffrey Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
Message-id: <342af85f3ded3eeaa140e44b2f4956bd6d1ee45c.1392134912.git.jcody@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 57220
|
|
|
9ae3a8 |
O-Subject: [RHEL7 qemu-kvm PATCH 6/6] block: remove qcow2 .bdrv_make_empty implementation
|
|
|
9ae3a8 |
Bugzilla: 1047254
|
|
|
9ae3a8 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
The QCOW2 .bdrv_make_empty implementation always returns 0 for success,
|
|
|
9ae3a8 |
but does not actually do anything.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
The proper way to not support an optional driver function stub is to
|
|
|
9ae3a8 |
just not implement it, so let's remove the stub.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Jeff Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Benoit Canet <benoit@irqsave.net>
|
|
|
9ae3a8 |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 14b4a8b9c654b625dea0f532fae5722781fd0a7d)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/qcow2.c | 21 ---------------------
|
|
|
9ae3a8 |
1 file changed, 21 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/qcow2.c | 21 ---------------------
|
|
|
9ae3a8 |
1 files changed, 0 insertions(+), 21 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/block/qcow2.c b/block/qcow2.c
|
|
|
9ae3a8 |
index 05ea0cd..25a5b5e 100644
|
|
|
9ae3a8 |
--- a/block/qcow2.c
|
|
|
9ae3a8 |
+++ b/block/qcow2.c
|
|
|
9ae3a8 |
@@ -1678,26 +1678,6 @@ static int qcow2_create(const char *filename, QEMUOptionParameter *options,
|
|
|
9ae3a8 |
return ret;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-static int qcow2_make_empty(BlockDriverState *bs)
|
|
|
9ae3a8 |
-{
|
|
|
9ae3a8 |
-#if 0
|
|
|
9ae3a8 |
- /* XXX: not correct */
|
|
|
9ae3a8 |
- BDRVQcowState *s = bs->opaque;
|
|
|
9ae3a8 |
- uint32_t l1_length = s->l1_size * sizeof(uint64_t);
|
|
|
9ae3a8 |
- int ret;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- memset(s->l1_table, 0, l1_length);
|
|
|
9ae3a8 |
- if (bdrv_pwrite(bs->file, s->l1_table_offset, s->l1_table, l1_length) < 0)
|
|
|
9ae3a8 |
- return -1;
|
|
|
9ae3a8 |
- ret = bdrv_truncate(bs->file, s->l1_table_offset + l1_length);
|
|
|
9ae3a8 |
- if (ret < 0)
|
|
|
9ae3a8 |
- return ret;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- l2_cache_reset(bs);
|
|
|
9ae3a8 |
-#endif
|
|
|
9ae3a8 |
- return 0;
|
|
|
9ae3a8 |
-}
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
static coroutine_fn int qcow2_co_write_zeroes(BlockDriverState *bs,
|
|
|
9ae3a8 |
int64_t sector_num, int nb_sectors, BdrvRequestFlags flags)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
@@ -2246,7 +2226,6 @@ static BlockDriver bdrv_qcow2 = {
|
|
|
9ae3a8 |
.bdrv_has_zero_init = bdrv_has_zero_init_1,
|
|
|
9ae3a8 |
.bdrv_co_get_block_status = qcow2_co_get_block_status,
|
|
|
9ae3a8 |
.bdrv_set_key = qcow2_set_key,
|
|
|
9ae3a8 |
- .bdrv_make_empty = qcow2_make_empty,
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
.bdrv_co_readv = qcow2_co_readv,
|
|
|
9ae3a8 |
.bdrv_co_writev = qcow2_co_writev,
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|