[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 12/30] migration/multifd: Allow QIOTask error reporting wi
|
From: |
Fabiano Rosas |
|
Subject: |
[RFC PATCH v3 12/30] migration/multifd: Allow QIOTask error reporting without an object |
|
Date: |
Mon, 27 Nov 2023 17:25:54 -0300 |
The only way for the channel backend to report an error to the multifd
core during creation is by setting the QIOTask error. We must allow
the channel backend to set the error even if the QIOChannel has failed
to be created, which means the QIOTask source object would be NULL.
At multifd_new_send_channel_async() move the QOM casting of the
channel until after we have checked for the QIOTask error.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
context: When doing multifd + file, it's possible that we fail to open
the file. I'll use the empty QIOTask to report the error back to
multifd.
---
migration/multifd.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/migration/multifd.c b/migration/multifd.c
index 9625640d61..123ff0dec0 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -865,8 +865,7 @@ static bool multifd_channel_connect(MultiFDSendParams *p,
return true;
}
-static void multifd_new_send_channel_cleanup(MultiFDSendParams *p,
- QIOChannel *ioc, Error *err)
+static void multifd_new_send_channel_cleanup(MultiFDSendParams *p, Error *err)
{
migrate_set_error(migrate_get_current(), err);
/* Error happen, we need to tell who pay attention to me */
@@ -878,20 +877,20 @@ static void
multifd_new_send_channel_cleanup(MultiFDSendParams *p,
* its status.
*/
p->quit = true;
- object_unref(OBJECT(ioc));
error_free(err);
}
static void multifd_new_send_channel_async(QIOTask *task, gpointer opaque)
{
MultiFDSendParams *p = opaque;
- QIOChannel *ioc = QIO_CHANNEL(qio_task_get_source(task));
+ Object *obj = qio_task_get_source(task);
Error *local_err = NULL;
trace_multifd_new_send_channel_async(p->id);
if (!qio_task_propagate_error(task, &local_err)) {
- p->c = ioc;
- qio_channel_set_delay(p->c, false);
+ QIOChannel *ioc = QIO_CHANNEL(obj);
+
+ qio_channel_set_delay(ioc, false);
p->running = true;
if (multifd_channel_connect(p, ioc, &local_err)) {
return;
@@ -899,7 +898,8 @@ static void multifd_new_send_channel_async(QIOTask *task,
gpointer opaque)
}
trace_multifd_new_send_channel_async_error(p->id, local_err);
- multifd_new_send_channel_cleanup(p, ioc, local_err);
+ multifd_new_send_channel_cleanup(p, local_err);
+ object_unref(obj);
}
static void multifd_new_send_channel_create(gpointer opaque)
--
2.35.3
- [RFC PATCH v3 01/30] io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file, (continued)
- [RFC PATCH v3 01/30] io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 02/30] io: Add generic pwritev/preadv interface, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 03/30] io: implement io_pwritev/preadv for QIOChannelFile, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 04/30] io: fsync before closing a file channel, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 05/30] migration/qemu-file: add utility methods for working with seekable channels, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 07/30] migration: Add fixed-ram URI compatibility check, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 06/30] migration/ram: Introduce 'fixed-ram' migration capability, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 08/30] migration/ram: Add outgoing 'fixed-ram' migration, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 10/30] tests/qtest: migration-test: Add tests for fixed-ram file-based migration, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 09/30] migration/ram: Add incoming 'fixed-ram' migration, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 12/30] migration/multifd: Allow QIOTask error reporting without an object,
Fabiano Rosas <=
- [RFC PATCH v3 11/30] migration/multifd: Allow multifd without packets, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 13/30] migration/multifd: Add outgoing QIOChannelFile support, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 14/30] migration/multifd: Add incoming QIOChannelFile support, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 15/30] io: Add a pwritev/preadv version that takes a discontiguous iovec, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 16/30] multifd: Rename MultiFDSendParams::data to compress_data, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 17/30] migration/multifd: Decouple recv method from pages, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 18/30] migration/multifd: Allow receiving pages without packets, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 19/30] migration/ram: Ignore multifd flush when doing fixed-ram migration, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 20/30] migration/multifd: Support outgoing fixed-ram stream format, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 21/30] migration/multifd: Support incoming fixed-ram stream format, Fabiano Rosas, 2023/11/27