qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v7 3/5] migration: API to clear bits of guest fr


From: Wei Wang
Subject: Re: [Qemu-devel] [PATCH v7 3/5] migration: API to clear bits of guest free pages from the dirty bitmap
Date: Mon, 04 Jun 2018 15:43:01 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 06/04/2018 10:49 AM, Peter Xu wrote:



+
+    for (; len > 0; len -= used_len) {
+        block = qemu_ram_block_from_host(addr, false, &offset);
+        if (unlikely(!block)) {
+            return;
We should never reach here, should we?  Assuming the callers of this
function should always pass in a correct host address. If we are very
sure that the host addr should be valid, could we just assert?
Probably not the case, because of the corner case that the memory would be
hot unplugged after the free page is reported to QEMU.
Question: Do we allow to do hot plug/unplug for memory during
migration?
I think so. From the code, I don't find where it forbids memory hotplug
during migration.
I don't play with that much; do we need to do "device_add" after all?

   (qemu) object_add 
memory-backend-file,id=mem1,size=1G,mem-path=/mnt/hugepages-1GB
   (qemu) device_add pc-dimm,id=dimm1,memdev=mem1

If so, we may not allow that since in qdev_device_add() we don't allow
that:

     if (!migration_is_idle()) {
         error_setg(errp, "device_add not allowed while migrating");
         return NULL;
     }


OK, I missed that part, and thanks for correcting it. I'll use an assert there if no objections from others.


Best,
Wei





reply via email to

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