From nobody Tue Nov 26 13:27:19 2024 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=1707156905; cv=none; d=zohomail.com; s=zohoarc; b=GifQ5/2U31NexvPuK0J1T1BxCl2H4OfBlfSqyaK1Dptran+rEbtBlvPd17pbKzU6e6xChOE4QRIXGh0CYHhRrAOO2xaxy8icnoLTQzz6epfT8Os40z0RwLHDLRUZXrn7T6i/c4Z7ckAQmllPYGTa+RCTeyab4YC2GbW7PHpHOIY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707156905; 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=d6mFtn0PQZTKA+LX0i1nzkmshbEStQbBoU8E7zQM+zY=; b=KhHudJw0KXiM7YN/pzu6DEaD1clZHJfPWiW1+IEVp6vVQKFB32HM+w0N8j6km2P9EQSlYM21PdupIz3j8Csfu4nj3W72sWgxgCMs2m1JnKtfnsILkU69nUFTAKEegmEEX7ZwDsijYWX9wvHq0VybxlRyZWvehkO6ibNQ1Xsvvw8= 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 1707156905120477.84723300898986; Mon, 5 Feb 2024 10:15:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rX3Tu-00060h-Bi; Mon, 05 Feb 2024 13:14:10 -0500 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 1rX3Ts-00060N-Co for qemu-devel@nongnu.org; Mon, 05 Feb 2024 13:14:08 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rX3Tq-0005vA-BN for qemu-devel@nongnu.org; Mon, 05 Feb 2024 13:14:08 -0500 Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 415I1vAc000499; Mon, 5 Feb 2024 18:14:00 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w34kj89ch-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:13:59 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 415I2S0V002061; Mon, 5 Feb 2024 18:13:59 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 3w34kj89c6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:13:59 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 415Fs5sw019996; Mon, 5 Feb 2024 18:13:58 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3w1ytstd8h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:13:58 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 415IDuT965929700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Feb 2024 18:13:56 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5072F20043; Mon, 5 Feb 2024 18:13:56 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9DB0220040; Mon, 5 Feb 2024 18:13:55 +0000 (GMT) Received: from heavy.ibm.com (unknown [9.171.57.170]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 5 Feb 2024 18:13:55 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=d6mFtn0PQZTKA+LX0i1nzkmshbEStQbBoU8E7zQM+zY=; b=lFuLR03TqLJyWJLOr17u9f6no7D/XbRQcZx/AXZ0i7oIWQA1TQpjFNs+uVxVs5S3sDEs 55MpG0f0X5PA0FTBtur0g/5ndJbYCbsxLKoCYm3WAwm1GyMT6RvaOi63sJZOHRpB/Tzs yEB4aY2gsyfHVZ7VHZMuOhhap6FypTM5bFNXIx+sHxnVkYK4YUff38tScQv+2OLmTMK3 i25lUYM3Xs+LUsK5hc+7oU70DPjpFp/X61qgsiQNapbQLzid4bNeEUM7j63WJJMDyHsy N/iezkiR0VJtgI2BFoSnOLxIq7yUwqRcOXHHr3agRZoa9OB4zCni5+Yy6Xci6iS/t/Jl bQ== From: Ilya Leoshkevich To: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Ed Maste , Li-Wen Hsu , Warner Losh Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal , Kyle Evans , qemu-devel@nongnu.org, Ilya Leoshkevich Subject: [PATCH v2 1/4] tests/vm: Set UseDNS=no in the sshd configuration Date: Mon, 5 Feb 2024 19:11:32 +0100 Message-ID: <20240205181352.1567-2-iii@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205181352.1567-1-iii@linux.ibm.com> References: <20240205181352.1567-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 30peAc-LUQ37HLHZ1PmoO2U_D7Jg2Tjl X-Proofpoint-ORIG-GUID: Oo5UJMC20dmEmObSxYccbLn1c7EiRJCi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-05_12,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=999 adultscore=0 clxscore=1015 mlxscore=0 impostorscore=0 spamscore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402050137 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.156.1; envelope-from=iii@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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 @ibm.com) X-ZM-MESSAGEID: 1707156906509100002 Content-Type: text/plain; charset="utf-8" make vm-build-freebsd sometimes fails with "Connection timed out during banner exchange". The client strace shows: 13:59:30 write(3, "SSH-2.0-OpenSSH_9.3\r\n", 21) =3D 21 13:59:30 getpid() =3D 252655 13:59:30 poll([{fd=3D3, events=3DPOLLIN}], 1, 5000) =3D 1 ([{fd=3D3, re= vents=3DPOLLIN}]) 13:59:32 read(3, "S", 1) =3D 1 13:59:32 poll([{fd=3D3, events=3DPOLLIN}], 1, 3625) =3D 1 ([{fd=3D3, re= vents=3DPOLLIN}]) 13:59:32 read(3, "S", 1) =3D 1 13:59:32 poll([{fd=3D3, events=3DPOLLIN}], 1, 3625) =3D 1 ([{fd=3D3, re= vents=3DPOLLIN}]) 13:59:32 read(3, "H", 1) =3D 1 There is a 2s delay during connection, and ConnectTimeout is set to 1. Raising it makes the issue go away, but we can do better. The server truss shows: 888: 27.811414714 socket(PF_INET,SOCK_DGRAM|SOCK_CLOEXEC,0) =3D 5 (0x5) 888: 27.811765030 connect(5,{ AF_INET 10.0.2.3:53 },16) =3D 0 (0x0) 888: 27.812166941 sendto(5,"\^Z/\^A\0\0\^A\0\0\0\0\0\0\^A2"...,39,0,NUL= L,0) =3D 39 (0x27) 888: 29.363970743 poll({ 5/POLLRDNORM },1,5000) =3D 1 (0x1) So the delay is due to a DNS query. Disable DNS queries in the server config. Reviewed-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/vm/basevm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 61725b83254..c0d62c08031 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -396,60 +396,62 @@ def console_consume(self): self.console_log(output) vm.console_socket.setblocking(1) =20 def console_send(self, command): vm =3D self._guest if self.debug: logline =3D re.sub("\n", "", command) logline =3D re.sub("[\x00-\x1f]", ".", logline) sys.stderr.write("con send: %s\n" % logline) for char in list(command): vm.console_socket.send(char.encode("utf-8")) time.sleep(0.01) =20 def console_wait_send(self, wait, command): self.console_wait(wait) self.console_send(command) =20 def console_ssh_init(self, prompt, user, pw): sshkey_cmd =3D "echo '%s' > .ssh/authorized_keys\n" \ % self._config['ssh_pub_key'].rstrip() self.console_wait_send("login:", "%s\n" % user) self.console_wait_send("Password:", "%s\n" % pw) self.console_wait_send(prompt, "mkdir .ssh\n") self.console_wait_send(prompt, sshkey_cmd) self.console_wait_send(prompt, "chmod 755 .ssh\n") self.console_wait_send(prompt, "chmod 644 .ssh/authorized_key= s\n") =20 def console_sshd_config(self, prompt): self.console_wait(prompt) self.console_send("echo 'PermitRootLogin yes' >> /etc/ssh/sshd_con= fig\n") + self.console_wait(prompt) + self.console_send("echo 'UseDNS no' >> /etc/ssh/sshd_config\n") for var in self.envvars: self.console_wait(prompt) self.console_send("echo 'AcceptEnv %s' >> /etc/ssh/sshd_config= \n" % var) =20 def print_step(self, text): sys.stderr.write("### %s ...\n" % text) =20 def wait_ssh(self, wait_root=3DFalse, seconds=3D300, cmd=3D"exit 0"): # Allow more time for VM to boot under TCG. if not kvm_available(self.arch): seconds *=3D self.tcg_timeout_multiplier starttime =3D datetime.datetime.now() endtime =3D starttime + datetime.timedelta(seconds=3Dseconds) cmd_success =3D False while datetime.datetime.now() < endtime: if wait_root and self.ssh_root(cmd) =3D=3D 0: cmd_success =3D True break elif self.ssh(cmd) =3D=3D 0: cmd_success =3D True break seconds =3D (endtime - datetime.datetime.now()).total_seconds() logging.debug("%ds before timeout", seconds) time.sleep(1) if not cmd_success: raise Exception("Timeout while waiting for guest ssh") =20 def shutdown(self): self._guest.shutdown(timeout=3Dself._shutdown_timeout) =20 --=20 2.43.0 From nobody Tue Nov 26 13:27:19 2024 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=1707156905; cv=none; d=zohomail.com; s=zohoarc; b=gmNSmUzUsAv30hJsKELDg8SeSX9Jf21tKuw8jhjo31djAs8nVcvoRQlj5TPBNQqkKdwQhCiZldw4V3HOvoOU1Q7zgUnXev/jl/6CJVZxwsPG3KmOCQegp2eWIYJtBuUJ324yKA538Ue2OuyR7Q6WmzpTv3wjuvwd1DlA0TP6Duw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707156905; 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=+tlkukPWLeQ6WDnmUAlPzilmjd4qxQFNB9qyvD8yiI8=; b=ljKX3/D52mQv6qMNRvPPNe86fm0UNrXzhiP5DWPN3B+/dKtCbzZbAGpuscSwEWp9PB3hvggRCbP3bEe8nx4986u2/fJ/Kw6NgtNOCeez6Ts4vAVPf/pb72cYUhqUIeQNPSxFplATMAkLPx7XYFzbCHVWs3ytW94zq7ovQTDwdjQ= 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 1707156905031185.17871099970796; Mon, 5 Feb 2024 10:15:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rX3Ts-0005zy-Ft; Mon, 05 Feb 2024 13:14:08 -0500 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 1rX3Tq-0005zb-Vk for qemu-devel@nongnu.org; Mon, 05 Feb 2024 13:14:07 -0500 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 1rX3Tn-0005tb-VG for qemu-devel@nongnu.org; Mon, 05 Feb 2024 13:14:06 -0500 Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 415HuU4N020446; Mon, 5 Feb 2024 18:14:01 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w34gyge8s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:14:00 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 415HwZ21025664; Mon, 5 Feb 2024 18:14:00 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w34gyge82-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:14:00 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 415HILbW005756; Mon, 5 Feb 2024 18:13:59 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3w21aka0bh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:13:59 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 415IDv2W22610466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Feb 2024 18:13:57 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 61D3420043; Mon, 5 Feb 2024 18:13:57 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AECA520040; Mon, 5 Feb 2024 18:13:56 +0000 (GMT) Received: from heavy.ibm.com (unknown [9.171.57.170]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 5 Feb 2024 18:13:56 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=+tlkukPWLeQ6WDnmUAlPzilmjd4qxQFNB9qyvD8yiI8=; b=X8PgDf6dAmuK2QkD+t/c0u6xb9k7QliqWWM6yvqJ4pz0drPCPL1oGvwJEsPygnfIOc4Y FyLNxaWZmQGtaxKvqWe5DEx7kDtcDPdS0rJtq+H81rNnwnzYhAeoq+qFfslSny4YsDJ6 nyvvIui+UF7exp/2IEnBahHuYHZQB4WqsqvYtPRJgFJ6NmlaiCBkm+axvMOh9fKnrvLP ZsOEUjddjCG98u7qoONVR17wMYfzSFeCCpzyaxIrNX6qYXYCkcbM115MSv0Bb1jTErmL NNHnkfkP1cX3DpHXBtaz6sPqoklqkXA+4CxJkaNt72WxM4sxwpl1gktW01Q2rjntO6IL Zg== From: Ilya Leoshkevich To: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Ed Maste , Li-Wen Hsu , Warner Losh Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal , Kyle Evans , qemu-devel@nongnu.org, Ilya Leoshkevich Subject: [PATCH v2 2/4] tests/vm/freebsd: Reload the sshd configuration Date: Mon, 5 Feb 2024 19:11:33 +0100 Message-ID: <20240205181352.1567-3-iii@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205181352.1567-1-iii@linux.ibm.com> References: <20240205181352.1567-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 8AU3CE_MnLRwABmgbaFRk__gSP-v-e9N X-Proofpoint-ORIG-GUID: cAynI-UH-Rb65ZTzm-z57feTwjfjpvOv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-05_12,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 spamscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402050137 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=iii@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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 @ibm.com) X-ZM-MESSAGEID: 1707156906509100001 Content-Type: text/plain; charset="utf-8" After console_sshd_config(), the SSH server needs to be nudged to pick up the new configs. The scripts for the other BSD flavors already do this with a reboot, but a simple reload is sufficient. Signed-off-by: Ilya Leoshkevich Reviewed-by: Thomas Huth --- tests/vm/freebsd | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/vm/freebsd b/tests/vm/freebsd index b581bd17fb7..1247f40a385 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -81,50 +81,51 @@ class FreeBSDVM(basevm.BaseVM): self.console_wait("Full name") self.console_send("%s\n" % self._config["guest_user"]) self.console_wait_send("Uid", "\n") self.console_wait_send("Login group", "\n") self.console_wait_send("Login group", "\n") self.console_wait_send("Login class", "\n") self.console_wait_send("Shell", "\n") self.console_wait_send("Home directory", "\n") self.console_wait_send("Home directory perm", "\n") self.console_wait_send("Use password", "\n") self.console_wait_send("Use an empty password", "\n") self.console_wait_send("Use a random password", "\n") self.console_wait("Enter password:") self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("Enter password again:") self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait_send("Lock out", "\n") self.console_wait_send("OK", "yes\n") self.console_wait_send("Add another user", "no\n") self.console_wait_send("~ #", "exit\n") =20 # setup qemu user prompt =3D "$" self.console_ssh_init(prompt, self._config["guest_user"], self._co= nfig["guest_pass"]) self.console_wait_send(prompt, "exit\n") =20 # setup root user prompt =3D "root@freebsd:~ #" self.console_ssh_init(prompt, "root", self._config["root_pass"]) self.console_sshd_config(prompt) + self.console_wait_send(prompt, "service sshd reload\n") =20 # setup virtio-blk #1 (tarfile) self.console_wait(prompt) self.console_send("echo 'chmod 666 /dev/vtbd1' >> /etc/rc.local\n") =20 pkgs =3D self.get_qemu_packages_from_lcitool_json() self.print_step("Installing packages") self.ssh_root_check("pkg install -y %s\n" % " ".join(pkgs)) =20 # shutdown self.ssh_root(self.poweroff) self.wait() =20 if os.path.exists(img): os.remove(img) os.rename(img_tmp, img) self.print_step("All done") =20 if __name__ =3D=3D "__main__": sys.exit(basevm.main(FreeBSDVM, config=3DFREEBSD_CONFIG)) --=20 2.43.0 From nobody Tue Nov 26 13:27:19 2024 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=1707156917; cv=none; d=zohomail.com; s=zohoarc; b=D4kocXGB8qQeW3E7dbCxDyjKoLVywPQhmFooxFQ7xOl1xis8yqc91wC1E9kXRSQJPfspdFMDrNmS3bXSa1lrQSWe6qGgwFM9vwouhzqThH/3oPLNeERihPowK561WvbnfFcem3FIBEJBs28OZOIhy4TKDdZBg39j0Mh4O+QeSws= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707156917; 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=OjpwU5KDoZLOFP+X0NzCRTTWcd2Mc/m/SMvsZ+X6Cz4=; b=PuWCcRsU33B9XPJi0S9T3J7vLYMcy79JilOialv+B2WggQ/13vPhOFpedIFBegMpmAbG7dkict+4w9poGpA4JIZM8FWbnW+xLWOIaAxsQXIkWdiir22NUwipvIcOVvGudSuxMXF/Hcao3gWEnPpD6LXJHnwqaiO4S701pEZNrB4= 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 170715691785234.24660472084747; Mon, 5 Feb 2024 10:15:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rX3Tu-00060g-AE; Mon, 05 Feb 2024 13:14:10 -0500 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 1rX3Tr-0005zj-GW for qemu-devel@nongnu.org; Mon, 05 Feb 2024 13:14:07 -0500 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 1rX3Tq-0005vC-0w for qemu-devel@nongnu.org; Mon, 05 Feb 2024 13:14:07 -0500 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 415HfKdY030782; Mon, 5 Feb 2024 18:14:02 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w341c17fm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:14:02 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 415HQ6au005911; Mon, 5 Feb 2024 18:14:01 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w341c17ey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:14:01 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 415I2jBP008478; Mon, 5 Feb 2024 18:14:00 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3w221jsrya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:14:00 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 415IDwZ237814786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Feb 2024 18:13:58 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6AD8A20040; Mon, 5 Feb 2024 18:13:58 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9C3E20043; Mon, 5 Feb 2024 18:13:57 +0000 (GMT) Received: from heavy.ibm.com (unknown [9.171.57.170]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 5 Feb 2024 18:13:57 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=OjpwU5KDoZLOFP+X0NzCRTTWcd2Mc/m/SMvsZ+X6Cz4=; b=eVXSaxcxGEAvx0zLCorm3fGgWkbyZ920kOS/DMWIBo/jxuuSdjBfgLkBJUSAVXtQ6/aV gfK3fLt5D3VQtQM0bSa37aivupVrNJe1FPhhSmqXKxcuL29GQaSLZjHcRJ7zTs7ur1CB Dohr2cKNyPvorCgHFqeCtMGBTYNOdmRkl+lKhpfWQA50Fh9nY30kieLmImEkXxgwpk0c 5spr89X/bfeihLdxO/5v+CQUrsj7juKRepn1Yb6Mqema4ix7pBOKzbqXPIjDP3QCFc2V Gg3ePnKg9Pa5RrTQXyuw3Wt8ojDrUPdQUxLAQb9eBSnoqXQGw6dnbCHt8ydjzqJU9D3W ZQ== From: Ilya Leoshkevich To: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Ed Maste , Li-Wen Hsu , Warner Losh Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal , Kyle Evans , qemu-devel@nongnu.org, Ilya Leoshkevich Subject: [PATCH v2 3/4] tests/test-util-filemonitor: Adapt to FreeBSD inotify rename semantics Date: Mon, 5 Feb 2024 19:11:34 +0100 Message-ID: <20240205181352.1567-4-iii@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205181352.1567-1-iii@linux.ibm.com> References: <20240205181352.1567-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: TKvzF6rb8w3FB_1-6OVzMt_oO24HccLN X-Proofpoint-GUID: i1yEtzIAmxO4G28gF1ajzyA9y5ZTgwvz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-05_12,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 impostorscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402050137 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=iii@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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 @ibm.com) X-ZM-MESSAGEID: 1707156919985100002 Content-Type: text/plain; charset="utf-8" Unlike on Linux, on FreeBSD renaming a file when the destination already exists results in IN_DELETE event for that existing file: $ FILEMONITOR_DEBUG=3D1 build/tests/unit/test-util-filemonitor Rename /tmp/test-util-filemonitor-K13LI2/fish/one.txt -> /tmp/test-util= -filemonitor-K13LI2/two.txt Event id=3D200000000 event=3D2 file=3Done.txt Queue event id 200000000 event 2 file one.txt Queue event id 100000000 event 2 file two.txt Queue event id 100000002 event 2 file two.txt Queue event id 100000000 event 0 file two.txt Queue event id 100000002 event 0 file two.txt Event id=3D100000000 event=3D0 file=3Dtwo.txt Expected event 0 but got 2 This difference in behavior is not expected to break the real users, so teach the test to accept it. Suggested-by: Daniel P. Berrange Signed-off-by: Ilya Leoshkevich --- tests/unit/test-util-filemonitor.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit/test-util-filemonitor.c b/tests/unit/test-util-file= monitor.c index a22de275955..02e67fc96ac 100644 --- a/tests/unit/test-util-filemonitor.c +++ b/tests/unit/test-util-filemonitor.c @@ -333,60 +333,68 @@ test_file_monitor_events(void) =20 =20 { .type =3D QFILE_MONITOR_TEST_OP_MKDIR, .filesrc =3D "fish", }, { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "fish", .watchid =3D &watch0, .eventid =3D QFILE_MONITOR_EVENT_CREATED }, =20 =20 { .type =3D QFILE_MONITOR_TEST_OP_ADD_WATCH, .filesrc =3D "fish/", .watchid =3D &watch4 }, { .type =3D QFILE_MONITOR_TEST_OP_ADD_WATCH, .filesrc =3D "fish/one.txt", .watchid =3D &watch5 }, { .type =3D QFILE_MONITOR_TEST_OP_CREATE, .filesrc =3D "fish/one.txt", }, { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "one.txt", .watchid =3D &watch4, .eventid =3D QFILE_MONITOR_EVENT_CREATED }, { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "one.txt", .watchid =3D &watch5, .eventid =3D QFILE_MONITOR_EVENT_CREATED }, =20 =20 { .type =3D QFILE_MONITOR_TEST_OP_DEL_WATCH, .filesrc =3D "fish/one.txt", .watchid =3D &watch5 }, { .type =3D QFILE_MONITOR_TEST_OP_RENAME, .filesrc =3D "fish/one.txt", .filedst =3D "two.txt", }, { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "one.txt", .watchid =3D &watch4, .eventid =3D QFILE_MONITOR_EVENT_DELETED }, +#ifdef __FreeBSD__ + { .type =3D QFILE_MONITOR_TEST_OP_EVENT, + .filesrc =3D "two.txt", .watchid =3D &watch0, + .eventid =3D QFILE_MONITOR_EVENT_DELETED }, + { .type =3D QFILE_MONITOR_TEST_OP_EVENT, + .filesrc =3D "two.txt", .watchid =3D &watch2, + .eventid =3D QFILE_MONITOR_EVENT_DELETED }, +#endif { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "two.txt", .watchid =3D &watch0, .eventid =3D QFILE_MONITOR_EVENT_CREATED }, { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "two.txt", .watchid =3D &watch2, .eventid =3D QFILE_MONITOR_EVENT_CREATED }, =20 =20 { .type =3D QFILE_MONITOR_TEST_OP_RMDIR, .filesrc =3D "fish", }, { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "", .watchid =3D &watch4, .eventid =3D QFILE_MONITOR_EVENT_IGNORED, .swapnext =3D true }, { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "fish", .watchid =3D &watch0, .eventid =3D QFILE_MONITOR_EVENT_DELETED }, { .type =3D QFILE_MONITOR_TEST_OP_DEL_WATCH, .filesrc =3D "fish", .watchid =3D &watch4 }, =20 =20 { .type =3D QFILE_MONITOR_TEST_OP_UNLINK, .filesrc =3D "two.txt", }, { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "two.txt", .watchid =3D &watch0, .eventid =3D QFILE_MONITOR_EVENT_DELETED }, { .type =3D QFILE_MONITOR_TEST_OP_EVENT, .filesrc =3D "two.txt", .watchid =3D &watch2, .eventid =3D QFILE_MONITOR_EVENT_DELETED }, =20 --=20 2.43.0 From nobody Tue Nov 26 13:27:19 2024 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=1707156907; cv=none; d=zohomail.com; s=zohoarc; b=UVPPPJ0JP3MfCdJCDnXNkSB9OjN/C5/wW7dqhbip/+2McXqs1YazkngZvFLT0KIdpuz8rzu7B8Nujw62y1jOtJZHffIxums5eCnX1hJ7HhD1xoV0Mf3yBoo93HHlYwjlyCJILbDOyrSUDzU+JPbY8pYJEwvOhLGTdHaQdZADb/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707156907; 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=CUXByy65ilH+EYqzR+nsS03VfpnAvjUbeq9RbGMcA8M=; b=BxQL1yAY7WK07wsdWmvuQ8R6itH71GN/oNNn02+Ke0ckC3uta7CwDuLJjlvwkp/3Avc1EaYAG4689OJIMMMagTidN36j/gCuz8VUFghCNOR/o6WeikQmSDwi72DqaOTZfCmvAoPTptz2EiCpvLWAsCvhK3T58g0sYMJmvGXG8Ig= 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 1707156907368533.911626115002; Mon, 5 Feb 2024 10:15:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rX3Tw-000619-MJ; Mon, 05 Feb 2024 13:14:12 -0500 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 1rX3Tv-00060l-2v for qemu-devel@nongnu.org; Mon, 05 Feb 2024 13:14:11 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rX3Tr-0005vh-UC for qemu-devel@nongnu.org; Mon, 05 Feb 2024 13:14:09 -0500 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 415GvRUL007873; Mon, 5 Feb 2024 18:14:04 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w33n620fr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:14:03 +0000 Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 415ICDEk021499; Mon, 5 Feb 2024 18:14:03 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w33n620f8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:14:02 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 415H9uCO005447; Mon, 5 Feb 2024 18:14:01 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3w21aka0bj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 18:14:01 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 415IDx3G2491058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Feb 2024 18:13:59 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6EFDC20043; Mon, 5 Feb 2024 18:13:59 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BBB5F20040; Mon, 5 Feb 2024 18:13:58 +0000 (GMT) Received: from heavy.ibm.com (unknown [9.171.57.170]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 5 Feb 2024 18:13:58 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=CUXByy65ilH+EYqzR+nsS03VfpnAvjUbeq9RbGMcA8M=; b=nIADtzqk+zL7ydTtMCBpOJyi8n+6HEFlZjAHZFfkSdiooF7YR+yoconghdx6+3RCbBpT 7tv56TY+waIM/ufKvr9u7Gr5I88nijaZPRZHFd7bnzrcawfEBnv8fFZ1LTaT5N5KPnIY Yv+dblDn2svO11nc17JpX5l2oTKsy5KtBSAt744ypxqx/5ICnKfS8LIgDhn4/OyiUCqn EKjEc+g5PFblO3WJdyBOg92xddiTo4DXfQoYaHK16b2IG77tyyYKSl1p2bSWV7LzJbLZ Wa8+DKdMWKaXsjjCx0tVVoj6LT3XokHWpkaHqMNfgfMWBTGdKr4GDIJUqPNord7iRCUk 0Q== From: Ilya Leoshkevich To: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Ed Maste , Li-Wen Hsu , Warner Losh Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal , Kyle Evans , qemu-devel@nongnu.org, Ilya Leoshkevich Subject: [PATCH v2 4/4] meson: Link with libinotify on FreeBSD Date: Mon, 5 Feb 2024 19:11:35 +0100 Message-ID: <20240205181352.1567-5-iii@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205181352.1567-1-iii@linux.ibm.com> References: <20240205181352.1567-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: YArbb3e01_cNXaUTEGZxL60QjnBqlot- X-Proofpoint-ORIG-GUID: foezRfhCJ1bUUjPWjQbQOQFkuq7Tz5qM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-05_12,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402050137 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.156.1; envelope-from=iii@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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 @ibm.com) X-ZM-MESSAGEID: 1707156908037100011 Content-Type: text/plain; charset="utf-8" make vm-build-freebsd fails with: ld: error: undefined symbol: inotify_init1 >>> referenced by filemonitor-inotify.c:183 (../src/util/filemonitor-in= otify.c:183) >>> util_filemonitor-inotify.c.o:(qemu_file_monitor_new) = in archive libqemuutil.a On FreeBSD inotify functions are defined in libinotify.so. Add it to the dependencies. Signed-off-by: Ilya Leoshkevich --- meson.build | 12 +++++++++++- util/meson.build | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index b5d6dc94a83..819cdedebe2 100644 --- a/meson.build +++ b/meson.build @@ -1982,60 +1982,66 @@ if libbpf.found() and not cc.links(''' #include int main(void) { bpf_object__destroy_skeleton(NULL); return 0; }''', dependencies: libbpf) libbpf =3D not_found if get_option('bpf').enabled() error('libbpf skeleton test failed') else warning('libbpf skeleton test failed, disabling') endif endif =20 # libxdp libxdp =3D not_found if not get_option('af_xdp').auto() or have_system libxdp =3D dependency('libxdp', required: get_option('af_xdp'), version: '>=3D1.4.0', method: 'pkg-config') endif =20 # libdw libdw =3D not_found if not get_option('libdw').auto() or \ (not get_option('prefer_static') and (have_system or have_user)) libdw =3D dependency('libdw', method: 'pkg-config', required: get_option('libdw')) endif =20 +# libinotify-kqueue +inotify =3D not_found +if host_os =3D=3D 'freebsd' + inotify =3D cc.find_library('inotify') +endif + ################# # config-host.h # ################# =20 config_host_data =3D configuration_data() =20 audio_drivers_selected =3D [] if have_system audio_drivers_available =3D { 'alsa': alsa.found(), 'coreaudio': coreaudio.found(), 'dsound': dsound.found(), 'jack': jack.found(), 'oss': oss.found(), 'pa': pulse.found(), 'pipewire': pipewire.found(), 'sdl': sdl.found(), 'sndio': sndio.found(), } foreach k, v: audio_drivers_available config_host_data.set('CONFIG_AUDIO_' + k.to_upper(), v) endforeach =20 # Default to native drivers first, OSS second, SDL third audio_drivers_priority =3D \ [ 'pa', 'coreaudio', 'dsound', 'sndio', 'oss' ] + \ (host_os =3D=3D 'linux' ? [] : [ 'sdl' ]) audio_drivers_default =3D [] foreach k: audio_drivers_priority if audio_drivers_available[k] @@ -2376,61 +2382,62 @@ have_asan_fiber =3D false if get_option('sanitizers') and \ not cc.has_function('__sanitizer_start_switch_fiber', args: '-fsanitize=3Daddress', prefix: '#include ') warning('Missing ASAN due to missing fiber annotation interface') warning('Without code annotation, the report may be inferior.') else have_asan_fiber =3D true endif config_host_data.set('CONFIG_ASAN_IFACE_FIBER', have_asan_fiber) =20 # has_header_symbol config_host_data.set('CONFIG_BLKZONED', cc.has_header_symbol('linux/blkzoned.h', 'BLKOPENZONE= ')) config_host_data.set('CONFIG_EPOLL_CREATE1', cc.has_header_symbol('sys/epoll.h', 'epoll_create1')) config_host_data.set('CONFIG_FALLOCATE_PUNCH_HOLE', cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_PUN= CH_HOLE') and cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_KEE= P_SIZE')) config_host_data.set('CONFIG_FALLOCATE_ZERO_RANGE', cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_ZER= O_RANGE')) config_host_data.set('CONFIG_FIEMAP', cc.has_header('linux/fiemap.h') and cc.has_header_symbol('linux/fs.h', 'FS_IOC_FIEMAP')) config_host_data.set('CONFIG_GETRANDOM', cc.has_function('getrandom') and cc.has_header_symbol('sys/random.h', 'GRND_NONBLOCK')) config_host_data.set('CONFIG_INOTIFY', cc.has_header_symbol('sys/inotify.h', 'inotify_init')) config_host_data.set('CONFIG_INOTIFY1', - cc.has_header_symbol('sys/inotify.h', 'inotify_init1'= )) + cc.has_header_symbol('sys/inotify.h', 'inotify_init1'= ) and + (host_os !=3D 'freebsd' or inotify.found())) config_host_data.set('CONFIG_PRCTL_PR_SET_TIMERSLACK', cc.has_header_symbol('sys/prctl.h', 'PR_SET_TIMERSLAC= K')) config_host_data.set('CONFIG_RTNETLINK', cc.has_header_symbol('linux/rtnetlink.h', 'IFLA_PROTO= _DOWN')) config_host_data.set('CONFIG_SYSMACROS', cc.has_header_symbol('sys/sysmacros.h', 'makedev')) config_host_data.set('HAVE_OPTRESET', cc.has_header_symbol('getopt.h', 'optreset')) config_host_data.set('HAVE_IPPROTO_MPTCP', cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP')) =20 # has_member config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID', cc.has_member('struct sigevent', 'sigev_notify_thread= _id', prefix: '#include ')) config_host_data.set('HAVE_STRUCT_STAT_ST_ATIM', cc.has_member('struct stat', 'st_atim', prefix: '#include ')) config_host_data.set('HAVE_BLK_ZONE_REP_CAPACITY', cc.has_member('struct blk_zone', 'capacity', prefix: '#include ')) =20 # has_type config_host_data.set('CONFIG_IOVEC', cc.has_type('struct iovec', prefix: '#include ')) config_host_data.set('HAVE_UTMPX', cc.has_type('struct utmpx', prefix: '#include ')) =20 @@ -4380,60 +4387,63 @@ summary_info +=3D {'U2F support': u2f} summary_info +=3D {'libusb': libusb} summary_info +=3D {'usb net redir': usbredir} summary_info +=3D {'OpenGL support (epoxy)': opengl} summary_info +=3D {'GBM': gbm} summary_info +=3D {'libiscsi support': libiscsi} summary_info +=3D {'libnfs support': libnfs} if host_os =3D=3D 'windows' if have_ga summary_info +=3D {'QGA VSS support': have_qga_vss} endif endif summary_info +=3D {'seccomp support': seccomp} summary_info +=3D {'GlusterFS support': glusterfs} summary_info +=3D {'hv-balloon support': hv_balloon} summary_info +=3D {'TPM support': have_tpm} summary_info +=3D {'libssh support': libssh} summary_info +=3D {'lzo support': lzo} summary_info +=3D {'snappy support': snappy} summary_info +=3D {'bzip2 support': libbzip2} summary_info +=3D {'lzfse support': liblzfse} summary_info +=3D {'zstd support': zstd} summary_info +=3D {'NUMA host support': numa} summary_info +=3D {'capstone': capstone} summary_info +=3D {'libpmem support': libpmem} summary_info +=3D {'libdaxctl support': libdaxctl} summary_info +=3D {'libudev': libudev} # Dummy dependency, keep .found() summary_info +=3D {'FUSE lseek': fuse_lseek.found()} summary_info +=3D {'selinux': selinux} summary_info +=3D {'libdw': libdw} +if host_os =3D=3D 'freebsd' + summary_info +=3D {'libinotify-kqueue': inotify} +endif summary(summary_info, bool_yn: true, section: 'Dependencies') =20 if host_arch =3D=3D 'unknown' message() warning('UNSUPPORTED HOST CPU') message() message('Support for CPU host architecture ' + cpu + ' is not currently') message('maintained. The QEMU project does not guarantee that QEMU will') message('compile or work on this host CPU. You can help by volunteering') message('to maintain it and providing a build host for our continuous') message('integration setup.') if get_option('tcg').allowed() and target_dirs.length() > 0 message() message('configure has succeeded and you can continue to build, but') message('QEMU will use a slow interpreter to emulate the target CPU.') endif endif =20 if not supported_oses.contains(host_os) message() warning('UNSUPPORTED HOST OS') message() message('Support for host OS ' + host_os + 'is not currently maintained.= ') message('configure has succeeded and you can continue to build, but') message('the QEMU project does not guarantee that QEMU will compile or') message('work on this operating system. You can help by volunteering') message('to maintain it and providing a build host for our continuous') message('integration setup. This will ensure that future versions of QEM= U') message('will keep working on ' + host_os + '.') endif diff --git a/util/meson.build b/util/meson.build index af3bf5692d8..0ef9886be04 100644 --- a/util/meson.build +++ b/util/meson.build @@ -77,50 +77,54 @@ if have_system util_ss.add(files('userfaultfd.c')) endif endif =20 if have_block or have_ga util_ss.add(files('aiocb.c', 'async.c')) util_ss.add(files('base64.c')) util_ss.add(files('main-loop.c')) util_ss.add(files('qemu-coroutine.c', 'qemu-coroutine-lock.c', 'qemu-cor= outine-io.c')) util_ss.add(files(f'coroutine-@coroutine_backend@.c')) util_ss.add(files('thread-pool.c', 'qemu-timer.c')) util_ss.add(files('qemu-sockets.c')) endif if have_block util_ss.add(files('aio-wait.c')) util_ss.add(files('buffer.c')) util_ss.add(files('bufferiszero.c')) util_ss.add(files('hbitmap.c')) util_ss.add(files('hexdump.c')) util_ss.add(files('iova-tree.c')) util_ss.add(files('iov.c', 'uri.c')) util_ss.add(files('nvdimm-utils.c')) util_ss.add(files('block-helpers.c')) util_ss.add(files('qemu-coroutine-sleep.c')) util_ss.add(files('qemu-co-shared-resource.c')) util_ss.add(files('qemu-co-timeout.c')) util_ss.add(files('readline.c')) util_ss.add(files('throttle.c')) util_ss.add(files('timed-average.c')) if config_host_data.get('CONFIG_INOTIFY1') - util_ss.add(files('filemonitor-inotify.c')) + freebsd_dep =3D [] + if host_os =3D=3D 'freebsd' + freebsd_dep =3D inotify + endif + util_ss.add(files('filemonitor-inotify.c'), freebsd_dep) else util_ss.add(files('filemonitor-stub.c')) endif if host_os =3D=3D 'linux' util_ss.add(files('vhost-user-server.c'), vhost_user) util_ss.add(files('vfio-helpers.c')) util_ss.add(files('chardev_open.c')) endif endif =20 if cpu =3D=3D 'aarch64' util_ss.add(files('cpuinfo-aarch64.c')) elif cpu in ['x86', 'x86_64'] util_ss.add(files('cpuinfo-i386.c')) elif cpu =3D=3D 'loongarch64' util_ss.add(files('cpuinfo-loongarch.c')) elif cpu in ['ppc', 'ppc64'] util_ss.add(files('cpuinfo-ppc.c')) endif --=20 2.43.0