[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 16/43] migration: Move qmp_migrate_set_capabilities() to optio
From: |
Juan Quintela |
Subject: |
[PATCH v2 16/43] migration: Move qmp_migrate_set_capabilities() to options.c |
Date: |
Thu, 20 Apr 2023 15:39:35 +0200 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/migration.c | 26 --------------------------
migration/options.c | 26 ++++++++++++++++++++++++++
2 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index bc796879c0..854be12ca6 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1223,32 +1223,6 @@ MigrationInfo *qmp_query_migrate(Error **errp)
return info;
}
-void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
- Error **errp)
-{
- MigrationState *s = migrate_get_current();
- MigrationCapabilityStatusList *cap;
- bool new_caps[MIGRATION_CAPABILITY__MAX];
-
- if (migration_is_running(s->state)) {
- error_setg(errp, QERR_MIGRATION_ACTIVE);
- return;
- }
-
- memcpy(new_caps, s->capabilities, sizeof(new_caps));
- for (cap = params; cap; cap = cap->next) {
- new_caps[cap->value->capability] = cap->value->state;
- }
-
- if (!migrate_caps_check(s->capabilities, new_caps, errp)) {
- return;
- }
-
- for (cap = params; cap; cap = cap->next) {
- s->capabilities[cap->value->capability] = cap->value->state;
- }
-}
-
/*
* Check whether the parameters are valid. Error will be put into errp
* (if provided). Return true if valid, otherwise false.
diff --git a/migration/options.c b/migration/options.c
index ff621bdeb3..4cbe77e35a 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -413,3 +413,29 @@ MigrationCapabilityStatusList
*qmp_query_migrate_capabilities(Error **errp)
return head;
}
+
+void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
+ Error **errp)
+{
+ MigrationState *s = migrate_get_current();
+ MigrationCapabilityStatusList *cap;
+ bool new_caps[MIGRATION_CAPABILITY__MAX];
+
+ if (migration_is_running(s->state)) {
+ error_setg(errp, QERR_MIGRATION_ACTIVE);
+ return;
+ }
+
+ memcpy(new_caps, s->capabilities, sizeof(new_caps));
+ for (cap = params; cap; cap = cap->next) {
+ new_caps[cap->value->capability] = cap->value->state;
+ }
+
+ if (!migrate_caps_check(s->capabilities, new_caps, errp)) {
+ return;
+ }
+
+ for (cap = params; cap; cap = cap->next) {
+ s->capabilities[cap->value->capability] = cap->value->state;
+ }
+}
--
2.39.2
- [PATCH v2 07/43] migration: Move migrate_use_events() to options.c, (continued)
- [PATCH v2 07/43] migration: Move migrate_use_events() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 09/43] migration: Move migrate_use_zero_copy_send() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 10/43] migration: Move migrate_use_xbzrle() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 08/43] migration: Move migrate_use_multifd() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 11/43] migration: Move migrate_use_block() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 12/43] migration: Move migrate_use_return() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 13/43] migration: Create migrate_rdma_pin_all() function, Juan Quintela, 2023/04/20
- [PATCH v2 15/43] migration: Move qmp_query_migrate_capabilities() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 16/43] migration: Move qmp_migrate_set_capabilities() to options.c,
Juan Quintela <=
- [PATCH v2 17/43] migration: Move migrate_cap_set() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 18/43] migration: Move parameters functions to option.c, Juan Quintela, 2023/04/20
- [PATCH v2 14/43] migration: Move migrate_caps_check() to options.c, Juan Quintela, 2023/04/20
- [PATCH v2 19/43] migration: Use migrate_max_postcopy_bandwidth(), Juan Quintela, 2023/04/20
- [PATCH v2 20/43] migration: Move migrate_use_block_incremental() to option.c, Juan Quintela, 2023/04/20