From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, den@openvz.org, vsementsov@virtuozzo.com,
qemu-devel@nongnu.org, mreitz@redhat.com
Subject: [Qemu-devel] [PATCH 1/2] block/raw-format: switch to BDRV_BLOCK_DATA with BDRV_BLOCK_RECURSE
Date: Mon, 12 Aug 2019 21:11:45 +0300 [thread overview]
Message-ID: <20190812181146.26121-2-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20190812181146.26121-1-vsementsov@virtuozzo.com>
BDRV_BLOCK_RAW makes generic bdrv_co_block_status to fallthrough to
returned file. But is it correct behavior at all? If returned file
itself has a backing file, we may report as totally unallocated and
area which actually has data in bottom backing file.
So, mirroring of qcow2 under raw-format is broken. Which is illustrated
by following commit with a test. Let's make raw-format behave more
correctly returning BDRV_BLOCK_DATA.
Suggested-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block/raw-format.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/raw-format.c b/block/raw-format.c
index bffd424dd0..a273ee2387 100644
--- a/block/raw-format.c
+++ b/block/raw-format.c
@@ -275,7 +275,7 @@ static int coroutine_fn raw_co_block_status(BlockDriverState *bs,
*pnum = bytes;
*file = bs->file->bs;
*map = offset + s->offset;
- return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID;
+ return BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_RECURSE;
}
static int coroutine_fn raw_co_pwrite_zeroes(BlockDriverState *bs,
--
2.18.0
next prev parent reply other threads:[~2019-08-12 18:13 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-12 18:11 [Qemu-devel] [PATCH 0/2] deal with BDRV_BLOCK_RAW Vladimir Sementsov-Ogievskiy
2019-08-12 18:11 ` Vladimir Sementsov-Ogievskiy [this message]
2019-08-13 11:04 ` [Qemu-devel] [PATCH 1/2] block/raw-format: switch to BDRV_BLOCK_DATA with BDRV_BLOCK_RECURSE Kevin Wolf
2019-08-13 11:28 ` Vladimir Sementsov-Ogievskiy
2019-08-13 12:01 ` Kevin Wolf
2019-08-13 13:21 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2019-08-13 14:46 ` Max Reitz
2019-08-13 14:43 ` [Qemu-devel] " Max Reitz
2019-08-13 14:56 ` Vladimir Sementsov-Ogievskiy
2019-08-13 15:03 ` Max Reitz
2019-08-13 15:22 ` Vladimir Sementsov-Ogievskiy
2019-08-13 16:07 ` Max Reitz
2019-08-13 15:41 ` Kevin Wolf
2019-08-13 15:54 ` Vladimir Sementsov-Ogievskiy
2019-08-13 16:08 ` Kevin Wolf
2019-08-13 16:32 ` Vladimir Sementsov-Ogievskiy
2019-08-14 6:27 ` Vladimir Sementsov-Ogievskiy
2019-08-13 16:21 ` Max Reitz
2019-08-12 18:11 ` [Qemu-devel] [PATCH 2/2] iotests: test mirroring qcow2 under raw format Vladimir Sementsov-Ogievskiy
2019-08-13 9:10 ` Kevin Wolf
2019-08-13 9:22 ` Vladimir Sementsov-Ogievskiy
2019-08-13 9:36 ` Kevin Wolf
2019-08-12 19:46 ` [Qemu-devel] [PATCH 0/2] deal with BDRV_BLOCK_RAW Max Reitz
2019-08-12 19:50 ` Max Reitz
2019-08-13 8:39 ` Vladimir Sementsov-Ogievskiy
2019-08-13 9:01 ` Vladimir Sementsov-Ogievskiy
2019-08-13 9:33 ` Vladimir Sementsov-Ogievskiy
2019-08-13 11:14 ` Vladimir Sementsov-Ogievskiy
2019-08-13 11:51 ` Kevin Wolf
2019-08-13 13:00 ` Vladimir Sementsov-Ogievskiy
2019-08-13 14:31 ` Max Reitz
2019-08-13 14:46 ` Vladimir Sementsov-Ogievskiy
2019-08-13 14:53 ` Max Reitz
2019-08-13 15:03 ` Kevin Wolf
2019-08-13 15:04 ` Max Reitz
2019-08-13 14:50 ` Eric Blake
2019-08-13 9:34 ` Kevin Wolf
2019-08-13 14:38 ` Max Reitz
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=20190812181146.26121-2-vsementsov@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=den@openvz.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.