[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC 01/26] migration: Add x-channel-header pseudo-capability
|
From: |
Maciej S. Szmigiero |
|
Subject: |
[PATCH RFC 01/26] migration: Add x-channel-header pseudo-capability |
|
Date: |
Tue, 16 Apr 2024 16:42:40 +0200 |
From: Avihai Horon <avihaih@nvidia.com>
Add x-channel-header pseudo-capability which indicates that a header
should be sent through migration channels.
The header is the first thing to be sent through a migration channel and
it allows the destination to differentiate between the various channels
(main, multifd and preempt).
This eliminates the need to deduce the channel type by peeking in the
channel's content, which can be done only on a best-effort basis. It
will also allow other devices to create their own channels in the
future.
This patch only adds the pseudo-capability and sets it to false always.
The following patches will add the actual functionality, after which it
will be enabled..
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
---
hw/core/machine.c | 1 +
migration/migration.h | 3 +++
migration/options.c | 9 +++++++++
migration/options.h | 1 +
4 files changed, 14 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 37ede0e7d4fd..fa28c49f55b7 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -37,6 +37,7 @@ GlobalProperty hw_compat_8_2[] = {
{ "migration", "zero-page-detection", "legacy"},
{ TYPE_VIRTIO_IOMMU_PCI, "granule", "4k" },
{ TYPE_VIRTIO_IOMMU_PCI, "aw-bits", "64" },
+ { "migration", "channel_header", "off" },
};
const size_t hw_compat_8_2_len = G_N_ELEMENTS(hw_compat_8_2);
diff --git a/migration/migration.h b/migration/migration.h
index 8045e39c26fa..a6114405917f 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -450,6 +450,9 @@ struct MigrationState {
*/
uint8_t clear_bitmap_shift;
+ /* Whether a header is sent in migration channels */
+ bool channel_header;
+
/*
* This save hostname when out-going migration starts
*/
diff --git a/migration/options.c b/migration/options.c
index bfd7753b69a5..8fd871cd956d 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -100,6 +100,7 @@ Property migration_properties[] = {
clear_bitmap_shift, CLEAR_BITMAP_SHIFT_DEFAULT),
DEFINE_PROP_BOOL("x-preempt-pre-7-2", MigrationState,
preempt_pre_7_2, false),
+ DEFINE_PROP_BOOL("x-channel-header", MigrationState, channel_header, true),
/* Migration parameters */
DEFINE_PROP_UINT8("x-compress-level", MigrationState,
@@ -381,6 +382,14 @@ bool migrate_zero_copy_send(void)
/* pseudo capabilities */
+bool migrate_channel_header(void)
+{
+ MigrationState *s = migrate_get_current();
+
+ return false;
+ return s->channel_header;
+}
+
bool migrate_multifd_flush_after_each_section(void)
{
MigrationState *s = migrate_get_current();
diff --git a/migration/options.h b/migration/options.h
index ab8199e20784..1144d72ec0db 100644
--- a/migration/options.h
+++ b/migration/options.h
@@ -52,6 +52,7 @@ bool migrate_zero_copy_send(void);
* check, but they are not a capability.
*/
+bool migrate_channel_header(void);
bool migrate_multifd_flush_after_each_section(void);
bool migrate_postcopy(void);
bool migrate_rdma(void);
- [PATCH RFC 00/26] Multifd 🔀 device state transfer support with VFIO consumer, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 03/26] migration: Add send/receive header for main channel, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 01/26] migration: Add x-channel-header pseudo-capability,
Maciej S. Szmigiero <=
- [PATCH RFC 02/26] migration: Add migration channel header send/receive, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 05/26] migration: Add a DestroyNotify parameter to socket_send_channel_create(), Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 04/26] multifd: change multifd_new_send_channel_create() param type, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 06/26] multifd: pass MFDSendChannelConnectData when connecting sending socket, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 07/26] migration/postcopy: pass PostcopyPChannelConnectData when connecting sending preempt socket, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 09/26] migration: Add send/receive header for postcopy preempt channel, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 08/26] migration: Allow passing migration header in migration channel creation, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 10/26] migration: Add send/receive header for multifd channel, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 11/26] migration/options: Mapped-ram is not channel header compatible, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 12/26] migration: Enable x-channel-header pseudo-capability, Maciej S. Szmigiero, 2024/04/16