[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 13/29] migration: fixed-ram: Add URI compatibility check
|
From: |
Fabiano Rosas |
|
Subject: |
[PATCH v2 13/29] migration: fixed-ram: Add URI compatibility check |
|
Date: |
Mon, 23 Oct 2023 17:35:52 -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>
---
migration/migration.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 692fbc5ad6..cabb3ad3a5 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -106,22 +106,40 @@ static bool migration_needs_multiple_sockets(void)
return migrate_multifd() || migrate_postcopy_preempt();
}
+static bool migration_needs_seekable_channel(void)
+{
+ return migrate_fixed_ram();
+}
+
static bool uri_supports_multi_channels(const char *uri)
{
return strstart(uri, "tcp:", NULL) || strstart(uri, "unix:", NULL) ||
strstart(uri, "vsock:", NULL);
}
+static bool uri_supports_seeking(const char *uri)
+{
+ return strstart(uri, "file:", NULL);
+}
+
static bool
migration_channels_and_uri_compatible(const char *uri, Error **errp)
{
+ bool compatible = true;
+
+ if (migration_needs_seekable_channel() &&
+ !uri_supports_seeking(uri)) {
+ error_setg(errp, "Migration requires seekable transport (e.g. file)");
+ compatible = false;
+ }
+
if (migration_needs_multiple_sockets() &&
!uri_supports_multi_channels(uri)) {
error_setg(errp, "Migration requires multi-channel URIs (e.g. tcp)");
- return false;
+ compatible = false;
}
- return true;
+ return compatible;
}
static bool migration_should_pause(const char *uri)
--
2.35.3
- Re: [PATCH v2 06/29] migration: Add auto-pause capability, (continued)
- [PATCH v2 07/29] migration: Run "file:" migration with a stopped VM, Fabiano Rosas, 2023/10/23
- [PATCH v2 08/29] tests/qtest: File migration auto-pause tests, Fabiano Rosas, 2023/10/23
- [PATCH v2 09/29] io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file, Fabiano Rosas, 2023/10/23
- [PATCH v2 10/29] io: Add generic pwritev/preadv interface, Fabiano Rosas, 2023/10/23
- [PATCH v2 11/29] io: implement io_pwritev/preadv for QIOChannelFile, Fabiano Rosas, 2023/10/23
- [PATCH v2 12/29] migration/qemu-file: add utility methods for working with seekable channels, Fabiano Rosas, 2023/10/23
- [PATCH v2 13/29] migration: fixed-ram: Add URI compatibility check,
Fabiano Rosas <=
- [PATCH v2 14/29] migration/ram: Introduce 'fixed-ram' migration capability, Fabiano Rosas, 2023/10/23
- [PATCH v2 15/29] migration/ram: Add support for 'fixed-ram' outgoing migration, Fabiano Rosas, 2023/10/23