qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Benoît Canet" <benoit.canet@irqsave.net>
Cc: kwolf@redhat.com, famz@redhat.com, jcody@redhat.com,
	armbru@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com,
	mreitz@redhat.com
Subject: Re: [Qemu-devel] Block Filters
Date: Thu, 5 Sep 2013 12:01:32 +0200	[thread overview]
Message-ID: <20130905100132.GD12293@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <20130904181535.GA5073@irqsave.net>

On Wed, Sep 04, 2013 at 08:15:36PM +0200, Benoît Canet wrote:
> > Propagate operations like snapshot down the tree.  block.c is designed
> > for bs->file/bs->backing_hd kind of BlockDrivers, perhaps it needs to
> > become a bit more generic to support other types of BlockDrivers
> > properly.
> 
> Shouldn't bs->backing_hd become bs->children[0] and bs->file stay the same ?

bs->backing_hd and bs->file exist so that block.c can implement generic
functionality shared by a lot of block drivers.  They are for code
reuse.

Many places in the block layer have come to assume that there is only
one ->file, for example.  That's not true for quorum or even vmdk.

If we forget about code reuse for a second, and just think of BDS trees,
then both ->backing_hd and ->file should be in ->children[].

The block driver can put constraints on ->children[], e.g. how many
children are allowed, read/write access, etc.  .bdrv_open() can look at
->children[] and set things up.

I think the problem we have is that too much of QEMU uses ->file and
->backing_hd.  It's kind of baked in now to the point where more
flexible block drivers like quorum are hard to represent.

->backing_hd and ->file are mostly image format concepts.  Filters and
protocols could do without them.

After saying all that, I don't have a design that makes everything
better :P.

Stefan

  parent reply	other threads:[~2013-09-05 10:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 16:24 [Qemu-devel] Block Filters Benoît Canet
2013-09-04  8:29 ` Stefan Hajnoczi
2013-09-04 18:15   ` Benoît Canet
2013-09-05  7:32     ` Kevin Wolf
2013-09-05 10:01     ` Stefan Hajnoczi [this message]
2013-09-05 10:18       ` Fam Zheng
2013-09-05 14:59         ` Stefan Hajnoczi
2013-09-05 17:29         ` Benoît Canet
2013-09-06  7:42           ` Kevin Wolf
2013-09-06  7:49             ` Fam Zheng
2013-09-06  7:56 ` Fam Zheng
2013-09-06  8:45   ` Kevin Wolf
2013-09-06  9:18     ` Fam Zheng
2013-09-06  9:55       ` Kevin Wolf
2013-09-06 10:50         ` Fam Zheng
2013-09-15 18:10         ` Benoît Canet
2013-09-16  7:41           ` Fam Zheng
2013-09-16 10:43             ` Benoît Canet
2013-09-16 11:00             ` Benoît Canet

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=20130905100132.GD12293@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=benoit.canet@irqsave.net \
    --cc=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).