From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etItH-0008A1-3O for qemu-devel@nongnu.org; Tue, 06 Mar 2018 15:08:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etItD-0002vJ-Pn for qemu-devel@nongnu.org; Tue, 06 Mar 2018 15:08:51 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36614 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1etItD-0002uW-Kr for qemu-devel@nongnu.org; Tue, 06 Mar 2018 15:08:47 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBF3D84221 for ; Tue, 6 Mar 2018 20:08:42 +0000 (UTC) Date: Tue, 6 Mar 2018 20:08:37 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20180306200837.GQ3096@work-vm> References: <20180305094938.31374-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180305094938.31374-1-peterx@redhat.com> Subject: Re: [Qemu-devel] [PATCH] migration: fix applying wrong capabilities List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu Cc: qemu-devel@nongnu.org, Laurent Vivier , Juan Quintela * Peter Xu (peterx@redhat.com) wrote: > When setting migration capabilities via QMP/HMP, we'll apply them even > if the capability check failed. Fix it. > > Fixes: 4a84214ebe ("migration: provide migrate_caps_check()", 2017-07-18) > Signed-off-by: Peter Xu OK, yes, that works, so: Reviewed-by: Dr. David Alan Gilbert It is a little odd in a way; 'caps_check' you might expect only checked and didn't change anything. migrate_params is organised a bit differently; and somewhat more confusingly. Dave > --- > migration/migration.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/migration/migration.c b/migration/migration.c > index 0aa596f867..88ed9375aa 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -747,13 +747,15 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, > { > MigrationState *s = migrate_get_current(); > MigrationCapabilityStatusList *cap; > + bool cap_list[MIGRATION_CAPABILITY__MAX]; > > if (migration_is_setup_or_active(s->state)) { > error_setg(errp, QERR_MIGRATION_ACTIVE); > return; > } > > - if (!migrate_caps_check(s->enabled_capabilities, params, errp)) { > + memcpy(cap_list, s->enabled_capabilities, sizeof(cap_list)); > + if (!migrate_caps_check(cap_list, params, errp)) { > return; > } > > -- > 2.14.3 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK