From nobody Sat Nov 15 15:41:04 2025 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=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1749675417; cv=none; d=zohomail.com; s=zohoarc; b=Dt1/m2fsw9J/U2apFiMdt6fW9FM4yr0G0N42jJRjsN/hrrMIpGeC9KWkq9j8QUs8fHT5rX8naFhD8Cvj1uxW/7queTuDaQaHitJzK1BN7Wp7oV32B3gQYKiG8rCRWT5eA3GMB0BaVUnxjWHvcqphSvXEon0F7RXn5qWylZZT304= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749675417; 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=Mswh5nueCy3LAz2LBvKivVe8OCxj8xvKFfxe/TzA+Fo=; b=BSs9K/twdK1nfv9UwlrI0InLU9h5l38/LL8HlNC4sKYNAoqRkYJ1Dv9DSm/CjCp2oPvqsEDKt0GwJBgcPfYsYq3egSECpi31yr5l+sT6laFWG9jHkP7sd8TKtUUtLMqUrlPaqWzc5MHfKajf/xT6MjKNFKEoGX/ZHXcB1+NegTc= 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=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749675417567872.7271535432013; Wed, 11 Jun 2025 13:56:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPSUi-0000Pk-E4; Wed, 11 Jun 2025 16:56:24 -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 1uPSUf-0000PK-SO for qemu-devel@nongnu.org; Wed, 11 Jun 2025 16:56:21 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPSUe-0002VS-CO for qemu-devel@nongnu.org; Wed, 11 Jun 2025 16:56:21 -0400 Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55BFjZ0k003285; Wed, 11 Jun 2025 20:56:16 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 474bup6v88-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Jun 2025 20:56:15 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 55BHEAsP015331; Wed, 11 Jun 2025 20:56:15 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4750rp9gey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Jun 2025 20:56:15 +0000 Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 55BKuEep33686024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Jun 2025 20:56:14 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 02F2458062; Wed, 11 Jun 2025 20:56:14 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4C3858052; Wed, 11 Jun 2025 20:56:13 +0000 (GMT) Received: from IBM-GLTZVH3.ibm.com (unknown [9.61.250.224]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Jun 2025 20:56:13 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=Mswh5nueCy3LAz2LB vKivVe8OCxj8xvKFfxe/TzA+Fo=; b=gRd6ONOXrlOgLtamxTsz8HoPuMbjFhbqf 6U5voPGF4TsuJ4otMtOjFLWV1A+GCIkv5hNDEFlo1kVUjWInHvscwq0E83Wd9Swm pRoZaHRGdgmLER6yKpbJid2KKgW5d7DS0oP0hQI93IxbefmCPVst26z10A6oy9tm IehAiO68BAs5V1QjrAO416Hpgjkk1djrPS6oM2RD3O+GiyK/Ki6qhMzQEJzgTdZK pmnuNvUuwnhacYmcuGPUjhTyDJNRBV3xnK6pxbPsTLNHTAOvG/lBK8jpy7DXwbZY DQyck16Dp3NY+WwfvFD/9hlEAG/YrkHjZWtmHsIzd8QIL7fXRIG3g== From: Jaehoon Kim To: qemu-devel@nongnu.org Cc: jjherne@linux.ibm.com, steven.sistare@oracle.com, peterx@redhat.com, farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com, Jaehoon Kim Subject: [PATCH v4 1/2] tests/migration: Setup pre-listened cpr.sock to remove race-condition. Date: Wed, 11 Jun 2025 15:56:09 -0500 Message-ID: <20250611205610.147008-2-jhkim@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250611205610.147008-1-jhkim@linux.ibm.com> References: <20250611205610.147008-1-jhkim@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=H4Hbw/Yi c=1 sm=1 tr=0 ts=6849ed70 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=6IFa9wvqVegA:10 a=VnNF1IyMAAAA:8 a=1FARfR5wGGNNaKhV8jsA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjExMDE3NiBTYWx0ZWRfX2wxlWrkyPg4n W8KgWqP9rzNZOe95sAleey9UTj1uA32zYzizeUgvPx9NjQu25iu1TO9K8m7UIdAP27QdV5YZmRZ ho8S75YL0qACAoUvES4t3QguPiZ6yumA2IblBfyou2ct7HrNy/N9u7LemRm+3uHMALnF5ccZNX1 mW+5PdAUWzTQ0hd//SQLnY9lHCD79UbDlcLTJv/+Rsf91ekuCLmdlH3VdkZuVYRE4SRriCLv9Ep TDvkwCngIXTHK3bn7cokB1+vFIS6uAYrlk5IcBdTiP1wgTTVqrfyJ9RETDVNW8+pJOy97aFfc/i 6kMlONQ8lEYlwAeIPpolC8Cs+W6JPy2uEjU6BTkldrmPDv50OGnJwvQEVQW4Xe3UjJUI3pzY9CQ D7xHsRb36+qt1DUfGTW0SyaATvQ18MWt38P9XoavyOahpYwI2QMhJG1HA30tavVNTK9n+ptk X-Proofpoint-GUID: 0ulpgCdD5wP1o5aLxcFrDZE7XvZkkHai X-Proofpoint-ORIG-GUID: 0ulpgCdD5wP1o5aLxcFrDZE7XvZkkHai X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-11_09,2025-06-10_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=999 phishscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 priorityscore=1501 malwarescore=0 mlxscore=0 impostorscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506110176 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=148.163.158.5; envelope-from=jhkim@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1749675419524116600 Content-Type: text/plain; charset="utf-8" When the source VM attempts to connect to the destination VM's Unix domain socket (cpr.sock) during a cpr-transfer test, race conditions can occur if the socket file isn't ready. This can lead to connection failures when running tests. This patch creates and listens on the socket in advance, and passes the pre-listened FD directly. This avoids timing issues and improves the reliability of CPR tests. Reviewed-by: Jason J. Herne Signed-off-by: Jaehoon Kim Reviewed-by: Steve Sistare --- tests/qtest/migration/cpr-tests.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/qtest/migration/cpr-tests.c b/tests/qtest/migration/cpr-= tests.c index 5536e14610..f7bd5c4666 100644 --- a/tests/qtest/migration/cpr-tests.c +++ b/tests/qtest/migration/cpr-tests.c @@ -60,13 +60,12 @@ static void test_mode_transfer_common(bool incoming_def= er) g_autofree char *cpr_path =3D g_strdup_printf("%s/cpr.sock", tmpfs); g_autofree char *mig_path =3D g_strdup_printf("%s/migsocket", tmpfs); g_autofree char *uri =3D g_strdup_printf("unix:%s", mig_path); + g_autofree char *opts_target; =20 const char *opts =3D "-machine aux-ram-share=3Don -nodefaults"; g_autofree const char *cpr_channel =3D g_strdup_printf( "cpr,addr.transport=3Dsocket,addr.type=3Dunix,addr.path=3D%s", cpr_path); - g_autofree char *opts_target =3D g_strdup_printf("-incoming %s %s", - cpr_channel, opts); =20 g_autofree char *connect_channels =3D g_strdup_printf( "[ { 'channel-type': 'main'," @@ -75,6 +74,17 @@ static void test_mode_transfer_common(bool incoming_defe= r) " 'path': '%s' } } ]", mig_path); =20 + /* + * Set up a UNIX domain socket for the CPR channel before + * launching the destination VM, to avoid timing issues + * during connection setup. + */ + int cpr_sockfd =3D qtest_socket_server(cpr_path); + g_assert(cpr_sockfd >=3D 0); + + opts_target =3D g_strdup_printf("-incoming cpr,addr.transport=3Dsocket= ," + "addr.type=3Dfd,addr.str=3D%d %s", + cpr_sockfd, opts); MigrateCommon args =3D { .start.opts_source =3D opts, .start.opts_target =3D opts_target, --=20 2.49.0 From nobody Sat Nov 15 15:41:04 2025 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=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1749675435; cv=none; d=zohomail.com; s=zohoarc; b=cOk9djn7b9JBUcQli+YK37alLS41xTJIzk2wwxolXfSyEHzC2RINIgJle1hI1ZxM/gVssOUvuTOUViby7UW4NwEy9S4PlBUb5kU0tm5qXqRevA8QMm/OXP3I3Ii6uos51PJz8Y5mj4FCD9/1frqNFw2UWPdBcS9Ey2vMJqZPcuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1749675435; 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=EwhT7yFCHYOSgNhdI0I49iMI9qQt6+N8eYJhE0kPcOA=; b=XvhmE9RMsY6yEXOToECmbJa7yU5IyD8u81iTHDyhj7Sc5/zz++GL9tfxXL7dFRVLM6mJAR0RSbJ4DExngfxxxZBnotfR3evAjP+QOJOc+gp+b8M8UYxqBzAAnodbvVFnzlfvTxtO0BzP0++cIOH9VhoFJdnoxzjG/nQCAOELQEw= 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=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1749675435398303.98386438735815; Wed, 11 Jun 2025 13:57:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uPSUj-0000Pu-4o; Wed, 11 Jun 2025 16:56:25 -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 1uPSUg-0000Pb-Ij for qemu-devel@nongnu.org; Wed, 11 Jun 2025 16:56:22 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPSUe-0002VW-CL for qemu-devel@nongnu.org; Wed, 11 Jun 2025 16:56:22 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55BFFGhf018219; Wed, 11 Jun 2025 20:56:16 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 474x4mc21m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Jun 2025 20:56:16 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 55BK3wTx015191; Wed, 11 Jun 2025 20:56:15 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 474yrthr72-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Jun 2025 20:56:15 +0000 Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 55BKuFuQ27329104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Jun 2025 20:56:15 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F0DB158052; Wed, 11 Jun 2025 20:56:14 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BF22C5805A; Wed, 11 Jun 2025 20:56:14 +0000 (GMT) Received: from IBM-GLTZVH3.ibm.com (unknown [9.61.250.224]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Jun 2025 20:56:14 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=EwhT7yFCHYOSgNhdI 0I49iMI9qQt6+N8eYJhE0kPcOA=; b=mm5wchDDjzjhGuBAJmekVMoxKuAEdW7ys R1EQnLCYUhrkQN9HB3ZY2r7pYUhigzr3VXli/N41oOfvyBIoJNMINZkorLIfDten 6CIvNxMMn5F5cWN9UF2gqG8e73jsOTLrc6xmubMVQ51jO+h5w3PuAd2VWBZR/qWk MAYZGE+zysROKEAG1hSHzHxmrf66IHHrhA3c+5U744gea3YXO0vsKIpbRWGjEkbf Xm+ssd018i/54Ol73axWZ3u834gF945ttHNllQXLb8Fd8EHRNlh4A0g/y5kHaXv6 iAa3ti1/vRDK7q9dW6uaX8T6LPsZtRj1NzYTRtf+iojeGwP2gmgQA== From: Jaehoon Kim To: qemu-devel@nongnu.org Cc: jjherne@linux.ibm.com, steven.sistare@oracle.com, peterx@redhat.com, farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com, Jaehoon Kim Subject: [PATCH v4 2/2] migration: Support fd-based socket address in cpr_transfer_input Date: Wed, 11 Jun 2025 15:56:10 -0500 Message-ID: <20250611205610.147008-3-jhkim@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250611205610.147008-1-jhkim@linux.ibm.com> References: <20250611205610.147008-1-jhkim@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=Y4X4sgeN c=1 sm=1 tr=0 ts=6849ed70 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=6IFa9wvqVegA:10 a=VnNF1IyMAAAA:8 a=yPCof4ZbAAAA:8 a=6c5nva-bPeITNSsYfMAA:9 X-Proofpoint-GUID: 3W1XFt0u23ahLTPSEd2vmreS-mS4U-VM X-Proofpoint-ORIG-GUID: 3W1XFt0u23ahLTPSEd2vmreS-mS4U-VM X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjExMDE3NiBTYWx0ZWRfXzO3byzQl2gVw NM2t3USDRm928BvKvXHFF0IUKbcUTOXVXh9Idi27TNxZ6ayZkel0Ry8wvCnUgMmekMz65hebA/u 64iV0EEpzE0Qsvs4fx6gBGv5zSUdijlT0K5/FYDODlSqMvrRH3Hj4i2skbNVAeEswvf8wG2VMfi V2PDHKuKgsFWszgP0tOt58UE9Cs4AfbYRbtqUvAQmrTXGzFMjYVERwPY4JKLbo6u3bS6axHPeWP jK2Ij/n6Pf+W1bTwy0FEB/Sh8rkwNs7S65ak1fL3ksa+KIj8pcuUjoyXQHNe/HQFST99wr93wG3 Bt+H0ZjEtYMTMvaFpbYJxugmE5KhiKnVWr6Jr4JZM+bbICe2msNJ87NqWy4gcwkMCEm3ngPmOQ8 1xtfP3R6P6Ysnmv1pR2e8VoaC+6XBdm4J2jQKm97EC0UeqOchLlShBdrDMACBR189L/QYPBV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-11_09,2025-06-10_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 bulkscore=0 adultscore=0 impostorscore=0 suspectscore=0 phishscore=0 mlxscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506110176 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=148.163.158.5; envelope-from=jhkim@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1749675437107116600 Content-Type: text/plain; charset="utf-8" Extend cpr_transfer_input to handle SOCKET_ADDRESS_TYPE_FD alongside SOCKET_ADDRESS_TYPE_UNIX. This change supports the use of pre-listened socket file descriptors for cpr migration channels. This change is particularly useful in qtest environments, where the socket may be created externally and passed via fd. Reviewed-by: Jason J. Herne Reviewed-by: Steve Sistare Signed-off-by: Jaehoon Kim --- migration/cpr-transfer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/cpr-transfer.c b/migration/cpr-transfer.c index e1f140359c..00371d17c3 100644 --- a/migration/cpr-transfer.c +++ b/migration/cpr-transfer.c @@ -46,7 +46,8 @@ QEMUFile *cpr_transfer_input(MigrationChannel *channel, E= rror **errp) MigrationAddress *addr =3D channel->addr; =20 if (addr->transport =3D=3D MIGRATION_ADDRESS_TYPE_SOCKET && - addr->u.socket.type =3D=3D SOCKET_ADDRESS_TYPE_UNIX) { + (addr->u.socket.type =3D=3D SOCKET_ADDRESS_TYPE_UNIX || + addr->u.socket.type =3D=3D SOCKET_ADDRESS_TYPE_FD)) { =20 g_autoptr(QIOChannelSocket) sioc =3D NULL; SocketAddress *saddr =3D &addr->u.socket; @@ -60,7 +61,9 @@ QEMUFile *cpr_transfer_input(MigrationChannel *channel, E= rror **errp) =20 sioc =3D qio_net_listener_wait_client(listener); ioc =3D QIO_CHANNEL(sioc); - trace_cpr_transfer_input(addr->u.socket.u.q_unix.path); + trace_cpr_transfer_input( + addr->u.socket.type =3D=3D SOCKET_ADDRESS_TYPE_UNIX ? + addr->u.socket.u.q_unix.path : addr->u.socket.u.fd.str); qio_channel_set_name(ioc, "cpr-in"); return qemu_file_new_input(ioc); =20 --=20 2.49.0