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: Wed, 4 Sep 2013 10:29:58 +0200	[thread overview]
Message-ID: <20130904082958.GB8031@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <20130903162449.GF5285@irqsave.net>

On Tue, Sep 03, 2013 at 06:24:49PM +0200, Benoît Canet wrote:
> -$user want to do Copy On Read

This feature is currently implemented in the read code path in block.c.
Putting it into a separate, stackable module is fine but may require a
per-device request queue.  Today every BDS has its own request queue and
I think that starts to become inefficient if every small stackable
feature duplicates all request metadata.

> Moreover it would have no way to manipulate easily this tree of BlockDriverState
> has each one is encapsulated in it's parent.
> 
> Also there no generic way to tell the block layer that two or more BlockDriverState
> are siblings.

vmdk also has this issue.  block.c provides bs->file and bs->backing_hd
but it doesn't support multi-file VMDK's natively.  So the vmdk.c has to
implement this internally.

Perhaps VMDK could be simplified by using generic infrastructure for
siblings.

> When doing a snapshot blockdev.c would access
> BlockBackend->top_node_below_filter and make a snapshot of the bs contained in
> this node and it's sibblings.

I'm not a fan of ->top_node_below_filter.  It seems ad-hoc to me.

The snapshot operation should be part of the function interface that
block drivers can implement.  Filters would forward it to their only
child in the simple case.  Quorum would perform the snapshot on each of
its children.  Image formats would allow the snapshot to happen.

If we need slightly different semantics from ->top_node_below_filter
then we'll need to introduce more ad-hoc fields.  I think the cleanest
solution is simply to ask the block drivers to perform the operation and
provide default implementations for the common case.

> After each individual snapshot the linked lists and the hash/arrays would be
> updated to point to the new top bsn.
> The snapshot operation can be done without violating any of the top block
> filter BlockDriverState.

I think we should add bs->parent and bs->children[] fields to BDS and
APIs to manipulate the tree.

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.

BTW I don't see a need to create a separate tree structure.

Stefan

  reply	other threads:[~2013-09-04  8:30 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 [this message]
2013-09-04 18:15   ` Benoît Canet
2013-09-05  7:32     ` Kevin Wolf
2013-09-05 10:01     ` Stefan Hajnoczi
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=20130904082958.GB8031@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).