All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>,
	Fabiano Rosas <farosas@suse.de>
Cc: "Alex Williamson" <alex.williamson@redhat.com>,
	"Avihai Horon" <avihaih@nvidia.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Prasad Pandit" <pjp@fedoraproject.org>,
	"Cédric Le Goater" <clg@redhat.com>
Subject: [PATCH for-9.1 v5 04/14] migration: Always report an error in ram_save_setup()
Date: Wed, 20 Mar 2024 07:49:00 +0100	[thread overview]
Message-ID: <20240320064911.545001-5-clg@redhat.com> (raw)
In-Reply-To: <20240320064911.545001-1-clg@redhat.com>

This will prepare ground for future changes adding an Error** argument
to the save_setup() handler. We need to make sure that on failure,
ram_save_setup() sets a new error.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 migration/ram.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/migration/ram.c b/migration/ram.c
index 8deb84984f4a8e9bcdcbdba7d83ce56e406adddf..44d7073730c67fa09ab9a59a712e74d8b088bff4 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3074,12 +3074,14 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
     int ret, max_hg_page_size;
 
     if (compress_threads_save_setup()) {
+        error_report("%s: failed to start compress threads", __func__);
         return -1;
     }
 
     /* migration has already setup the bitmap, reuse it. */
     if (!migration_in_colo_state()) {
         if (ram_init_all(rsp) != 0) {
+            error_report("%s: failed to setup RAM for migration", __func__);
             compress_threads_save_cleanup();
             return -1;
         }
@@ -3116,12 +3118,14 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
 
     ret = rdma_registration_start(f, RAM_CONTROL_SETUP);
     if (ret < 0) {
+        error_report("%s: failed to start RDMA registration", __func__);
         qemu_file_set_error(f, ret);
         return ret;
     }
 
     ret = rdma_registration_stop(f, RAM_CONTROL_SETUP);
     if (ret < 0) {
+        error_report("%s: failed to stop RDMA registration", __func__);
         qemu_file_set_error(f, ret);
         return ret;
     }
@@ -3138,6 +3142,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
     ret = multifd_send_sync_main();
     bql_lock();
     if (ret < 0) {
+        error_report("%s: multifd synchronization failed", __func__);
         return ret;
     }
 
@@ -3147,7 +3152,11 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
     }
 
     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
-    return qemu_fflush(f);
+    ret = qemu_fflush(f);
+    if (ret < 0) {
+        error_report("%s failed : %s", __func__, strerror(-ret));
+    }
+    return ret;
 }
 
 static void ram_save_file_bmap(QEMUFile *f)
-- 
2.44.0



  parent reply	other threads:[~2024-03-20  6:50 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20  6:48 [PATCH for-9.1 v5 00/14] migration: Improve error reporting Cédric Le Goater
2024-03-20  6:48 ` [PATCH for-9.1 v5 01/14] s390/stattrib: Add Error** argument to set_migrationmode() handler Cédric Le Goater
2024-03-20  6:48 ` [PATCH for-9.1 v5 02/14] vfio: Always report an error in vfio_save_setup() Cédric Le Goater
2024-03-20  6:48 ` [PATCH for-9.1 v5 03/14] migration: Always report an error in block_save_setup() Cédric Le Goater
2024-03-20  6:49 ` Cédric Le Goater [this message]
2024-03-20  6:49 ` [PATCH for-9.1 v5 05/14] migration: Add Error** argument to vmstate_save() Cédric Le Goater
2024-03-20  6:49 ` [PATCH for-9.1 v5 06/14] migration: Add Error** argument to qemu_savevm_state_setup() Cédric Le Goater
2024-03-20 14:29   ` Peter Xu
2024-03-20  6:49 ` [PATCH for-9.1 v5 07/14] migration: Add Error** argument to .save_setup() handler Cédric Le Goater
2024-03-29  9:32   ` Vladimir Sementsov-Ogievskiy
2024-03-29 10:53     ` Cédric Le Goater
2024-03-29 11:32       ` Vladimir Sementsov-Ogievskiy
2024-03-20  6:49 ` [PATCH for-9.1 v5 08/14] migration: Add Error** argument to .load_setup() handler Cédric Le Goater
2024-03-20  8:02   ` Markus Armbruster
2024-03-20  8:41     ` Cédric Le Goater
2024-03-20  6:49 ` [PATCH for-9.1 v5 09/14] memory: Add Error** argument to .log_global_start() handler Cédric Le Goater
2024-03-20 14:42   ` Peter Xu
2024-03-20 16:15     ` Cédric Le Goater
2024-03-20 17:39       ` Peter Xu
2024-03-20  6:49 ` [PATCH for-9.1 v5 10/14] migration: Introduce ram_bitmaps_destroy() Cédric Le Goater
2024-03-20 14:43   ` Peter Xu
2024-03-20 14:49   ` Fabiano Rosas
2024-03-20  6:49 ` [PATCH for-9.1 v5 11/14] memory: Add Error** argument to the global_dirty_log routines Cédric Le Goater
2024-03-20 14:53   ` Fabiano Rosas
2024-03-20 15:18   ` Peter Xu
2024-03-22  1:55     ` Yong Huang
2024-03-22 13:41       ` Peter Xu
2024-03-20  6:49 ` [PATCH for-9.1 v5 12/14] migration: Add Error** argument to ram_state_init() Cédric Le Goater
2024-03-20 14:59   ` Fabiano Rosas
2024-03-20  6:49 ` [PATCH for-9.1 v5 13/14] migration: Add Error** argument to xbzrle_init() Cédric Le Goater
2024-03-20 15:01   ` Fabiano Rosas
2024-03-20  6:49 ` [PATCH for-9.1 v5 14/14] migration: Modify ram_init_bitmaps() to report dirty tracking errors Cédric Le Goater
2024-03-20 15:05   ` Fabiano Rosas
2024-03-22 13:42 ` [PATCH for-9.1 v5 00/14] migration: Improve error reporting Peter Xu

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=20240320064911.545001-5-clg@redhat.com \
    --to=clg@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=armbru@redhat.com \
    --cc=avihaih@nvidia.com \
    --cc=farosas@suse.de \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pjp@fedoraproject.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.