From nobody Wed Feb 11 02:07:19 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=1683119980; cv=none; d=zohomail.com; s=zohoarc; b=WBjFTsFLyg4i2xVfiI+5zNkG6dGLLDNqj0EYKJx7B9Qnq7Y6fXiyGZcCxqwX/pKCcUC988zSQf0xI8iddHwQ+KoOwPoNXFepLw5SNoWJJblE/xvc3y4KZzt0uLaRiwLeUzCtDvJK4cx72xos+KWIuGn69QbeynYUSHku2bZTHzY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683119980; 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=hsa55xZBuHFJZOxX72dTZkydmIYhYUyHSWRB1S7J1zU=; b=no2jLP0HomwgFb/tW7upvo9MhDS56mJvhtBhmRuKo7JdI1awVtD3QL9AArfVrsyEsdh+Ow40lcVH/j1rL00bE1y10ejvNzoLURv94JMkLawh/dfh9ejxSdBra+Pk31Lzb8xnq5H+zQqHZEoWbYO4KTQ/khjWNc4f/x8T51OPeDc= 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 1683119980297296.1521887831485; Wed, 3 May 2023 06:19:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puCNw-0005RW-IK; Wed, 03 May 2023 09:19:09 -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 1puCNh-0005Np-Lm for qemu-devel@nongnu.org; Wed, 03 May 2023 09:18:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puCNg-0006jJ-5l for qemu-devel@nongnu.org; Wed, 03 May 2023 09:18:53 -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-526-pEHa9mFmMcOVFqwnAhWTWA-1; Wed, 03 May 2023 09:18:50 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A688F1875043 for ; Wed, 3 May 2023 13:18:49 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7F2EC15BAD; Wed, 3 May 2023 13:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683119931; 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=hsa55xZBuHFJZOxX72dTZkydmIYhYUyHSWRB1S7J1zU=; b=Hc7Uzxdcc0biUx3pLBumFtboQXZr5+Wn7Pi8jomIWS5LuewcnjxhLJB9hswhL4JR/uH1zh EkX6q4H2WwZwWld+1SCNTDSEwDcmyzso2aitgjQTAH15ewKx4b3f3+Tert/dEOH+emEEnK BNLKI3xm2z3ku89P8a1q9n+u5llkc5A= X-MC-Unique: pEHa9mFmMcOVFqwnAhWTWA-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Peter Xu , Juan Quintela , Leonardo Bras Subject: [PATCH v2 01/16] migration: Create migrate_rdma() Date: Wed, 3 May 2023 15:18:32 +0200 Message-Id: <20230503131847.11603-2-quintela@redhat.com> In-Reply-To: <20230503131847.11603-1-quintela@redhat.com> References: <20230503131847.11603-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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.133.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.161, 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: 1683119982398100003 Content-Type: text/plain; charset="utf-8" Helper to say if we are doing a migration over rdma. Signed-off-by: Juan Quintela --- migration/migration.h | 3 +++ migration/options.c | 7 +++++++ migration/options.h | 1 + migration/rdma.c | 4 +++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/migration/migration.h b/migration/migration.h index 3a918514e7..47fe116167 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -432,6 +432,9 @@ struct MigrationState { =20 /* QEMU_VM_VMDESCRIPTION content filled for all non-iterable devices. = */ JSONWriter *vmdesc; + + /* Is this a rdma migration */ + bool rdma_migration; }; =20 void migrate_set_state(int *state, int old_state, int new_state); diff --git a/migration/options.c b/migration/options.c index 53b7fc5d5d..39843f9325 100644 --- a/migration/options.c +++ b/migration/options.c @@ -349,6 +349,13 @@ bool migrate_postcopy(void) return migrate_postcopy_ram() || migrate_dirty_bitmaps(); } =20 +bool migrate_rdma(void) +{ + MigrationState *s =3D migrate_get_current(); + + return s->rdma_migration; +} + bool migrate_tls(void) { MigrationState *s =3D migrate_get_current(); diff --git a/migration/options.h b/migration/options.h index 3c322867cd..3c555e28c7 100644 --- a/migration/options.h +++ b/migration/options.h @@ -61,6 +61,7 @@ bool migrate_zero_copy_send(void); =20 bool migrate_multifd_flush_after_each_section(void); bool migrate_postcopy(void); +bool migrate_rdma(void); bool migrate_tls(void); =20 /* capabilities helpers */ diff --git a/migration/rdma.c b/migration/rdma.c index 7e747b2595..b026e98519 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -4119,6 +4119,7 @@ void rdma_start_incoming_migration(const char *host_p= ort, Error **errp) int ret; RDMAContext *rdma; Error *local_err =3D NULL; + MigrationState *s =3D migrate_get_current(); =20 trace_rdma_start_incoming_migration(); =20 @@ -4149,7 +4150,7 @@ void rdma_start_incoming_migration(const char *host_p= ort, Error **errp) } =20 trace_rdma_start_incoming_migration_after_rdma_listen(); - + s->rdma_migration =3D true; qemu_set_fd_handler(rdma->channel->fd, rdma_accept_incoming_migration, NULL, (void *)(intptr_t)rdma); return; @@ -4225,6 +4226,7 @@ void rdma_start_outgoing_migration(void *opaque, =20 trace_rdma_start_outgoing_migration_after_rdma_connect(); =20 + s->rdma_migration =3D true; s->to_dst_file =3D qemu_fopen_rdma(rdma, "wb"); migrate_fd_connect(s, NULL); return; --=20 2.40.0