[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V4 10/19] migration: cpr channel
From: |
Steve Sistare |
Subject: |
[PATCH V4 10/19] migration: cpr channel |
Date: |
Mon, 2 Dec 2024 05:20:02 -0800 |
Add the 'cpr' channel type, and stash the incoming cpr channel for use
in a subsequent patch.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
---
include/migration/cpr.h | 3 +++
migration/cpr.c | 15 +++++++++++++++
qapi/migration.json | 3 ++-
system/vl.c | 6 ++++++
4 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/include/migration/cpr.h b/include/migration/cpr.h
index 201d66d..e833fae 100644
--- a/include/migration/cpr.h
+++ b/include/migration/cpr.h
@@ -17,6 +17,9 @@ void cpr_save_fd(const char *name, int id, int fd);
void cpr_delete_fd(const char *name, int id);
int cpr_find_fd(const char *name, int id);
+void cpr_set_cpr_channel(MigrationChannel *channel);
+MigrationChannel *cpr_get_cpr_channel(void);
+
int cpr_state_save(MigrationChannel *channel, Error **errp);
int cpr_state_load(Error **errp);
void cpr_state_close(void);
diff --git a/migration/cpr.c b/migration/cpr.c
index 1e2878c..f4a795f 100644
--- a/migration/cpr.c
+++ b/migration/cpr.c
@@ -116,6 +116,21 @@ QIOChannel *cpr_state_ioc(void)
return qemu_file_get_ioc(cpr_state_file);
}
+static MigrationChannel *cpr_channel;
+
+void cpr_set_cpr_channel(MigrationChannel *channel)
+{
+ if (cpr_channel) {
+ qapi_free_MigrationChannel(cpr_channel);
+ }
+ cpr_channel = channel;
+}
+
+MigrationChannel *cpr_get_cpr_channel(void)
+{
+ return cpr_channel;
+}
+
int cpr_state_save(MigrationChannel *channel, Error **errp)
{
int ret;
diff --git a/qapi/migration.json b/qapi/migration.json
index a605dc2..a26960b 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1578,11 +1578,12 @@
# The migration channel-type request options.
#
# @main: Main outbound migration channel.
+# @cpr: cpr state channel.
#
# Since: 8.1
##
{ 'enum': 'MigrationChannelType',
- 'data': [ 'main' ] }
+ 'data': [ 'main', 'cpr' ] }
##
# @MigrationChannel:
diff --git a/system/vl.c b/system/vl.c
index 2c24c60..40e049e 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -77,6 +77,7 @@
#include "hw/block/block.h"
#include "hw/i386/x86.h"
#include "hw/i386/pc.h"
+#include "migration/cpr.h"
#include "migration/misc.h"
#include "migration/snapshot.h"
#include "sysemu/tpm.h"
@@ -1834,6 +1835,11 @@ static void incoming_option_parse(const char *str)
qobject_unref(obj);
visit_type_MigrationChannel(v, "channel", &channel, &error_fatal);
visit_free(v);
+
+ if (channel->channel_type == MIGRATION_CHANNEL_TYPE_CPR) {
+ cpr_set_cpr_channel(channel);
+ return;
+ }
} else if (!strcmp(str, "defer")) {
channel = NULL;
} else {
--
1.8.3.1
- Re: [PATCH V4 02/19] physmem: fd-based shared memory, (continued)
- Re: [PATCH V4 02/19] physmem: fd-based shared memory, Peter Xu, 2024/12/12
- Re: [PATCH V4 02/19] physmem: fd-based shared memory, Steven Sistare, 2024/12/13
- Re: [PATCH V4 02/19] physmem: fd-based shared memory, Steven Sistare, 2024/12/13
- Re: [PATCH V4 02/19] physmem: fd-based shared memory, Peter Xu, 2024/12/16
- Re: [PATCH V4 02/19] physmem: fd-based shared memory, Steven Sistare, 2024/12/17
- Re: [PATCH V4 02/19] physmem: fd-based shared memory, Peter Xu, 2024/12/17
- Re: [PATCH V4 02/19] physmem: fd-based shared memory, Steven Sistare, 2024/12/18
[PATCH V4 08/19] hostmem-shm: preserve for cpr, Steve Sistare, 2024/12/02
[PATCH V4 12/19] migration: VMSTATE_FD, Steve Sistare, 2024/12/02
[PATCH V4 10/19] migration: cpr channel,
Steve Sistare <=
- Re: [PATCH V4 10/19] migration: cpr channel, Markus Armbruster, 2024/12/05
- Re: [PATCH V4 10/19] migration: cpr channel, Steven Sistare, 2024/12/05
- Re: [PATCH V4 10/19] migration: cpr channel, Markus Armbruster, 2024/12/06
- Re: [PATCH V4 10/19] migration: cpr channel, Steven Sistare, 2024/12/18
- Re: [PATCH V4 10/19] migration: cpr channel, Peter Xu, 2024/12/18
- Re: [PATCH V4 10/19] migration: cpr channel, Steven Sistare, 2024/12/18
[PATCH V4 11/19] migration: SCM_RIGHTS for QEMUFile, Steve Sistare, 2024/12/02
[PATCH V4 16/19] tests/qtest: defer connection, Steve Sistare, 2024/12/02