From nobody Mon Sep 21 15:57:12 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=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1784043866; cv=none; d=zohomail.com; s=zohoarc; b=ZSXYP+JjmOQkjsRXeAWLUvVwMZC7WsGNuH2ZCBt7ENSsx38MLtgZZkX4GzKpDKOgApI8AQKQod/z7TJmpiGK+L7OsHkQyrlW1OPo8xO92Gvp5oobkuuO8CndF53iO1n+N/6eXrGJsQyUqD12IQI/m15K4ZojflVE42fhiYBIOPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784043866; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cu73PT7yPvhQWzkPeGOzwE074CR4qAek7bUnSiGJNag=; b=JNTqeswonrdZW+3jA+Bqu5QhlsCzuMi8M3ke3wPVpNA91psDLAig7dddBtQBAPfaKCQ6zp5JP/1KxjOHQinfWnbzoniDfwe6UGg+FuRRqks/K2aUCgwriH8B6XYFDUY/X6LddnheTKcRH0TVuaTT639PJ7BA9I8bpujWSPmK1o0= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784043866455979.9042567776913; Tue, 14 Jul 2026 08:44:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wjfHm-0001OL-0D; Tue, 14 Jul 2026 11:43:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wjfHg-0001LF-IM for qemu-devel@nongnu.org; Tue, 14 Jul 2026 11:43:00 -0400 Received: from forwardcorp1b.mail.yandex.net ([178.154.239.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wjfHf-000845-3g for qemu-devel@nongnu.org; Tue, 14 Jul 2026 11:43:00 -0400 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c1b:16:0:640:bc52:0]) by forwardcorp1b.mail.yandex.net (postfix) with ESMTPS id C4A3E80B07; Tue, 14 Jul 2026 18:42:57 +0300 (MSK) Received: from i115954770.yandex-team.ru (unknown [2a02:6bf:8080:c5a::1:8]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp) with ESMTPSA id lgRdV71YDKo0-wmPbPaNM; Tue, 14 Jul 2026 18:42:57 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1784043777; bh=cu73PT7yPvhQWzkPeGOzwE074CR4qAek7bUnSiGJNag=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=XJObylRqL/udHwLiAJhPAitwiKLHo7eMYPxUsFVR3ZUz3240nxasfQyBmRWfOE/Kk gV00OKWIVabCdqaTPDXeWFZrQbMWyyniVvAf9qaNoVm8qT44N2heZxRqSBQRS5Ihm0 oBVgNIJv8g4plrtvMqB4TUD8lCrRUZeLAurEpOZQ= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: jasowang@redhat.com, mst@redhat.com Cc: armbru@redhat.com, peterx@redhat.com, farosas@suse.de, raphael.s.norwitz@gmail.com, bchaney@akamai.com, vsementsov@yandex-team.ru, qemu-devel@nongnu.org, berrange@redhat.com, pbonzini@redhat.com, yc-core@yandex-team.ru, mark.caveayland@nutanix.com Subject: [PATCH v19 10/15] migration/channel: check that transfer is UNIX socket when "local" set Date: Tue, 14 Jul 2026 18:42:38 +0300 Message-ID: <20260714154246.1242856-11-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260714154246.1242856-1-vsementsov@yandex-team.ru> References: <20260714154246.1242856-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=178.154.239.136; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1b.mail.yandex.net 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 List-Id: qemu development 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 @yandex-team.ru) X-ZM-MESSAGEID: 1784043868634158500 Content-Type: text/plain; charset="utf-8" As documented, for "local", the migration channel must be direct UNIX socket connection from source to target. We can't check for it being "direct", but let's at least check that we deal with UNIX socket (fd-passing supported). Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/channel.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/migration/channel.c b/migration/channel.c index 1e2935f926b..ba00dd1931d 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -214,6 +214,13 @@ void migration_channel_process_incoming(QIOChannel *io= c) trace_migration_set_incoming_channel( ioc, object_get_typename(OBJECT(ioc))); =20 + if (migrate_local() && + !qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_FD_PASS)) { + error_setg(&local_err, + "local migration requires a UNIX domain socket channel"= ); + goto out; + } + if (migrate_channel_requires_tls_upgrade(ioc)) { migration_tls_channel_process_incoming(ioc, &local_err); } else { @@ -241,6 +248,16 @@ void migration_channel_connect_outgoing(MigrationState= *s, QIOChannel *ioc) { trace_migration_set_outgoing_channel(ioc, object_get_typename(OBJECT(i= oc))); =20 + if (migrate_local() && + !qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_FD_PASS)) { + Error *local_err =3D NULL; + + error_setg(&local_err, + "local migration requires a UNIX domain socket channel"= ); + migration_connect_error_propagate(s, local_err); + return; + } + if (migrate_channel_requires_tls_upgrade(ioc)) { Error *local_err =3D NULL; =20 --=20 2.43.0