qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: famz@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org,
	mreitz@redhat.com, vsementsov@parallels.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v3 01/10] qapi: Add transaction support to block-dirty-bitmap operations
Date: Thu, 07 May 2015 13:22:26 -0400	[thread overview]
Message-ID: <554B9F52.9020003@redhat.com> (raw)
In-Reply-To: <20150507145440.GN13985@stefanha-thinkpad.redhat.com>



On 05/07/2015 10:54 AM, Stefan Hajnoczi wrote:
> On Wed, Apr 22, 2015 at 08:04:44PM -0400, John Snow wrote:
>> +static void block_dirty_bitmap_clear_prepare(BlkTransactionState
>> *common, +                                             Error
>> **errp) +{ +    BlockDirtyBitmapState *state =
>> DO_UPCAST(BlockDirtyBitmapState, +
>> common, common); +    BlockDirtyBitmap *action; + +    action =
>> common->action->block_dirty_bitmap_clear; +    state->bitmap =
>> block_dirty_bitmap_lookup(action->node, +
>> action->name, +
>> &state->bs, +
>> &state->aio_context, +
>> errp); +    if (!state->bitmap) { +        return; +    } + +
>> if (bdrv_dirty_bitmap_frozen(state->bitmap)) { +
>> error_setg(errp, "Cannot modify a frozen bitmap"); +
>> return; +    } else if
>> (!bdrv_dirty_bitmap_enabled(state->bitmap)) { +
>> error_setg(errp, "Cannot clear a disabled bitmap"); +
>> return; +    } + +    /* AioContext is released in .clean() */ 
>> +} + +static void
>> block_dirty_bitmap_clear_commit(BlkTransactionState *common) +{ +
>> BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState, +
>> common, common); +    bdrv_clear_dirty_bitmap(state->bitmap); +}
> 
> These semantics don't work in this example:
> 
> [block-dirty-bitmap-clear, drive-backup]
> 
> Since drive-backup starts the blockjob in .prepare() but 
> block-dirty-bitmap-clear only clears the bitmap in .commit() the
> order is wrong.
> 
> .prepare() has to do something non-destructive, like stashing away
> the HBitmap and replacing it with an empty one.  Then .commit() can
> discard the old bitmap while .abort() can move the old bitmap back
> to undo the operation.
> 
> Stefan
> 

Hmm, that's sort of gross. That means that any transactional command
*ever* destined to be used with drive-backup in any conceivable way
needs to move a lot more of its action forward to .prepare().

That sort of defeats the premise of .prepare() and .commit(), no? And
all because drive-backup jumped the gun.

That's going to get hard to maintain as we add more transactions.

--js

  reply	other threads:[~2015-05-07 17:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23  0:04 [Qemu-devel] [PATCH v3 00/10] block: incremental backup transactions John Snow
2015-04-23  0:04 ` [Qemu-devel] [PATCH v3 01/10] qapi: Add transaction support to block-dirty-bitmap operations John Snow
2015-04-23  2:22   ` Eric Blake
2015-05-07 14:54   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-05-07 17:22     ` John Snow [this message]
2015-05-08 13:14       ` Stefan Hajnoczi
2015-05-08 13:17         ` Max Reitz
2015-05-08 16:19           ` John Snow
2015-05-08 14:29         ` Eric Blake
2015-05-11 13:10           ` Stefan Hajnoczi
2015-05-18 15:03             ` Kevin Wolf
2015-04-23  0:04 ` [Qemu-devel] [PATCH v3 02/10] iotests: add transactional incremental backup test John Snow
2015-04-23 15:30   ` Max Reitz
2015-05-11 13:54   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-04-23  0:04 ` [Qemu-devel] [PATCH v3 03/10] block: rename BlkTransactionState and BdrvActionOps John Snow
2015-05-18 12:23   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-04-23  0:04 ` [Qemu-devel] [PATCH v3 04/10] block: re-add BlkTransactionState John Snow
2015-04-23  0:04 ` [Qemu-devel] [PATCH v3 05/10] block: add transactional callbacks feature John Snow
2015-04-23 15:32   ` Max Reitz
2015-04-23  0:04 ` [Qemu-devel] [PATCH v3 06/10] block: add refcount to Job object John Snow
2015-04-23  0:04 ` [Qemu-devel] [PATCH v3 07/10] block: add delayed bitmap successor cleanup John Snow
2015-04-23  0:04 ` [Qemu-devel] [PATCH v3 08/10] qmp: Add an implementation wrapper for qmp_drive_backup John Snow
2015-04-23 15:38   ` Max Reitz
2015-04-23  0:04 ` [Qemu-devel] [PATCH v3 09/10] block: drive_backup transaction callback support John Snow
2015-04-23 15:46   ` Max Reitz
2015-04-23  0:04 ` [Qemu-devel] [PATCH v3 10/10] iotests: 124 - transactional failure test John Snow
2015-04-23 16:06   ` Max Reitz

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=554B9F52.9020003@redhat.com \
    --to=jsnow@redhat.com \
    --cc=famz@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@parallels.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).