From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1JXC-0007HB-8l for qemu-devel@nongnu.org; Tue, 14 Aug 2012 12:00:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1JXB-0005HT-9m for qemu-devel@nongnu.org; Tue, 14 Aug 2012 11:59:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1JXB-0005HI-1l for qemu-devel@nongnu.org; Tue, 14 Aug 2012 11:59:57 -0400 Message-ID: <502A75F6.4020701@redhat.com> Date: Tue, 14 Aug 2012 17:59:50 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1344951151-26387-1-git-send-email-aliguori@us.ibm.com> <502A5735.1010409@redhat.com> <20120814115246.0b6ab76a@doriath.home> <502A6882.1020508@redhat.com> <20120814124849.0f747d6f@doriath.home> In-Reply-To: <20120814124849.0f747d6f@doriath.home> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block-migration: deprecate block migration for the 1.2 release List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org, Stefan Hajnoczi Am 14.08.2012 17:48, schrieb Luiz Capitulino: > On Tue, 14 Aug 2012 17:02:26 +0200 > Kevin Wolf wrote: > >> Am 14.08.2012 16:52, schrieb Luiz Capitulino: >>> On Tue, 14 Aug 2012 15:48:37 +0200 >>> Kevin Wolf wrote: >>> >>>> Am 14.08.2012 15:32, schrieb Anthony Liguori: >>>>> To be replaced with live block copy. >>>>> >>>>> Signed-off-by: Anthony Liguori >>>> >>>> Might be worth adding a deprecation note in qapi-schema.json. >>>> >>>>> --- >>>>> migration.c | 9 +++++++++ >>>>> 1 files changed, 9 insertions(+), 0 deletions(-) >>>>> >>>>> diff --git a/migration.c b/migration.c >>>>> index 653a3c1..babccf4 100644 >>>>> --- a/migration.c >>>>> +++ b/migration.c >>>>> @@ -482,10 +482,19 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, >>>>> MigrationParams params; >>>>> const char *p; >>>>> int ret; >>>>> + static bool suppress_deprecation_message; >>>>> >>>>> params.blk = blk; >>>>> params.shared = inc; >>>>> >>>>> + if (blk && !suppress_deprecation_message) { >>>> >>>> Hm, it's consistent with when we start block migration, but has_blk is >>>> completely ignored for that and blk seems to be uninitialised if >>>> !has_blk. I think this needs to be fixed. (Why does qmp-marshal.c even >>>> compile when it can use blk uninitialised...?) >>> >>> Are you referring to qmp_marshal_input_migrate()? Where does it use >>> blk uninitialized? >> >> Yes, I am. Maybe I'm missing the obvious thing, but: >> >> bool blk; >> ... >> if (has_blk) { >> visit_type_bool(v, &blk, "blk", errp); >> } >> ... >> qmp_migrate(uri, has_blk, blk, has_inc, inc, has_detach, detach, errp); >> >> If has_blk is false, blk is never assigned a value before the >> qmp_migrate() call, which uses it. > > Yes, qmp_migrate() should only use blk if has_blk is true. The point you > made above about this patch is correct. I thought you were talking about > other usages. I thought the compiler should warn about it independent of the implementation of qmp_migrate(), because strictly speaking you're already using blk in qmp_marshal_input_migrate(), even though qmp_migrate() doesn't look at the parameter. Kevin