From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com,
stefanha@redhat.com, codyprime@gmail.com, sw@weilnetz.de,
pl@kamp.de, qemu-devel@nongnu.org, mreitz@redhat.com,
ronniesahlberg@gmail.com, den@openvz.org, pbonzini@redhat.com
Subject: [PATCH 7/8] qemu-img: convert: don't use unallocated_blocks_are_zero
Date: Wed, 6 May 2020 12:25:12 +0300 [thread overview]
Message-ID: <20200506092513.20904-8-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20200506092513.20904-1-vsementsov@virtuozzo.com>
qemu-img convert wants to distinguish ZERO which comes from short
backing files. unallocated_blocks_are_zero field of bdi is unrelated:
space after EOF is always considered to be zero anyway. So, just make
post_backing_zero true in case of short backing file.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
qemu-img.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 6a4327aaba..4fe751878b 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1632,7 +1632,6 @@ typedef struct ImgConvertState {
BlockBackend *target;
bool has_zero_init;
bool compressed;
- bool unallocated_blocks_are_zero;
bool target_is_new;
bool target_has_backing;
int64_t target_backing_sectors; /* negative if unknown */
@@ -1677,7 +1676,7 @@ static int convert_iteration_sectors(ImgConvertState *s, int64_t sector_num)
if (s->target_backing_sectors >= 0) {
if (sector_num >= s->target_backing_sectors) {
- post_backing_zero = s->unallocated_blocks_are_zero;
+ post_backing_zero = true;
} else if (sector_num + n > s->target_backing_sectors) {
/* Split requests around target_backing_sectors (because
* starting from there, zeros are handled differently) */
@@ -2580,7 +2579,6 @@ static int img_convert(int argc, char **argv)
} else {
s.compressed = s.compressed || bdi.needs_compressed_writes;
s.cluster_sectors = bdi.cluster_size / BDRV_SECTOR_SIZE;
- s.unallocated_blocks_are_zero = bdi.unallocated_blocks_are_zero;
}
ret = convert_do_copy(&s);
--
2.21.0
next prev parent reply other threads:[~2020-05-06 9:32 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 9:25 [PATCH 0/8] drop unallocated_blocks_are_zero Vladimir Sementsov-Ogievskiy
2020-05-06 9:25 ` [PATCH 1/8] block/vdi: return ZERO block-status when appropriate Vladimir Sementsov-Ogievskiy
2020-05-06 13:57 ` Eric Blake
2020-05-06 14:49 ` Vladimir Sementsov-Ogievskiy
2020-05-07 7:22 ` Vladimir Sementsov-Ogievskiy
2020-05-06 9:25 ` [PATCH 2/8] block/vpc: " Vladimir Sementsov-Ogievskiy
2020-05-06 21:18 ` Eric Blake
2020-05-07 7:08 ` Vladimir Sementsov-Ogievskiy
2020-05-06 9:25 ` [PATCH 3/8] block/crypto: drop unallocated_blocks_are_zero Vladimir Sementsov-Ogievskiy
2020-05-06 21:21 ` Eric Blake
2020-05-06 9:25 ` [PATCH 4/8] block/iscsi: " Vladimir Sementsov-Ogievskiy
2020-05-06 21:25 ` Eric Blake
2020-05-06 9:25 ` [PATCH 5/8] block/file-posix: " Vladimir Sementsov-Ogievskiy
2020-05-06 21:41 ` Eric Blake
2020-05-06 9:25 ` [PATCH 6/8] block/vhdx: " Vladimir Sementsov-Ogievskiy
2020-05-06 21:43 ` Eric Blake
2020-05-06 9:25 ` Vladimir Sementsov-Ogievskiy [this message]
2020-05-06 14:49 ` [PATCH 7/8] qemu-img: convert: don't use unallocated_blocks_are_zero Eric Blake
2020-05-06 14:58 ` Vladimir Sementsov-Ogievskiy
2020-05-06 9:25 ` [PATCH 8/8] block: drop unallocated_blocks_are_zero Vladimir Sementsov-Ogievskiy
2020-05-06 15:14 ` Eric Blake
2020-05-06 15:30 ` Vladimir Sementsov-Ogievskiy
2020-05-07 7:05 ` Vladimir Sementsov-Ogievskiy
2020-05-07 8:24 ` Vladimir Sementsov-Ogievskiy
2020-05-07 8:35 ` Vladimir Sementsov-Ogievskiy
2020-05-06 15:50 ` Eric Blake
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=20200506092513.20904-8-vsementsov@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=codyprime@gmail.com \
--cc=den@openvz.org \
--cc=fam@euphon.net \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=ronniesahlberg@gmail.com \
--cc=stefanha@redhat.com \
--cc=sw@weilnetz.de \
/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).