From: Markus Armbruster <armbru@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Dietmar Maurer <dietmar@proxmox.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/5] RFC: Efficient VM backup for qemu (v1)
Date: Fri, 23 Nov 2012 11:55:52 +0100 [thread overview]
Message-ID: <87haogh9l3.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <50AF4826.3000901@redhat.com> (Kevin Wolf's message of "Fri, 23 Nov 2012 10:55:50 +0100")
Kevin Wolf <kwolf@redhat.com> writes:
> Am 23.11.2012 10:05, schrieb Dietmar Maurer:
>>>>> My plan was to have something like bs->job->job_type-
>>>>> {before,after}_write.
>>>>>
>>>>> int coroutine_fn (*before_write)(BlockDriverState *bs,
>>>>> int64_t sector_num, int nb_sectors, QEMUIOVector *qiov,
>>>>> void **cookie);
>>>>> int coroutine_fn (*after_write)(BlockDriverState *bs,
>>>>> int64_t sector_num, int nb_sectors, QEMUIOVector *qiov,
>>>>> void *cookie);
>>>>
>>>> I don't think that job is the right place. Instead I would put a list
>>>> of filters into
>>>> BDS:
>>>
>>> Well, I can also add it to job_type. Just tell me what you prefer, and I will
>>> write the patch.
>
> A block filter shouldn't be tied to a job, I think. We have things like
> blkdebug that are really filters and aren't coupled with a job, and on
> the other hand we want to generalise "block jobs" into just "jobs", so
> adding block specific things to job_type would be a step in the wrong
> direction.
>
> I also think that before_write/after_write isn't a convenient interface,
> it brings back much of the callback-based AIO cruft and passing void*
> isn't nice anyway. It's much nice to have a single .bdrv_co_write
> callback that somewhere in the middle calls the layer below with a
> simple function call.
>
> Also read/write aren't enough, for a full filter interface you
> potentially also need flush, discard and probably most other operations.
>
> This is why I suggested using a regular BlockDriver struct for filters,
> it already has all functions that are needed.
Let me elaborate a bit.
A block backend is a tree of block driver instances (BlockDriverState).
Common examples:
raw qcow2 qcow2
| / \ / \
file file raw file qcow2
| / \
file file raw
|
file
A less common example:
raw
|
blkdebug
|
file
Here, "blkdebug" acts as a filter, i.e. a block driver that can be put
between two adjacent tree nodes. It injects errors by selectively
failing some bdrv_aio_readv() and bdrv_aio_writev() operations.
Actually, "raw" could also be viewed as a degenerate filter that does
nothing[*], but such a filter isn't particularly useful.
Except perhaps to serve as base for real filters, that do stuff. To do
stuff in your filter, you'd replace raw's operations with your own.
Hmm, blkdebug implements much fewer operations than raw. Makes me
wonder whether it works only in special places in the tree now.
[...]
[*] Except occasionally inject bugs when somebody adds new BlockDriver
operations without updating "raw" to forward them.
next prev parent reply other threads:[~2012-11-23 10:56 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-21 9:01 [Qemu-devel] [PATCH 1/5] RFC: Efficient VM backup for qemu (v1) Dietmar Maurer
2012-11-21 9:01 ` [Qemu-devel] [PATCH 2/5] add basic backup support to block driver Dietmar Maurer
2012-11-22 11:25 ` Stefan Hajnoczi
2012-11-22 11:29 ` Dietmar Maurer
2012-11-23 8:56 ` Dietmar Maurer
2012-11-21 9:01 ` [Qemu-devel] [PATCH 3/5] introduce new vma archive format Dietmar Maurer
2012-11-21 16:06 ` Eric Blake
2012-11-21 17:56 ` Dietmar Maurer
2012-11-21 9:01 ` [Qemu-devel] [PATCH 4/5] add backup related monitor commands Dietmar Maurer
2012-11-21 16:16 ` Eric Blake
2012-11-21 17:59 ` Dietmar Maurer
2012-11-21 18:49 ` Dietmar Maurer
2012-11-21 9:01 ` [Qemu-devel] [PATCH 5/5] add regression tests for backup Dietmar Maurer
2012-11-21 10:48 ` [Qemu-devel] [PATCH 1/5] RFC: Efficient VM backup for qemu (v1) Kevin Wolf
2012-11-21 11:10 ` Dietmar Maurer
2012-11-21 12:37 ` Kevin Wolf
2012-11-21 13:23 ` Paolo Bonzini
2012-11-23 7:42 ` Dietmar Maurer
2012-11-23 9:18 ` Paolo Bonzini
2012-11-23 9:28 ` Dietmar Maurer
2012-11-23 8:12 ` Dietmar Maurer
2012-11-23 9:01 ` Dietmar Maurer
2012-11-23 9:05 ` Dietmar Maurer
2012-11-23 9:15 ` Paolo Bonzini
2012-11-23 9:17 ` Dietmar Maurer
2012-11-23 9:55 ` Kevin Wolf
2012-11-23 10:55 ` Markus Armbruster [this message]
2012-11-21 13:25 ` Dietmar Maurer
2012-11-21 13:58 ` Kevin Wolf
2012-11-21 15:47 ` Dietmar Maurer
2012-11-23 7:38 ` Dietmar Maurer
2012-11-23 9:08 ` Kevin Wolf
2012-11-23 9:21 ` Dietmar Maurer
2012-11-23 9:31 ` Dietmar Maurer
2012-11-23 10:29 ` Kevin Wolf
2012-11-26 5:51 ` Dietmar Maurer
2012-11-26 12:07 ` Paolo Bonzini
2012-11-27 6:20 ` Dietmar Maurer
2012-11-27 7:15 ` Dietmar Maurer
2012-11-27 8:48 ` Kevin Wolf
2012-11-27 10:24 ` Dietmar Maurer
2012-11-21 11:23 ` Dietmar Maurer
2012-11-22 11:12 ` Stefan Hajnoczi
2012-11-22 11:26 ` Dietmar Maurer
2012-11-22 12:44 ` Stefan Hajnoczi
2012-11-22 12:55 ` Dietmar Maurer
2012-11-22 15:30 ` Stefan Hajnoczi
2012-11-22 15:58 ` Dietmar Maurer
2012-11-22 17:02 ` Stefan Hajnoczi
2012-11-22 17:34 ` Dietmar Maurer
2012-11-22 11:40 ` Dietmar Maurer
2012-11-22 15:42 ` Stefan Hajnoczi
2012-11-22 12:00 ` Dietmar Maurer
2012-11-22 15:45 ` Stefan Hajnoczi
2012-11-22 15:56 ` Dietmar Maurer
2012-11-22 16:37 ` Stefan Hajnoczi
2012-11-22 12:03 ` Dietmar Maurer
2012-11-22 17:16 ` Stefan Hajnoczi
2012-11-22 17:46 ` Dietmar Maurer
2012-11-23 5:23 ` Stefan Hajnoczi
2012-11-23 5:25 ` Stefan Hajnoczi
2012-11-23 6:18 ` Dietmar Maurer
2012-11-23 6:13 ` Dietmar Maurer
2012-11-22 17:50 ` Dietmar Maurer
2012-11-23 5:21 ` Stefan Hajnoczi
2012-11-22 18:05 ` Dietmar Maurer
2012-11-23 5:19 ` Stefan Hajnoczi
2012-11-23 6:05 ` Dietmar Maurer
2012-11-22 18:15 ` Dietmar Maurer
2012-11-27 10:09 ` Wenchao Xia
2012-11-27 10:37 ` Dietmar Maurer
2012-11-28 9:39 ` Wenchao Xia
2012-11-28 11:08 ` Dietmar Maurer
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=87haogh9l3.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=dietmar@proxmox.com \
--cc=kwolf@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.