[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 07/30] migration: Add fixed-ram URI compatibility check
|
From: |
Fabiano Rosas |
|
Subject: |
[RFC PATCH v3 07/30] migration: Add fixed-ram URI compatibility check |
|
Date: |
Mon, 27 Nov 2023 17:25:49 -0300 |
The fixed-ram migration format needs a channel that supports seeking
to be able to write each page to an arbitrary offset in the migration
stream.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
- avoided overwriting errp in compatibility check
---
migration/migration.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/migration/migration.c b/migration/migration.c
index 28a34c9068..897ed1db67 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -135,10 +135,26 @@ static bool
transport_supports_multi_channels(SocketAddress *saddr)
saddr->type == SOCKET_ADDRESS_TYPE_VSOCK;
}
+static bool migration_needs_seekable_channel(void)
+{
+ return migrate_fixed_ram();
+}
+
+static bool transport_supports_seeking(MigrationAddress *addr)
+{
+ return addr->transport == MIGRATION_ADDRESS_TYPE_FILE;
+}
+
static bool
migration_channels_and_transport_compatible(MigrationAddress *addr,
Error **errp)
{
+ if (migration_needs_seekable_channel() &&
+ !transport_supports_seeking(addr)) {
+ error_setg(errp, "Migration requires seekable transport (e.g. file)");
+ return false;
+ }
+
if (migration_needs_multiple_sockets() &&
(addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) &&
!transport_supports_multi_channels(&addr->u.socket)) {
--
2.35.3
- [RFC PATCH v3 00/30] migration: File based migration with multifd and fixed-ram, Fabiano Rosas, 2023/11/27
- [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 <=
- [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, 2023/11/27
- [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