All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Liang Li <liang.z.li@intel.com>
Cc: quintela@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com,
	yang.z.zhang@intel.com, quintela@redhate.com,
	amit.shah@redhat.com, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH 01/15] migration: remove last_sent_block from save_page_header
Date: Wed, 25 Mar 2015 11:24:02 +0000	[thread overview]
Message-ID: <20150325112401.GD2313@work-vm> (raw)
In-Reply-To: <1427099338-10449-1-git-send-email-liang.z.li@intel.com>

* Liang Li (liang.z.li@intel.com) wrote:
> From: Juan Quintela <quintela@redhat.com>
> 
> Compression code (still not on tree) want to call this funtion from
> outside the migration thread, so we can't write to last_sent_block.
> 
> Instead of reverting full patch:
> 
> [PULL 07/11] save_block_hdr: we can recalculate
> 
> Just revert the parts that touch last_sent_block.
> 
> Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  arch_init.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch_init.c b/arch_init.c
> index fcfa328..4c8fcee 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -332,19 +332,14 @@ static size_t save_page_header(QEMUFile *f, RAMBlock *block, ram_addr_t offset)
>  {
>      size_t size;
>  
> -    if (block == last_sent_block) {
> -        offset |= RAM_SAVE_FLAG_CONTINUE;
> -    }
> -
>      qemu_put_be64(f, offset);
>      size = 8;
>  
> -    if (block != last_sent_block) {
> +    if (!(offset & RAM_SAVE_FLAG_CONTINUE)) {
>          qemu_put_byte(f, strlen(block->idstr));
>          qemu_put_buffer(f, (uint8_t *)block->idstr,
>                          strlen(block->idstr));
>          size += 1 + strlen(block->idstr);
> -        last_sent_block = block;
>      }
>      return size;
>  }
> @@ -644,6 +639,10 @@ static int ram_save_page(QEMUFile *f, RAMBlock* block, ram_addr_t offset,
>      XBZRLE_cache_lock();
>  
>      current_addr = block->offset + offset;
> +
> +    if (block == last_sent_block) {
> +        offset |= RAM_SAVE_FLAG_CONTINUE;
> +    }
>      if (ret != RAM_SAVE_CONTROL_NOT_SUPP) {
>          if (ret != RAM_SAVE_CONTROL_DELAYED) {
>              if (bytes_xmit > 0) {
> @@ -739,6 +738,7 @@ static int ram_find_and_save_block(QEMUFile *f, bool last_stage,
>  
>              /* if page is unmodified, continue to the next */
>              if (pages > 0) {
> +                last_sent_block = block;
>                  break;
>              }
>          }
> -- 
> 1.9.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

      reply	other threads:[~2015-03-25 11:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23  8:28 [Qemu-devel] [PATCH 01/15] migration: remove last_sent_block from save_page_header Liang Li
2015-03-25 11:24 ` Dr. David Alan Gilbert [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=20150325112401.GD2313@work-vm \
    --to=dgilbert@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=liang.z.li@intel.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=quintela@redhate.com \
    --cc=yang.z.zhang@intel.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.