From 1bda8b3c6950f74482ba19e8529db72b511ba977 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 18 Jul 2017 13:42:11 +0200 Subject: migration: Unshare MigrationParameters struct for now Commit de63ab6 "migrate: Share common MigrationParameters struct" reused MigrationParameters for the arguments of migrate-set-parameters, with the following rationale: It is rather verbose, and slightly error-prone, to repeat the same set of parameters for input (migrate-set-parameters) as for output (query-migrate-parameters), where the only difference is whether the members are optional. We can just document that the optional members will always be present on output, and then share a common struct between both commands. The next patch can then reduce the amount of code needed on input. I need to unshare them to correct a design flaw in a stupid, but minimally invasive way, in the next commit. We can restore the sharing when we redo that patch in a less stupid way. Add a suitable TODO comment. Note that I revert only the sharing part of commit de63ab6, not the part that made the members of query-migrate-parameters' result optional. The schema (and thus introspection) remains inaccurate for query-migrate-parameters. If we decide not to restore the sharing, we should revert that part, too. Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrange Reviewed-by: Eric Blake --- hmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hmp.c') diff --git a/hmp.c b/hmp.c index d7b4727910..4b6b1149bb 100644 --- a/hmp.c +++ b/hmp.c @@ -1556,7 +1556,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) const char *param = qdict_get_str(qdict, "parameter"); const char *valuestr = qdict_get_str(qdict, "value"); Visitor *v = string_input_visitor_new(valuestr); - MigrationParameters *p = g_new0(MigrationParameters, 1); + MigrateSetParameters *p = g_new0(MigrateSetParameters, 1); uint64_t valuebw = 0; Error *err = NULL; int i, ret; @@ -1634,7 +1634,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) } cleanup: - qapi_free_MigrationParameters(p); + qapi_free_MigrateSetParameters(p); visit_free(v); if (err) { error_report_err(err); -- cgit v1.2.3