From nobody Tue Feb 10 13:16:39 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1681998138; cv=none; d=zohomail.com; s=zohoarc; b=BsuO/3h0H5Jo66oOm2heoJ/6tjnlFlsFywrWdE/3WO79gN8P5m3nfKFTq9S2PcB2nuPDCrLVJz68EhtJVrrF+DpolGFlWUr/H8zg27uAqvbz3PT6NU8cvJpcC/F3cuXavc9PSPe2zvO8XEb/swX+JRiUMeG3BUKtaBVcL7+xU6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681998138; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9VTc5hKgcUPKvZc1WyTdjgpOdDhsu9ZZFegrwamUFaE=; b=ZiaEdgP/pvrhy8Zwdf9FrTLyaUSdVq7BkR1nZWH2OaMJ1LCLIApUW5oGml/Tu81HulcjUPcwdSXUdsycWDAUXqQhNZXTzT9+upSkPWBqOxPXHSeVt+hNqROnzZyixPI8m5iK6IV2hUJu3XcG8hmMAcYH4ZEWY527jYtKOq+JQGU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681998138002266.5768382249846; Thu, 20 Apr 2023 06:42:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppUWn-00046K-34; Thu, 20 Apr 2023 09:40:49 -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 1ppUWk-00045A-Hn for qemu-devel@nongnu.org; Thu, 20 Apr 2023 09:40:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppUWh-0005pC-Hj for qemu-devel@nongnu.org; Thu, 20 Apr 2023 09:40:46 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-201-fK8YLe8EPtyS96AHkTzPCg-1; Thu, 20 Apr 2023 09:40:41 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4849A811E7C; Thu, 20 Apr 2023 13:40:41 +0000 (UTC) Received: from secure.mitica (unknown [10.39.192.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id A845C4020BF1; Thu, 20 Apr 2023 13:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681998043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9VTc5hKgcUPKvZc1WyTdjgpOdDhsu9ZZFegrwamUFaE=; b=M+AC157HqABen2NkqMOsSy85Fi/TncqgUfXbEBVFTTnlauhoyiIGQRppWdRrdxLScvlsQn PuFj+tbD6aIsnWfyGbqDJTfxF7asvU6CtQpUagz+EqObc6R62FYkXd79apxjDIyafpZZFb pxmMIZ/NGt2X+R4HLVztsEegan1iiFo= X-MC-Unique: fK8YLe8EPtyS96AHkTzPCg-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , David Hildenbrand , John Snow , Fam Zheng , Hailiang Zhang , "Michael S. Tsirkin" , qemu-block@nongnu.org, Gerd Hoffmann , Vladimir Sementsov-Ogievskiy , Leonardo Bras , Markus Armbruster , Stefan Hajnoczi , Juan Quintela , Eric Blake Subject: [PATCH v2 12/43] migration: Move migrate_use_return() to options.c Date: Thu, 20 Apr 2023 15:39:31 +0200 Message-Id: <20230420134002.29531-13-quintela@redhat.com> In-Reply-To: <20230420134002.29531-1-quintela@redhat.com> References: <20230420134002.29531-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1681998139395100003 Content-Type: text/plain; charset="utf-8" Once that we are there, we rename the function to migrate_return_path() to be consistent with all other capabilities. Signed-off-by: Juan Quintela Reviewed-by: Vladimir Sementsov-Ogievskiy --- migration/migration.c | 11 +---------- migration/migration.h | 1 - migration/options.c | 9 +++++++++ migration/options.h | 1 + migration/rdma.c | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 1d0fe27b92..f907e17d65 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2623,15 +2623,6 @@ static int64_t migrate_max_postcopy_bandwidth(void) return s->parameters.max_postcopy_bandwidth; } =20 -bool migrate_use_return_path(void) -{ - MigrationState *s; - - s =3D migrate_get_current(); - - return s->capabilities[MIGRATION_CAPABILITY_RETURN_PATH]; -} - bool migrate_use_block_incremental(void) { MigrationState *s; @@ -4176,7 +4167,7 @@ void migrate_fd_connect(MigrationState *s, Error *err= or_in) * precopy, only if user specified "return-path" capability would * QEMU uses the return path. */ - if (migrate_postcopy_ram() || migrate_use_return_path()) { + if (migrate_postcopy_ram() || migrate_return_path()) { if (open_return_path_on_source(s, !resume)) { error_report("Unable to open return-path for postcopy"); migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED= ); diff --git a/migration/migration.h b/migration/migration.h index d4b68b08a5..24184622a8 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -459,7 +459,6 @@ uint64_t migrate_xbzrle_cache_size(void); =20 bool migrate_use_block_incremental(void); int migrate_max_cpu_throttle(void); -bool migrate_use_return_path(void); =20 uint64_t ram_get_total_transferred_pages(void); =20 diff --git a/migration/options.c b/migration/options.c index fe1eadeed6..2003e413da 100644 --- a/migration/options.c +++ b/migration/options.c @@ -147,6 +147,15 @@ bool migrate_release_ram(void) return s->capabilities[MIGRATION_CAPABILITY_RELEASE_RAM]; } =20 +bool migrate_return_path(void) +{ + MigrationState *s; + + s =3D migrate_get_current(); + + return s->capabilities[MIGRATION_CAPABILITY_RETURN_PATH]; +} + bool migrate_validate_uuid(void) { MigrationState *s; diff --git a/migration/options.h b/migration/options.h index e985a5233e..316efd1063 100644 --- a/migration/options.h +++ b/migration/options.h @@ -31,6 +31,7 @@ bool migrate_postcopy_blocktime(void); bool migrate_postcopy_preempt(void); bool migrate_postcopy_ram(void); bool migrate_release_ram(void); +bool migrate_return_path(void); bool migrate_validate_uuid(void); bool migrate_xbzrle(void); bool migrate_zero_blocks(void); diff --git a/migration/rdma.c b/migration/rdma.c index f35f021963..bf55e2f163 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3373,7 +3373,7 @@ static int qemu_rdma_accept(RDMAContext *rdma) * initialize the RDMAContext for return path for postcopy after first * connection request reached. */ - if ((migrate_postcopy() || migrate_use_return_path()) + if ((migrate_postcopy() || migrate_return_path()) && !rdma->is_return_path) { rdma_return_path =3D qemu_rdma_data_init(rdma->host_port, NULL); if (rdma_return_path =3D=3D NULL) { @@ -3456,7 +3456,7 @@ static int qemu_rdma_accept(RDMAContext *rdma) } =20 /* Accept the second connection request for return path */ - if ((migrate_postcopy() || migrate_use_return_path()) + if ((migrate_postcopy() || migrate_return_path()) && !rdma->is_return_path) { qemu_set_fd_handler(rdma->channel->fd, rdma_accept_incoming_migrat= ion, NULL, @@ -4193,7 +4193,7 @@ void rdma_start_outgoing_migration(void *opaque, } =20 /* RDMA postcopy need a separate queue pair for return path */ - if (migrate_postcopy() || migrate_use_return_path()) { + if (migrate_postcopy() || migrate_return_path()) { rdma_return_path =3D qemu_rdma_data_init(host_port, errp); =20 if (rdma_return_path =3D=3D NULL) { --=20 2.39.2