aboutsummaryrefslogtreecommitdiff
path: root/migration/qemu-file.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2023-10-11 09:42:39 -0400
committerStefan Hajnoczi <stefanha@redhat.com>2023-10-11 09:42:40 -0400
commit48747938d1b72f492a7921e9b83e9065deb44f14 (patch)
treee4b6bc2a640ed9a76a9add942f6e50691d3fae1b /migration/qemu-file.c
parent67d2486c0ea4b9408854371dc7741f3c223ddb25 (diff)
parent5e79a4bf032213fd59aa614781751fe76584f8e8 (diff)
Merge tag 'migration-20231011-pull-request' of https://gitlab.com/juan.quintela/qemu into staging
Migration Pull request (20231011 edition) Hi In this pull request: - Markus RDMA cleanup series - recover fixes from peter - migration capability from fabiano - negative migration test from fabiano. Please, pull. Thanks, Juan. # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmUmaQ8ACgkQ9IfvGFhy # 1yN9fA//SBnea3Wl2158J673l5aaI8Vp/1PjfzvNdcr/6EQbXZBgug+haQ3n5Hhf # USNRhemrCkpZAGCUf07g9pfF4R/Jsq1OkOrWF4e6gAaZPNU4V5F7VKBk8pmFMLtr # Kk2XgnH2ZPaFEvts0qBrOfvDHH8gOzzjpF2HGrioM8Zr3p1JHz9OqJoSyawLF0U7 # YFTq2jJSgaOQ6ax1+L8hLLuXlmNccBaTWT8Cv0rbPEgcwrJOM/wMfmd6O39ps929 # yS5NnxqqkrprTDjmeGOgOQd0Cy/flinnzmu+BVMO6/ns9Hu6q1TGG6D+DOBdgmHH # jq7Ej5VILtXWOoZtXLHqA1Xt73ciVlmditVupoC+5vtIJou2JseClutOp98qxxzV # llMF7ldHbRTWnu7qIrwv2OINarowR0pIZfkJqBc6dNHHScwMCnX5L9YAvNePEo2V # 1oJpbqW7mmgwdlFAiKFD+AE6qUWxcnzOvPf+fzWrJMi507Kv5nmxQWTHw9dsFs7k # neWnK21t0s2t77+vVBtLlr06JESG+WndzvQsXKZu8Pd0+ASnzpX8pRVzxEPk5EiH # fT9bhXOCvxTTHulznjkOApODE5NF+KlHAFXU87cSIkdi/6JfzcvTe6KeeIPC248Q # jk3nVlhds1xajTcPAK7HF5Ta6R8rNdTZ6q/kFNhLaTGqv9agxDU= # =hekO # -----END PGP SIGNATURE----- # gpg: Signature made Wed 11 Oct 2023 05:21:19 EDT # gpg: using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full] # gpg: aka "Juan Quintela <quintela@trasno.org>" [full] # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * tag 'migration-20231011-pull-request' of https://gitlab.com/juan.quintela/qemu: (65 commits) migration: Add migration_rp_wait|kick() migration: Remember num of ramblocks to sync during recovery qemufile: Always return a verbose error migration: Introduce migrate_has_error() migration: Display error in query-migrate irrelevant of status migration/rdma: Replace flawed device detail dump by tracing migration/rdma: Use error_report() & friends instead of stderr migration/rdma: Downgrade qemu_rdma_cleanup() errors to warnings migration/rdma: Silence qemu_rdma_register_and_get_keys() migration/rdma: Silence qemu_rdma_block_for_wrid() migration/rdma: Don't report received completion events as error migration/rdma: Silence qemu_rdma_reg_control() migration/rdma: Silence qemu_rdma_connect() migration/rdma: Silence qemu_rdma_resolve_host() migration/rdma: Convert qemu_rdma_alloc_pd_cq() to Error migration/rdma: Convert qemu_rdma_post_recv_control() to Error migration/rdma: Convert qemu_rdma_post_send_control() to Error migration/rdma: Convert qemu_rdma_write() to Error migration/rdma: Convert qemu_rdma_write_one() to Error migration/rdma: Convert qemu_rdma_write_flush() to Error ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'migration/qemu-file.c')
-rw-r--r--migration/qemu-file.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index 5e8207dae4..7fb659296f 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -142,15 +142,24 @@ void qemu_file_set_hooks(QEMUFile *f, const QEMUFileHooks *hooks)
*
* Return negative error value if there has been an error on previous
* operations, return 0 if no error happened.
- * Optional, it returns Error* in errp, but it may be NULL even if return value
- * is not 0.
*
+ * If errp is specified, a verbose error message will be copied over.
*/
static int qemu_file_get_error_obj(QEMUFile *f, Error **errp)
{
+ if (!f->last_error) {
+ return 0;
+ }
+
+ /* There is an error */
if (errp) {
- *errp = f->last_error_obj ? error_copy(f->last_error_obj) : NULL;
+ if (f->last_error_obj) {
+ *errp = error_copy(f->last_error_obj);
+ } else {
+ error_setg_errno(errp, -f->last_error, "Channel error");
+ }
}
+
return f->last_error;
}