qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] block: Split bdrv_open
Date: Wed, 14 Apr 2010 09:22:19 +0200	[thread overview]
Message-ID: <4BC56D2B.3040606@redhat.com> (raw)
In-Reply-To: <20100413182033.GA6756@lst.de>

Am 13.04.2010 20:20, schrieb Christoph Hellwig:
> On Mon, Apr 12, 2010 at 04:49:16PM +0200, Kevin Wolf wrote:
>> bdrv_open contains quite some code that is only useful for opening images (as
>> opposed to opening files by a protocol), for example snapshots.
>>
>> This patch splits the code so that we have bdrv_open_file() for files (uses
>> protocols), bdrv_open() for images (uses format drivers) and bdrv_do_open() for
>> the code common for opening both images and files.
>>
>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>> ---
>> This patch applies on top of Christoph's RFC for the format/protocol split
> 
> I like this a lot.  A few comments:
> 
>  - why is bdrv_do_open below it's users in the code?  I really hate
>    forward declarations of functions and they can usually be easily
>    avoided.

Ok, I'll move it.

>  - a "do" a function name is not very meaningfull - what about
>    bdrv_open_common instead?

Heh, did exactly this yesterday because I felt the same. It's just not
pushed yet.

>  - doesn't the backing device handling only apply to image formats, too?

Hm, probably yes. At least currently no protocol uses it. We could add
an assert(bs->backing_hd == NULL) to bdrv_file_open to make clear that
backing files are not wanted for protocols.

Kevin

      reply	other threads:[~2010-04-14  9:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-12 14:49 [Qemu-devel] [PATCH] block: Split bdrv_open Kevin Wolf
2010-04-13 18:20 ` [Qemu-devel] " Christoph Hellwig
2010-04-14  7:22   ` Kevin Wolf [this message]

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=4BC56D2B.3040606@redhat.com \
    --to=kwolf@redhat.com \
    --cc=hch@lst.de \
    --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 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).