qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Lei Li <lilei@linux.vnet.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: anthony@codemonkey.ws, qemu-devel@nongnu.org, mrhines@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH resend 3/3] arch_init: right return for ram_save_iterate
Date: Mon, 26 Aug 2013 17:22:16 +0800	[thread overview]
Message-ID: <521B1E48.6090306@linux.vnet.ibm.com> (raw)
In-Reply-To: <521B115D.4040009@redhat.com>

On 08/26/2013 04:27 PM, Paolo Bonzini wrote:
> Il 23/08/2013 15:30, Lei Li ha scritto:
>> -    if (ret < 0) {
>> -        bytes_transferred += total_sent;
>> -        return ret;
>> -    }
>> -
>>       qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
>>       total_sent += 8;
>>       bytes_transferred += total_sent;
>>   
>> -    return total_sent;
>> +    return qemu_file_get_error(f);
> No, this will never make ram_save_iterate (and thus
> qemu_savevm_state_iterate) return a positive, non-zero value.  Thus:
>
>      ret = qemu_file_get_error(f);
>      if (ret < 0) {
>          return ret;
>      }
>      return total_sent;
>
> If you look at the code, you can see that it never returns zero.
> Probably it should do something like
>
>      bytes_transferred += total_sent;
>
>      /* Do not count these 8 bytes into total_sent, so that we can
>       * return 0 if no page had been dirtied.
>       */
>      qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
>      bytes_transferred += 8;
>
> and then proceed as above with "ret = qemu_file_get_error(f)".

Yes, you are right.

>
> Paolo
>


-- 
Lei

      reply	other threads:[~2013-08-26  9:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 13:30 [Qemu-devel] [PATCH resend 1/3] savevm: add comments for qemu_file_get_error() Lei Li
2013-08-23 13:30 ` [Qemu-devel] [PATCH resend 2/3] savevm: fix wrong error set by ram_control_load_hook() Lei Li
2013-08-23 14:18   ` Michael R. Hines
2013-08-23 14:18   ` Michael R. Hines
2013-08-23 13:30 ` [Qemu-devel] [PATCH resend 3/3] arch_init: right return for ram_save_iterate Lei Li
2013-08-26  8:27   ` Paolo Bonzini
2013-08-26  9:22     ` Lei Li [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=521B1E48.6090306@linux.vnet.ibm.com \
    --to=lilei@linux.vnet.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=mrhines@linux.vnet.ibm.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).