qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 14/25] memory: Add Error** argument to the global_dirty_lo


From: Cédric Le Goater
Subject: Re: [PATCH v4 14/25] memory: Add Error** argument to the global_dirty_log routines
Date: Mon, 18 Mar 2024 17:08:13 +0100
User-agent: Mozilla Thunderbird

--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2836,18 +2836,31 @@ static void 
migration_bitmap_clear_discarded_pages(RAMState *rs)
static void ram_init_bitmaps(RAMState *rs)
  {
+    Error *local_err = NULL;
+    bool ret = true;
+
      qemu_mutex_lock_ramlist();
WITH_RCU_READ_LOCK_GUARD() {
          ram_list_init_bitmaps();

btw, should we use bitmap_try_new() to create the bitmaps instead of
bitmap_new() which can abort() ?


          /* We don't use dirty log with background snapshots */
          if (!migrate_background_snapshot()) {
-            memory_global_dirty_log_start(GLOBAL_DIRTY_MIGRATION);
+            ret = memory_global_dirty_log_start(GLOBAL_DIRTY_MIGRATION,
+                                                &local_err);
+            if (!ret) {
+                error_report_err(local_err);
+                goto out_unlock;

Here we may need to free the bitmaps created in ram_list_init_bitmaps().


C.




reply via email to

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