From nobody Tue Feb 10 20:28:23 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=1682343626; cv=none; d=zohomail.com; s=zohoarc; b=hcShjWM+aF3yqXUQxgYNbfqbc+zdw1XjAt1IHLAjWJjftS76NXjo5H8PmLSc3VbeesP8T2OY3xInMD2WMA12adLaeZmcABuXUNt72fVY7MUUw5GC9Owoi1oQhSrx3kAm9R9KMCBnQJ7yB1tnu8KAIPJI5GL6rsCwItYbE1xAS8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682343626; 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=mJYXepNCd+IEb9CaUQpf4FPu3H1QdSZpQwj0PKYW06k=; b=NIZz0q0UnHUv2mG1tYOcFTt+c1faJ838wqs4+giwvSgl6ZTM/aBsp1xHhdsC3nr6zsnJvnXGCqkqql22ayuBCIGB3NGwWSlH9jsTzsWgjZN94RQpDUh4BCvDHnFEHQdzto3XmD5ZcwMCrbceJZTOmd7HQOc+y/mFqBuKQmgCLIs= 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 1682343626227857.761908280998; Mon, 24 Apr 2023 06:40:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqwFt-0008CD-5V; Mon, 24 Apr 2023 09:29:21 -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 1pqwEw-0006gG-Ds for qemu-devel@nongnu.org; Mon, 24 Apr 2023 09:28:22 -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 1pqwEu-0001SC-5Y for qemu-devel@nongnu.org; Mon, 24 Apr 2023 09:28:21 -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-543-VvbAA6SbPmmBueI1CFNdXw-1; Mon, 24 Apr 2023 09:28:15 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8F6B0884EC0; Mon, 24 Apr 2023 13:28:14 +0000 (UTC) Received: from secure.mitica (unknown [10.39.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15A3B14171B8; Mon, 24 Apr 2023 13:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682342899; 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=mJYXepNCd+IEb9CaUQpf4FPu3H1QdSZpQwj0PKYW06k=; b=YlMEkIRsDRKz+IjqzFCePk+8Kam8EmxrCYW6tTDKwiMb6acQ6lIYiww+MhaBl58r2kLk5W bQ+YW99RycOGlZCFPHQL1jo3Wob7TxACDrPv0172MaWnwfoi3m5KfM7QfBDiBMfwPsIk02 Un+/3tmOgRdwMokPYjEx/8RgBrTHRZo= X-MC-Unique: VvbAA6SbPmmBueI1CFNdXw-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Hailiang Zhang , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fam Zheng , Eric Blake , John Snow , Vladimir Sementsov-Ogievskiy , Gerd Hoffmann , Peter Xu , Markus Armbruster , Leonardo Bras , David Hildenbrand , Stefan Hajnoczi , "Michael S. Tsirkin" , qemu-block@nongnu.org, Juan Quintela Subject: [PULL 13/30] migration: Move migrate_use_return() to options.c Date: Mon, 24 Apr 2023 15:27:13 +0200 Message-Id: <20230424132730.70752-14-quintela@redhat.com> In-Reply-To: <20230424132730.70752-1-quintela@redhat.com> References: <20230424132730.70752-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=unavailable 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: 1682343627310100004 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 1f8ba94fc4..b03c4aa650 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2622,15 +2622,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; @@ -4171,7 +4162,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