From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4E7E3CD6137 for ; Mon, 9 Oct 2023 21:09:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpxUW-0004nf-Gp; Mon, 09 Oct 2023 17:08:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpxUV-0004mY-0h for qemu-devel@nongnu.org; Mon, 09 Oct 2023 17:08:39 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpxUR-0004O9-Jd for qemu-devel@nongnu.org; Mon, 09 Oct 2023 17:08:38 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1E0D421862; Mon, 9 Oct 2023 21:08:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1696885714; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VIDSJCUP0bgcX/Xd9VAvYlYG4M1/kLEH9fYU/u2Khsg=; b=LvszfUqSnsd7YUllNfdZwZhK24dbrqXaFOb4/WWtDhGc6nxh65PqlIDmFbcjwSrqyDRB6S vFn3fcBWr26ZVJ7tMDGbO2eCwJ5236nG62ePjWSCsm7BEfBUL7n6G7PKZyKY1hTE+g+MKD jsIBWRbSPzSVtxgSaVGzVS5QYw0Q+Cw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1696885714; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VIDSJCUP0bgcX/Xd9VAvYlYG4M1/kLEH9fYU/u2Khsg=; b=4PX38AR1cH/6gIaRZ8O1vQKAWX2KQFDSBd05NBP8mxFSHjeFuApigW7fHoKDMSK6iIC/yT KgY+xZuPjaeh1YBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A544513905; Mon, 9 Oct 2023 21:08:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WtXoG9FrJGUbTwAAMHmgww (envelope-from ); Mon, 09 Oct 2023 21:08:33 +0000 From: Fabiano Rosas To: Het Gala , qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: Re: [PATCH v12 09/10] migration: Implement MigrateChannelList to hmp migration flow. In-Reply-To: <20231009143615.86825-10-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> <20231009143615.86825-10-het.gala@nutanix.com> Date: Mon, 09 Oct 2023 18:08:31 -0300 Message-ID: <87ttqzjygg.fsf@suse.de> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=195.135.220.28; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Het Gala writes: > Integrate MigrateChannelList with all transport backends > (socket, exec and rdma) for both src and dest migration > endpoints for hmp migration. > > Suggested-by: Aravind Retnakaran > Signed-off-by: Het Gala > --- > migration/migration-hmp-cmds.c | 15 +++++++++++++-- > migration/migration.c | 5 ++--- > migration/migration.h | 3 ++- > 3 files changed, 17 insertions(+), 6 deletions(-) > > diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c > index a2e6a5c51e..21b57f7ed8 100644 > --- a/migration/migration-hmp-cmds.c > +++ b/migration/migration-hmp-cmds.c > @@ -441,9 +441,14 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *qdict) > { > Error *err = NULL; > const char *uri = qdict_get_str(qdict, "uri"); > + MigrationChannelList *caps = NULL; > + g_autoptr(MigrationChannel) channel = NULL; No g_autoptr here because the list code will already free the channel. > > - qmp_migrate_incoming(uri, false, NULL, &err); > + migrate_uri_parse(uri, &channel, &err); Need to check the return value of this function. $ (echo "migrate -d unix:") | ./qemu-system-x86_64 -monitor stdio -display none QEMU 8.1.50 monitor - type 'help' for more information (qemu) migrate -d unix: Segmentation fault (core dumped) > + QAPI_LIST_PREPEND(caps, channel); > > + qmp_migrate_incoming(NULL, true, caps, &err); > + qapi_free_MigrationChannelList(caps); > hmp_handle_error(mon, err); > } > > @@ -730,9 +735,15 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) > bool resume = qdict_get_try_bool(qdict, "resume", false); > const char *uri = qdict_get_str(qdict, "uri"); > Error *err = NULL; > + MigrationChannelList *caps = NULL; > + g_autoptr(MigrationChannel) channel = NULL; > > - qmp_migrate(uri, false, NULL, !!blk, blk, !!inc, inc, > + migrate_uri_parse(uri, &channel, &err); > + QAPI_LIST_PREPEND(caps, channel); > + > + qmp_migrate(NULL, true, caps, !!blk, blk, !!inc, inc, > false, false, true, resume, &err); > + qapi_free_MigrationChannelList(caps); > if (hmp_handle_error(mon, err)) { > return; > }