qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v9 4/8] migration: API to clear bits of guest fr


From: Wei Wang
Subject: Re: [Qemu-devel] [PATCH v9 4/8] migration: API to clear bits of guest free pages from the dirty bitmap
Date: Tue, 27 Nov 2018 14:52:35 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 11/27/2018 02:06 PM, Peter Xu wrote:
On Thu, Nov 15, 2018 at 06:08:00PM +0800, Wei Wang wrote:
Again, is it possible to resize during migration?

So I think the check is fine, but uncertain about the comment.

Yes, resize would not happen with the current implementation.
But heard it could just be a temporal implementation. Probably
we could improve the comment like this:

"
Though the implementation might not support ram resize currently,
this could happen in theory with future updates. So the check here
handles the case that RAMBLOCK is resized after the free page hint is
reported.
"


And shall we print something if that happened?  We can use
error_report_once(), and squashing the above assert:

   if (!block || offset > block->used_length) {
     /* should never happen, but if it happens we ignore the hints and warn */
     error_report_once("...");
     return;
   }

What do you think?

Sounds good.


+
+        if (len <= block->used_length - offset) {
+            used_len = len;
+        } else {
+            used_len = block->used_length - offset;
+            addr += used_len;
Maybe moving this line into the for() could be a bit better?

   for (; len > 0; len -= used_len, addr += used_len) {


Yes, I think it looks better, thanks.

Best,
Wei




reply via email to

[Prev in Thread] Current Thread [Next in Thread]