From: Kevin Wolf <kwolf@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: Jeff Cody <jcody@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
Roman Kagan <rkagan@parallels.com>
Subject: Re: [Qemu-devel] [PATCH 10/16] block/parallels: add get_block_status
Date: Mon, 15 Dec 2014 13:18:13 +0100 [thread overview]
Message-ID: <20141215121813.GF4411@noname.str.redhat.com> (raw)
In-Reply-To: <548ECB67.4000205@openvz.org>
Am 15.12.2014 um 12:52 hat Denis V. Lunev geschrieben:
> On 15/12/14 11:27, Denis V. Lunev wrote:
> >From: Roman Kagan <rkagan@parallels.com>
> >
> >Implement VFS method for get_block_status to Parallels format driver.
> >
> >Signed-off-by: Roman Kagan <rkagan@parallels.com>
> >Signed-off-by: Denis V. Lunev <den@openvz.org>
> >CC: Jeff Cody <jcody@redhat.com>
> >CC: Kevin Wolf <kwolf@redhat.com>
> >CC: Stefan Hajnoczi <stefanha@redhat.com>
> >---
> > block/parallels.c | 21 +++++++++++++++++++++
> > 1 file changed, 21 insertions(+)
> >
> >diff --git a/block/parallels.c b/block/parallels.c
> >index a05bf39..2d3e962 100644
> >--- a/block/parallels.c
> >+++ b/block/parallels.c
> >@@ -384,6 +384,26 @@ static int cluster_remainder(BDRVParallelsState *s, int64_t sector_num,
> > return MIN(nb_sectors, ret);
> > }
> >+static int64_t coroutine_fn parallels_co_get_block_status(BlockDriverState *bs,
> >+ int64_t sector_num, int nb_sectors, int *pnum)
> >+{
> >+ BDRVParallelsState *s = bs->opaque;
> >+ int64_t offset;
> >+
> >+ qemu_co_mutex_lock(&s->lock);
> >+ offset = seek_to_sector(s, sector_num);
> I have mistaken here at porting Roman's changes
> on top of my changes. "padding" is not applied here
> while it should.
>
> Shame on me :(
>
> Something safe should be invented to avoid this
> mess.
Perhaps the application of padding should be moved into
seek_to_sector(). In this case, the following changes to parallels_read()
would follow:
* Reading from the backing file would not apply the padding. I think the
padding is an internal property of this specific image file, so this
is what actually should happen. In other words, a bug fix that you
would have to do anyway.
* n = cluster_remainder(...) must be changed to be based on position
(i.e. the position in the image file) rather than sector_num (i.e. the
virtual offset as seen by the guest)
Kevin
next prev parent reply other threads:[~2014-12-15 12:18 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-15 8:27 [Qemu-devel] [PATCH v4 0/16] parallels format support improvements Denis V. Lunev
2014-12-15 8:27 ` [Qemu-devel] [PATCH 01/16] configure: add dependency from libxml2 Denis V. Lunev
2014-12-15 8:27 ` [Qemu-devel] [PATCH 02/16] block/parallels: allow to specify DiskDescriptor.xml instead of image file Denis V. Lunev
2014-12-15 10:45 ` Kevin Wolf
2014-12-15 11:51 ` Denis V. Lunev
2014-12-15 8:27 ` [Qemu-devel] [PATCH 03/16] iotests, parallels: quote TEST_IMG in 076 test to be path-safe Denis V. Lunev
2014-12-15 8:27 ` [Qemu-devel] [PATCH 04/16] iotests: simple parallels XML disk descriptor file test added Denis V. Lunev
2014-12-15 10:49 ` Kevin Wolf
2014-12-15 8:27 ` [Qemu-devel] [PATCH 05/16] block/parallels: support padded Parallels images Denis V. Lunev
2014-12-15 11:05 ` Kevin Wolf
2014-12-15 11:33 ` Denis V. Lunev
2014-12-15 8:27 ` [Qemu-devel] [PATCH 06/16] iotests: padded parallels image test Denis V. Lunev
2014-12-15 8:27 ` [Qemu-devel] [PATCH 07/16] parallels: change copyright information in the image header Denis V. Lunev
2014-12-15 11:06 ` Kevin Wolf
2014-12-15 11:52 ` Denis V. Lunev
2014-12-16 16:29 ` Denis V. Lunev
2014-12-15 8:27 ` [Qemu-devel] [PATCH 08/16] block/parallels: switch to bdrv_read Denis V. Lunev
2014-12-15 8:27 ` [Qemu-devel] [PATCH 09/16] block/parallels: read up to cluster end in one go Denis V. Lunev
2014-12-15 8:27 ` [Qemu-devel] [PATCH 10/16] block/parallels: add get_block_status Denis V. Lunev
2014-12-15 11:52 ` Denis V. Lunev
2014-12-15 12:18 ` Kevin Wolf [this message]
2014-12-15 8:27 ` [Qemu-devel] [PATCH 11/16] block/parallels: add support for backing files Denis V. Lunev
2014-12-15 12:30 ` Kevin Wolf
2014-12-15 13:08 ` Roman Kagan
2014-12-15 8:27 ` [Qemu-devel] [PATCH 12/16] iotests: testcase for backing in parallels format Denis V. Lunev
2014-12-15 8:27 ` [Qemu-devel] [PATCH 13/16] block/parallels: read disk size from XML if DiskDescriptor.xml is passed Denis V. Lunev
2014-12-15 12:38 ` Kevin Wolf
2014-12-15 8:27 ` [Qemu-devel] [PATCH 14/16] block/parallels: introduce ParallelsSnapshot data structure Denis V. Lunev
2014-12-15 12:45 ` Kevin Wolf
2014-12-15 13:32 ` Denis V. Lunev
2014-12-17 16:15 ` [Qemu-devel] [RFC PATCH 1/1] block/parallels: new concept for DiskDescriptor.xml Denis V. Lunev
2014-12-15 8:28 ` [Qemu-devel] [PATCH 15/16] block/parallels: support read-only parallels snapshots Denis V. Lunev
2014-12-15 8:28 ` [Qemu-devel] [PATCH 16/16] iotests: testcase parallels image with snapshots Denis V. Lunev
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=20141215121813.GF4411@noname.str.redhat.com \
--to=kwolf@redhat.com \
--cc=den@openvz.org \
--cc=jcody@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkagan@parallels.com \
--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).