[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/43] migration: Move qmp_migrate_set_capabilities() to options.
From: |
Juan Quintela |
Subject: |
[PATCH 16/43] migration: Move qmp_migrate_set_capabilities() to options.c |
Date: |
Thu, 2 Mar 2023 17:33:43 +0100 |
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 5c70bb3153..1dd2ccf9ee 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1220,32 +1220,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 ac9098fbfb..1436bf42c2 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -415,3 +415,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 05/43] migration: Move migrate_colo_enabled() to options.c, (continued)
- [PATCH 05/43] migration: Move migrate_colo_enabled() to options.c, Juan Quintela, 2023/03/02
- [PATCH 09/43] migration: Move migrate_use_zero_copy_send() to options.c, Juan Quintela, 2023/03/02
- [PATCH 08/43] migration: Move migrate_use_multifd() to options.c, Juan Quintela, 2023/03/02
- [PATCH 07/43] migration: Move migrate_use_events() to options.c, Juan Quintela, 2023/03/02
- [PATCH 10/43] migration: Move migrate_use_xbzrle() to options.c, Juan Quintela, 2023/03/02
- [PATCH 12/43] migration: Move migrate_use_return() to options.c, Juan Quintela, 2023/03/02
- [PATCH 11/43] migration: Move migrate_use_block() to options.c, Juan Quintela, 2023/03/02
- [PATCH 13/43] migration: Create migrate_rdma_pin_all() function, Juan Quintela, 2023/03/02
- [PATCH 15/43] migration: Move qmp_query_migrate_capabilities() to options.c, Juan Quintela, 2023/03/02
- [PATCH 14/43] migration: Move migrate_caps_check() to options.c, Juan Quintela, 2023/03/02
- [PATCH 16/43] migration: Move qmp_migrate_set_capabilities() to options.c,
Juan Quintela <=
- [PATCH 17/43] migration: Move migrate_cap_set() to options.c, Juan Quintela, 2023/03/02
- [PATCH 18/43] migration: Move parameters functions to option.c, Juan Quintela, 2023/03/02
- [PATCH 19/43] migration: Use migrate_max_postcopy_bandwidth(), Juan Quintela, 2023/03/02
- [PATCH 20/43] migration: Move migrate_use_block_incremental() to option.c, Juan Quintela, 2023/03/02
- [PATCH 21/43] migration: Create migrate_throttle_trigger_threshold(), Juan Quintela, 2023/03/02
- [PATCH 22/43] migration: Create migrate_checkpoint_delay(), Juan Quintela, 2023/03/02
- [PATCH 27/43] migration: Create migrate_cpu_throttle_tailslow() function, Juan Quintela, 2023/03/02
- [PATCH 35/43] migration: Create migrate_downtime_limit() function, Juan Quintela, 2023/03/02
- [PATCH 29/43] migration: Move migrate_postcopy() to options.c, Juan Quintela, 2023/03/02
- [PATCH 26/43] migration: Create migrate_cpu_throttle_increment() function, Juan Quintela, 2023/03/02