From: Peter Lieven <pl@kamp.de>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: kwolf@redhat.com, pbonzini@redhat.com, owasserm@redhat.com,
qemu-devel@nongnu.org, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCHv3] block-migration: efficiently encode zero blocks
Date: Thu, 18 Jul 2013 08:02:58 +0200 [thread overview]
Message-ID: <51E78512.2090407@kamp.de> (raw)
In-Reply-To: <20130718050330.GA26971@stefanha-thinkpad.redhat.com>
On 18.07.2013 07:03, Stefan Hajnoczi wrote:
> On Mon, Jul 15, 2013 at 12:55:05PM +0200, Peter Lieven wrote:
>> @@ -114,16 +115,29 @@ static void blk_mig_unlock(void)
>> static void blk_send(QEMUFile *f, BlkMigBlock * blk)
>> {
>> int len;
>> + uint64_t flags = BLK_MIG_FLAG_DEVICE_BLOCK;
>> +
>> + if (migrate_zero_blocks() && buffer_is_zero(blk->buf, BLOCK_SIZE)) {
> [...]
>> +bool migrate_zero_blocks(void)
>> +{
>> + MigrationState *s;
>> +
>> + s = migrate_get_current();
>> +
>> + return s->enabled_capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS];
>> +}
> blk_send() is called without locks held. It would be safer and cleaner
> to stash bool migrate_zero_blocks in BlkMigBlock in init_blk_migration()
> instead of accessing migrate_get_current() without locks held.
>
> This eliminates the assumption that accessing migrate_get_current() is
> safe without locks.
>
> Besides this locking issue I'm happy with the code.
Thank you,
I will sent a v4 shortly. I have to rebase it anyway.
Peter
prev parent reply other threads:[~2013-07-18 6:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 10:55 [Qemu-devel] [PATCHv3] block-migration: efficiently encode zero blocks Peter Lieven
2013-07-15 21:27 ` Eric Blake
2013-07-16 7:10 ` Peter Lieven
2013-07-18 5:03 ` Stefan Hajnoczi
2013-07-18 6:02 ` Peter Lieven [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=51E78512.2090407@kamp.de \
--to=pl@kamp.de \
--cc=kwolf@redhat.com \
--cc=owasserm@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.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 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.