qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bugfix:migrate with block-dirty-bitmap (disk size is big enough) can't be finished
@ 2022-09-10  6:35 liuhaiwei
  2022-09-10 10:18 ` Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 5+ messages in thread
From: liuhaiwei @ 2022-09-10  6:35 UTC (permalink / raw)
  To: qemu-devel, qemu-block
  Cc: stefanha, fam, eblake, vsementsov, jsnow, quintela, dgilbert,
	liuhaiwei, liuhaiwei

From: liuhaiwei <liuhaiwei@inspur.com>

bug description as  https://gitlab.com/qemu-project/qemu/-/issues/1203
Usually,we use the precopy or postcopy mode to migrate block dirty bitmap.
but if block-dirty-bitmap size more than threshold size,we cannot entry the migration_completion in migration_iteration_run function
To solve this problem, we can setting  the pending size to a fake value(threshold-1 or 0) to tell  migration_iteration_run function to entry the migration_completion,if pending size > threshold size

Signed-off-by: liuhaiwei <liuhaiwei9699@126.com>
Signed-off-by: liuhaiwei <liuhaiwei@inspur.com>
---
 migration/block-dirty-bitmap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 9aba7d9c22..5cbf365f46 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -782,6 +782,10 @@ static void dirty_bitmap_save_pending(QEMUFile *f, void *opaque,
     }
 
     qemu_mutex_unlock_iothread();
+     /*we set the fake pending size  when the dirty bitmap size more than max_size */
+    if(pending >= max_size && max_size != 0){
+        pending = max_size - 1;
+    }
 
     trace_dirty_bitmap_save_pending(pending, max_size);
 
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread
* Re: [PATCH] bugfix:migrate with block-dirty-bitmap (disk size is big enough) can't be finished
@ 2022-09-10 10:47 Seaway Liu(刘海伟)
  2022-09-10 10:58 ` Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Seaway Liu(刘海伟) @ 2022-09-10 10:47 UTC (permalink / raw)
  To: vsementsov@yandex-team.ru, liuhaiwei9699@126.com,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
  Cc: stefanha@redhat.com, fam@euphon.net, eblake@redhat.com,
	jsnow@redhat.com, quintela@redhat.com, dgilbert@redhat.com

hi,i have a question
if failed in migration using post-copy mode,is there some way to restore the memory data back to soucre VM?




发自我的小米
在 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,2022年9月10日 下午6:18写道:

On 9/10/22 09:35, liuhaiwei wrote:
> From: liuhaiwei <liuhaiwei@inspur.com>
>
> bug description as  https://gitlab.com/qemu-project/qemu/-/issues/1203
> Usually,we use the precopy or postcopy mode to migrate block dirty bitmap.
> but if block-dirty-bitmap size more than threshold size,we cannot entry the migration_completion in migration_iteration_run function
> To solve this problem, we can setting  the pending size to a fake value(threshold-1 or 0) to tell  migration_iteration_run function to entry the migration_completion,if pending size > threshold size
>


Actually, bitmaps migrate in postcopy. So, you should start postcopy for it to work (qmp command migrate-start-postcopy). This command simply set the boolean variable, so that in migration_iteration_run() we'll move to postcopy when needed. So, you can start this command immediately after migrate command, or even before it, but after setting the "dirty-bitmaps" capability.

Fake pending is a wrong thing to do, it means that you will make downtime to be larger than expected.

--
Best regards,
Vladimir

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-15 11:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-10  6:35 [PATCH] bugfix:migrate with block-dirty-bitmap (disk size is big enough) can't be finished liuhaiwei
2022-09-10 10:18 ` Vladimir Sementsov-Ogievskiy
2022-09-15  1:28   ` liuhaiwei9699
2022-09-15 11:45     ` Vladimir Sementsov-Ogievskiy
  -- strict thread matches above, loose matches on Subject: below --
2022-09-10 10:47 Seaway Liu(刘海伟)
2022-09-10 10:58 ` Vladimir Sementsov-Ogievskiy
2022-09-11  2:08   ` liuhaiwei9699

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).