qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH 5/5] block: Move request_alignment


From: Kevin Wolf
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH 5/5] block: Move request_alignment into BlockLimit
Date: Tue, 7 Jun 2016 12:08:10 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 03.06.2016 um 23:43 hat Eric Blake geschrieben:
> On 06/03/2016 11:49 AM, Eric Blake wrote:
> > On 06/03/2016 11:03 AM, Eric Blake wrote:
> >> It makes more sense to have ALL block size limit constraints
> >> in the same struct.  Improve the documentation while at it.
> >>
> >> Note that bdrv_refresh_limits() has to keep things alive across
> >> a memset() of BlockLimits.
> >>
> >> Signed-off-by: Eric Blake <address@hidden>
> >> ---
> >>  include/block/block_int.h | 12 ++++++++----
> >>  block.c                   |  4 ++--
> >>  block/blkdebug.c          |  4 ++--
> >>  block/bochs.c             |  2 +-
> >>  block/cloop.c             |  2 +-
> >>  block/dmg.c               |  2 +-
> >>  block/io.c                | 12 +++++++-----
> >>  block/iscsi.c             |  2 +-
> >>  block/raw-posix.c         | 16 ++++++++--------
> >>  block/raw-win32.c         |  6 +++---
> >>  block/vvfat.c             |  2 +-
> >>  11 files changed, 35 insertions(+), 29 deletions(-)
> > 
> > Something in this patch is causing qemu-iotests 77 to infloop; we may
> > decide it is just easier to drop this patch rather than find all the
> > places where the request_alignment must be preserved across what
> > otherwise zeroes out limits.
> 
> Found it; squash this in (or use it as an argument why we don't want
> request_alignment in bs->bl after all):

This hunk doesn't make sense to me. For the correctness of the code it
shouldn't make a difference whether the alignment happens before passing
the request to file/raw-posix or already in the raw format layer.

The cause for the hang you're seeing is probably that the request is
already aligned before the blkdebug layer and therefore the blkdebug
events aren't generated any more. That's a problem with the test (I'm
considering the blkdebug events part of the test infrastructure),
however, and not with the code.

Kevin

> diff --git i/block/raw_bsd.c w/block/raw_bsd.c
> index b1d5237..c3c2246 100644
> --- i/block/raw_bsd.c
> +++ w/block/raw_bsd.c
> @@ -152,7 +152,11 @@ static int raw_get_info(BlockDriverState *bs,
> BlockDriverInfo *bdi)
> 
>  static void raw_refresh_limits(BlockDriverState *bs, Error **errp)
>  {
> +    /* Inherit all limits except for request_alignment */
> +    int request_alignment = bs->bl.request_alignment;
> +
>      bs->bl = bs->file->bs->bl;
> +    bs->bl.request_alignment = request_alignment;
>  }
> 
>  static int raw_truncate(BlockDriverState *bs, int64_t offset)

Attachment: pgpMxGqCS57Ph.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]