qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: kwolf@redhat.com, anthony@codemonkey.ws,
	Peter Lieven <pl@kamp.de>,
	qemu-devel@nongnu.org, stefanha@redhat.com,
	ronniesahlberg@gmail.com
Subject: Re: [Qemu-devel] [PATCHv4] block/get_block_status: avoid redundant callouts on raw devices
Date: Wed, 02 Oct 2013 17:13:44 +0200	[thread overview]
Message-ID: <524C3828.9000706@redhat.com> (raw)
In-Reply-To: <20131002150614.GA14662@stefanha-thinkpad.redhat.com>

Il 02/10/2013 17:06, Stefan Hajnoczi ha scritto:
> Sorry I didn't review this earlier but this flag looks hacky and I'm not
> confident about merging the patch yet.
> 
> The patch makes me wonder if the raw_bsd driver should avoid calling
> bs->file itself:
> 
> return BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID |
>        (sector_num << BDRV_SECTOR_BITS);
> 
> Let block.c:bdrv_co_get_block_status() call down into bs->file.
> 
> The problem is then the protocol cannot report unallocated sectors with
> this approach.
> 
> I think we want to preserve bs' offset while taking the other flags from
> bs->file (DATA, ZERO).

This would cause other changes.  For example, a qcow2 with full metadata
preallocation (i.e. all L2 tables are there but it points to holes)
would not return DATA anymore.  I think this is wrong, and especially a
change from the old is_allocated API.

However, a variant on this idea could be to return

   BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID |
        (sector_num << BDRV_SECTOR_BITS);

and then BDRV_BLOCK_RAW would mean "take DATA and ZERO from bs->file".

Paolo

> Peter, Paolo: What do you think of this approach?

  reply	other threads:[~2013-10-02 15:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02 14:20 [Qemu-devel] [PATCHv4] block/get_block_status: avoid redundant callouts on raw devices Peter Lieven
2013-10-02 15:06 ` Stefan Hajnoczi
2013-10-02 15:13   ` Paolo Bonzini [this message]
2013-10-02 15:34     ` Peter Lieven
2013-10-02 16:02     ` Peter Lieven
2013-10-02 15:08 ` 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=524C3828.9000706@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=kwolf@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-devel@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=stefanha@gmail.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).