From nobody Fri Mar 29 02:17:14 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675016763; cv=none; d=zohomail.com; s=zohoarc; b=iXNQ8CPdnDGIx8Fsw/zBFtzt/5uZ6gu5359vqfqRlpJpKpBVc1cGXQBsfG7mPXpjGLrgX4U0ekqi2d/wZXlnezOSsG2i9LMPlVFuiHX77K7uBxZsBv4uhF98ijTk0FHN/dzOJXeyrlRHvD9WR81fWxD6P5K65hZxlqrbq1f9nvE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675016763; h=Content-Type: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=XBu1po2LSvrx6z3arrRh8wMcW+RyUCMFlAEc16sOjJc=; b=ICX3BFM8s+VS2Q1Mk3ucufyFb+JQUs0Fzg+wfKXe5F6zir0+y1KY2R2LqrsMiOyT+77L8d6N9onbEQL/3XtYi0fNzw1AagG9j9TVQ8HSLMl385yCJRMv64Tgw0r3+FjZUYMIsJxThrsuK/aEDrlZ3cJ6mZ+npy1/69Ozepl4JiA= 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+importer2=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 1675016763657151.41695806005555; Sun, 29 Jan 2023 10:26:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMCM6-0004gk-1U; Sun, 29 Jan 2023 13:24:42 -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 1pMCM3-0004gM-71 for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:24:39 -0500 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 1pMCM1-0005vL-Ue for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:24:38 -0500 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-61-wcFh-eyYOG-qZX9BrZSKcw-1; Sun, 29 Jan 2023 13:24:29 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3628B185A78B; Sun, 29 Jan 2023 18:24:29 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4062E40C124A; Sun, 29 Jan 2023 18:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675016676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XBu1po2LSvrx6z3arrRh8wMcW+RyUCMFlAEc16sOjJc=; b=GMcZCSHHXWbQpUqpYiVzP1B8sBv02YkZKTHlc+UrF6qFEHAg0oQBzS8j+38YcTd7WcMnJz +LrljpSMgUYlaiSwZOUomjJ5p5rWJ5wF11twya9NuaPOfe7qvumIpeg7FfHHpKIhmluQHH 6z+jdXcuqFgh+FYSQz/g6jP4BkT+Ggs= X-MC-Unique: wcFh-eyYOG-qZX9BrZSKcw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Stefan Weil , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Beraldo Leal , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Michael Roth , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 1/9] tests: fix path separator, use g_build_filename() Date: Sun, 29 Jan 2023 22:24:06 +0400 Message-Id: <20230129182414.583349-2-marcandre.lureau@redhat.com> In-Reply-To: <20230129182414.583349-1-marcandre.lureau@redhat.com> References: <20230129182414.583349-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, 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 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675016764648100003 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- tests/unit/test-io-channel-command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test-io-channel-command.c b/tests/unit/test-io-chan= nel-command.c index 19f72eab96..096224962c 100644 --- a/tests/unit/test-io-channel-command.c +++ b/tests/unit/test-io-channel-command.c @@ -32,7 +32,7 @@ static char *socat =3D NULL; static void test_io_channel_command_fifo(bool async) { g_autofree gchar *tmpdir =3D g_dir_make_tmp("qemu-test-io-channel.XXXX= XX", NULL); - g_autofree gchar *fifo =3D g_strdup_printf("%s/%s", tmpdir, TEST_FIFO); + g_autofree gchar *fifo =3D g_build_filename(tmpdir, TEST_FIFO, NULL); g_autofree gchar *srcargs =3D g_strdup_printf("%s - PIPE:%s,wronly", s= ocat, fifo); g_autofree gchar *dstargs =3D g_strdup_printf("%s PIPE:%s,rdonly -", s= ocat, fifo); g_auto(GStrv) srcargv =3D g_strsplit(srcargs, " ", -1); --=20 2.39.1 From nobody Fri Mar 29 02:17:14 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675016738; cv=none; d=zohomail.com; s=zohoarc; b=Kd3puspr4T4wT9egqJjhZfCq0UA8/9awG1b/qfid1jHTTQTQutXSLGRzzdzMciDPEDGt00JLzdYEETl/2KfnHgy4gOhyuKS76MyU9N1EoY8cHWb5VKncUPtITsF1wu71/JONq/qDbg7JBcpZ3tORK3EcHrkjyzc3vihvapqT78I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675016738; h=Content-Type: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=2JA4AddFibEIhmbNe/D9nz1BnFd4REe5vYTSGeogcBU=; b=C1VKroBPb4hrnAGks4hLGBrMqwUqobTZaHg6g2FOAknm02r8DOwvlrBtfYIlpBcuelSGIL/l8wcbCHZ5AnjVeGSvr1nPj+dusVEW+1gnhpTm2pMB0h37bxd6Wvhy1yXx0Mk2ImwGmwGjuNQeLcOF3TvheN3uiOKYNUIW8MjBPYs= 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+importer2=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 1675016738347629.9893995854172; Sun, 29 Jan 2023 10:25:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMCM7-0004h0-P1; Sun, 29 Jan 2023 13:24:43 -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 1pMCM4-0004gU-JR for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:24:40 -0500 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 1pMCM2-0005uj-0o for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:24:40 -0500 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-442-b0c0OOy-M26MxM95EFR_iQ-1; Sun, 29 Jan 2023 13:24:34 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E7072800B30; Sun, 29 Jan 2023 18:24:33 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id A75282026D4B; Sun, 29 Jan 2023 18:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675016675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2JA4AddFibEIhmbNe/D9nz1BnFd4REe5vYTSGeogcBU=; b=UOWR5pIrtJr85vhOvmCcBLCue3Vw7iCe6P6enjar6RnrMArYKHuwNdJ1SQDi8l7ETNWPUd TAsbh467dcsoBs87Ex8fgHC6GaBk8pCCCV0AnF0xFdmWcy0pHjHU9OO4/QbaFUFoJLD8u3 D6GBxUpes1IDumdlkM+hF+89Y+fMvNo= X-MC-Unique: b0c0OOy-M26MxM95EFR_iQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Stefan Weil , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Beraldo Leal , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Michael Roth , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 2/9] tests: fix test-io-channel-command on win32 Date: Sun, 29 Jan 2023 22:24:07 +0400 Message-Id: <20230129182414.583349-3-marcandre.lureau@redhat.com> In-Reply-To: <20230129182414.583349-1-marcandre.lureau@redhat.com> References: <20230129182414.583349-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, 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 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675016738521100001 From: Marc-Andr=C3=A9 Lureau socat "PIPE:"" on Windows are named pipes, not fifo path names. Fixes: commit 68406d10859 ("tests/unit: cleanups for test-io-channel-comman= d") Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/unit/test-io-channel-command.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit/test-io-channel-command.c b/tests/unit/test-io-chan= nel-command.c index 096224962c..e76ef2daaa 100644 --- a/tests/unit/test-io-channel-command.c +++ b/tests/unit/test-io-channel-command.c @@ -31,8 +31,12 @@ static char *socat =3D NULL; =20 static void test_io_channel_command_fifo(bool async) { +#ifdef WIN32 + const gchar *fifo =3D TEST_FIFO; +#else g_autofree gchar *tmpdir =3D g_dir_make_tmp("qemu-test-io-channel.XXXX= XX", NULL); g_autofree gchar *fifo =3D g_build_filename(tmpdir, TEST_FIFO, NULL); +#endif g_autofree gchar *srcargs =3D g_strdup_printf("%s - PIPE:%s,wronly", s= ocat, fifo); g_autofree gchar *dstargs =3D g_strdup_printf("%s PIPE:%s,rdonly -", s= ocat, fifo); g_auto(GStrv) srcargv =3D g_strsplit(srcargs, " ", -1); @@ -57,7 +61,9 @@ static void test_io_channel_command_fifo(bool async) object_unref(OBJECT(src)); object_unref(OBJECT(dst)); =20 +#ifndef WIN32 g_rmdir(tmpdir); +#endif } =20 =20 --=20 2.39.1 From nobody Fri Mar 29 02:17:14 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675016712; cv=none; d=zohomail.com; s=zohoarc; b=W3Xas14+C/JcgsdQvSEOlk/vkJAJ+0j05D0O2XJeFiBzBbnF70YLhvieMOQj252mHdjg+pX50Bab+3z2nXU+SF7L8SUTcT6CeriTUCNQp14zGlYpr0hvzzGHWwBwJ8jhYlD9+R5WkgeUkGVsBk3zHxZi/yXuDwl3bonDSSsYXyw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675016712; h=Content-Type: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=DXvU789TEkYigJlmTGw/dEZBT6c2vgwmAPq1esT9tVA=; b=jJ9kR00EzOQRJTIhjYhYxIytQiXXFGXLLxSemzXFtpagJ2LiKxrXL4WY2StOsdnprm1m+skgTvogYC04ULL0LIcz9aD2V67ka3KT+mZVT5W/FhYWE0ZQ3hyUUSHbs9sk54+jCGfiXRRhbdIEOZTUAc6LSfxbscH6GaGicbTu5Fk= 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+importer2=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 1675016712100245.7410953040819; Sun, 29 Jan 2023 10:25:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMCM8-0004hN-Bx; Sun, 29 Jan 2023 13:24:44 -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 1pMCM7-0004h1-IF for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:24:43 -0500 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 1pMCM6-0005zP-4D for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:24:43 -0500 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-10-UKppD53XOQ-Q0AFVz0wBhw-1; Sun, 29 Jan 2023 13:24:38 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 696488533AE; Sun, 29 Jan 2023 18:24:38 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BE11492B01; Sun, 29 Jan 2023 18:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675016680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DXvU789TEkYigJlmTGw/dEZBT6c2vgwmAPq1esT9tVA=; b=Gjtiqh2Ji2TNeUucNKjiAq0PVV6QCMtjXIXBGbBiXACpbPotwqSHcYiuAxfzZSDqqAFbkS xZvM8Q3XbmSlHxDwEq2vJ6sevy/B0jGnV3CU1W6utCU6yMxnSxufBKLM53eaacKDoQENhf rd0UyMoaXsyenb/Ay2RspBI8LhOPVRI= X-MC-Unique: UKppD53XOQ-Q0AFVz0wBhw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Stefan Weil , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Beraldo Leal , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Michael Roth , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 3/9] tests/docker: fix a win32 error due to portability Date: Sun, 29 Jan 2023 22:24:08 +0400 Message-Id: <20230129182414.583349-4-marcandre.lureau@redhat.com> In-Reply-To: <20230129182414.583349-1-marcandre.lureau@redhat.com> References: <20230129182414.583349-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, 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 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675016712967100001 From: Marc-Andr=C3=A9 Lureau docker.py is run during configure, and produces an error: No module named 'pwd'. Use a more portable and recommended alternative to lookup the user "login name". Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/docker/docker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 3a1ed7cb18..688ef62989 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -23,10 +23,10 @@ import tempfile import re import signal +import getpass from tarfile import TarFile, TarInfo from io import StringIO, BytesIO from shutil import copy, rmtree -from pwd import getpwuid from datetime import datetime, timedelta =20 =20 @@ -316,7 +316,7 @@ def build_image(self, tag, docker_dir, dockerfile, =20 if user: uid =3D os.getuid() - uname =3D getpwuid(uid).pw_name + uname =3D getpass.getuser() tmp_df.write("\n") tmp_df.write("RUN id %s 2>/dev/null || useradd -u %d -U %s" % (uname, uid, uname)) @@ -570,7 +570,7 @@ def run(self, args, argv): =20 if args.user: uid =3D os.getuid() - uname =3D getpwuid(uid).pw_name + uname =3D getpass.getuser() df.write("\n") df.write("RUN id %s 2>/dev/null || useradd -u %d -U %s" % (uname, uid, uname)) --=20 2.39.1 From nobody Fri Mar 29 02:17:14 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675016711; cv=none; d=zohomail.com; s=zohoarc; b=jXk5aidyn5L3PEsv+g2Jt07/FFFWPTZFnX1mU0oCWNRGjigDIhDldB4eWcWE4TiGbXHd1GopRfMfy+OUMds6Y5I8aJ8+3YAFDPH3FOAv1fOb4eTjz/ixvSnYg6doj+H2+Kmxmaarf+73q88uePr3GinmfJFE/5rjFx6dndbqTbk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675016711; h=Content-Type: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=qtl4SNIpf1RWo6RcTmh5yr4OwHwqsvHdcf3zej+YUZ0=; b=DJPAYMIXwbWY8oaO4Hcq1ovjDDP1NPpZd25xy5tUh3xqLBubpvNPXnS1ywonbFU6EQiw4yudAit3F6kFzOjec+9Z/17A1rdVX24o45sfARm5AuzgVH/CsifWivGiFgPMRsN+OBm2AAA3fpZcI+RtEZTw49gGB7UdtzILOene6Bw= 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+importer2=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 1675016711889313.9602114071728; Sun, 29 Jan 2023 10:25:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMCMF-0004i6-VM; Sun, 29 Jan 2023 13:24:51 -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 1pMCME-0004hp-0u for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:24:50 -0500 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 1pMCMC-0005ze-1W for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:24:49 -0500 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-220-ApNVvSDLOOaCYm2AytEzEQ-1; Sun, 29 Jan 2023 13:24:43 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0DC1980D0EA; Sun, 29 Jan 2023 18:24:43 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADF952026D4B; Sun, 29 Jan 2023 18:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675016687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qtl4SNIpf1RWo6RcTmh5yr4OwHwqsvHdcf3zej+YUZ0=; b=Qf/82tJFEBAc9p0aZzZ5bPZymf4rlYgAHlZbNXtFJheI2SzMTHKngOYi7z1yMBbjlOrPIk GmaxbyFV9F8jEfdvOtCgXIjq35EIXr9mlHc+I2T6ctheVbtxqIplP5s61IVh4pM3ZE3cUD fX7OwTldU8j96bmr7LcZjV/qNlw2ALs= X-MC-Unique: ApNVvSDLOOaCYm2AytEzEQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Stefan Weil , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Beraldo Leal , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Michael Roth , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 4/9] osdep: implement qemu_socketpair() for win32 Date: Sun, 29 Jan 2023 22:24:09 +0400 Message-Id: <20230129182414.583349-5-marcandre.lureau@redhat.com> In-Reply-To: <20230129182414.583349-1-marcandre.lureau@redhat.com> References: <20230129182414.583349-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, 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 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675016712978100002 From: Marc-Andr=C3=A9 Lureau Manually implement a socketpair() function, using UNIX sockets and simple peer credential checking. QEMU doesn't make much use of socketpair, beside vhost-user which is not available for win32 at this point. However, I intend to use it for writing some new portable tests. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qemu/sockets.h | 2 - util/oslib-win32.c | 110 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 2 deletions(-) diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index 2b0698a7c9..d935fd80da 100644 --- a/include/qemu/sockets.h +++ b/include/qemu/sockets.h @@ -15,7 +15,6 @@ int inet_aton(const char *cp, struct in_addr *ia); bool fd_is_socket(int fd); int qemu_socket(int domain, int type, int protocol); =20 -#ifndef WIN32 /** * qemu_socketpair: * @domain: specifies a communication domain, such as PF_UNIX @@ -30,7 +29,6 @@ int qemu_socket(int domain, int type, int protocol); * Return 0 on success. */ int qemu_socketpair(int domain, int type, int protocol, int sv[2]); -#endif =20 int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen); /* diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 07ade41800..a7b0d8491e 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -496,6 +496,116 @@ ssize_t qemu_recvfrom_wrap(int sockfd, void *buf, siz= e_t len, int flags, return ret; } =20 +int qemu_socketpair(int domain, int type, int protocol, int sv[2]) +{ + struct sockaddr_un addr =3D { + 0, + }; + socklen_t socklen; + SOCKET listener =3D INVALID_SOCKET; + SOCKET client =3D INVALID_SOCKET; + SOCKET server =3D INVALID_SOCKET; + g_autofree char *path =3D NULL; + int tmpfd; + u_long arg, br; + int ret =3D -1; + + g_return_val_if_fail(sv !=3D NULL, -1); + + addr.sun_family =3D AF_UNIX; + socklen =3D sizeof(addr); + + tmpfd =3D g_file_open_tmp(NULL, &path, NULL); + if (tmpfd =3D=3D -1) { + WSASetLastError(WSAEACCES); + goto out; + } + + close(tmpfd); + + if (strlen(path) >=3D sizeof(addr.sun_path)) { + WSASetLastError(WSAEACCES); + goto out; + } + + strncpy(addr.sun_path, path, sizeof(addr.sun_path) - 1); + + listener =3D socket(domain, type, protocol); + if (listener =3D=3D INVALID_SOCKET) { + goto out; + } + + if (DeleteFile(path) =3D=3D 0 && GetLastError() !=3D ERROR_FILE_NOT_FO= UND) { + WSASetLastError(WSAEACCES); + goto out; + } + g_clear_pointer(&path, g_free); + + if (bind(listener, (struct sockaddr *)&addr, socklen) =3D=3D SOCKET_ER= ROR) { + goto out; + } + + if (listen(listener, 1) =3D=3D SOCKET_ERROR) { + goto out; + } + + client =3D socket(domain, type, protocol); + if (client =3D=3D INVALID_SOCKET) { + goto out; + } + + arg =3D 1; + if (ioctlsocket(client, FIONBIO, &arg) =3D=3D SOCKET_ERROR) { + goto out; + } + + if (connect(client, (struct sockaddr *)&addr, socklen) =3D=3D SOCKET_E= RROR && + WSAGetLastError() !=3D WSAEWOULDBLOCK) { + goto out; + } + + server =3D accept(listener, NULL, NULL); + if (server =3D=3D INVALID_SOCKET) { + goto out; + } + + arg =3D 0; + if (ioctlsocket(client, FIONBIO, &arg) =3D=3D SOCKET_ERROR) { + goto out; + } + + if (WSAIoctl(server, SIO_AF_UNIX_GETPEERPID, NULL, 0U, &arg, sizeof(ar= g), + &br, NULL, NULL) =3D=3D SOCKET_ERROR || + arg !=3D GetCurrentProcessId()) { + WSASetLastError(WSAEACCES); + goto out; + } + + sv[0] =3D server; + server =3D INVALID_SOCKET; + sv[1] =3D client; + client =3D INVALID_SOCKET; + ret =3D 0; + +out: + if (ret =3D=3D -1) { + errno =3D socket_error(); + } + if (listener !=3D INVALID_SOCKET) { + closesocket(listener); + } + if (client !=3D INVALID_SOCKET) { + closesocket(client); + } + if (server !=3D INVALID_SOCKET) { + closesocket(server); + } + if (path) { + DeleteFile(path); + } + return ret; +} + bool qemu_write_pidfile(const char *filename, Error **errp) { char buffer[128]; --=20 2.39.1 From nobody Fri Mar 29 02:17:14 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675016722; cv=none; d=zohomail.com; s=zohoarc; b=YDeX9lFNi2bOFPRYKQuDdk3DkvBqRfo2qgEr435BSnZndS83VwZ0PfMzpn5NO5cN4orZGOBNJPF24wJvCiCLcxiN2OMfSCAlc6MoY7ux8mj6x+yblB5vFcew7lrbNWVxTys7X4afxSHvBVbpQB1ULMiNZmjA48ojYlvxuCX/XxU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675016722; h=Content-Type: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=apJdQ+o1YhG8ScRQIxIghn17nASfmTDA/hRxwYhs2Rg=; b=NUibAbKV0A0CS8zvvrH0eUHNSvu/sXu7VBxnndtHSSm4fDS8degs6vSNSxRGHwIUEhczo8YzMc8rzD6i1fkTt2AGMr2+Rk2zNQXEU/lGE40mchgss+1uThvzpV7L6ms57pzjE4sgTuE6Ro/kNttUKohA06k14ABNx1+kKVI+n0M= 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+importer2=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 1675016722989170.32537719900165; Sun, 29 Jan 2023 10:25:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMCMH-0004ij-Jt; Sun, 29 Jan 2023 13:24:53 -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 1pMCMG-0004i7-8Y for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:24:52 -0500 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 1pMCME-0005zp-Qy for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:24:52 -0500 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-101-thKjvrAyOjuFjajCsx9KlA-1; Sun, 29 Jan 2023 13:24:47 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3C70285A588; Sun, 29 Jan 2023 18:24:47 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 31CF8492B06; Sun, 29 Jan 2023 18:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675016690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=apJdQ+o1YhG8ScRQIxIghn17nASfmTDA/hRxwYhs2Rg=; b=ZeLK2Eh7lvhNZRu2YMCegXaTbbedLJ8NrniWfCTXXprwDFqYe80cHP858pXhn4DPQaU2sl PzoBsJgyBVgZWAtaU9La1NpYYn2ZGWITs5xFHzjnT1+wX1VHsgGCmmiiTJ6+Qh2G3aoUdO jRkb0ek7XzyeMZfKcaEerDLOzXIEJRg= X-MC-Unique: thKjvrAyOjuFjajCsx9KlA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Stefan Weil , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Beraldo Leal , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Michael Roth , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 5/9] qmp: 'add_client' actually expects sockets Date: Sun, 29 Jan 2023 22:24:10 +0400 Message-Id: <20230129182414.583349-6-marcandre.lureau@redhat.com> In-Reply-To: <20230129182414.583349-1-marcandre.lureau@redhat.com> References: <20230129182414.583349-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, 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 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675016724513100003 From: Marc-Andr=C3=A9 Lureau Whether it is SPICE, VNC, D-Bus, or the socket chardev, they all actually expect a socket kind or will fail in different ways at runtime. Throw an error early if the given 'add_client' fd is not a socket, and close it to avoid leaks. This allows to replace the close() call with a more correct & portable closesocket() version. (this will allow importing sockets on Windows with a specialized command in the following patch, while keeping the remaining monitor associated sockets/add_client code & usage untouched) Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- monitor/qmp-cmds.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index bf22a8c5a6..01cfc23407 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -22,6 +22,7 @@ #include "sysemu/sysemu.h" #include "qemu/config-file.h" #include "qemu/uuid.h" +#include "qemu/sockets.h" #include "chardev/char.h" #include "sysemu/kvm.h" #include "sysemu/runstate.h" @@ -190,11 +191,17 @@ void qmp_add_client(const char *protocol, const char = *fdname, return; } =20 + if (!fd_is_socket(fd)) { + error_setg(errp, "add_client expects a socket"); + close(fd); + return; + } + for (i =3D 0; i < ARRAY_SIZE(protocol_table); i++) { if (!strcmp(protocol, protocol_table[i].name)) { if (!protocol_table[i].add_client(fd, has_skipauth, skipauth, has_tls, tls, errp)) { - close(fd); + closesocket(fd); } return; } @@ -203,12 +210,12 @@ void qmp_add_client(const char *protocol, const char = *fdname, s =3D qemu_chr_find(protocol); if (!s) { error_setg(errp, "protocol '%s' is invalid", protocol); - close(fd); + closesocket(fd); return; } if (qemu_chr_add_client(s, fd) < 0) { error_setg(errp, "failed to add client"); - close(fd); + closesocket(fd); return; } } --=20 2.39.1 From nobody Fri Mar 29 02:17:14 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675016738; cv=none; d=zohomail.com; s=zohoarc; b=T3ozOgIXnlHLz4MxpzB2OiLK4roM7lqNNobeRE+14zZmB7aPZ0NjYJA/EPf1ZHCOtyvLLKS0r4RVKd93N3P278wD43i/6Gu7r+k1EJk2AmZAHGUU8zyGHmPmKOHn1qojisrbLwqZjwal9ChNYld24p/DHu4WR/sH19N4ze078Q4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675016738; h=Content-Type: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=NhHXydFI0TtNZY/17kwXRMemx9Mdt7dhyIDBKvB2xRg=; b=ShfJT5mbgSz1DRML2z91orK4DWoGnT6pHFOZ12YE+xeYJzo7SOMOUJLEiGAVfcf4vOeSlmTgNNLF4Syg/i7HjM+y+GWw7Gn0sng3IWBUbsg6GTHRBuZ4w3KU6LjVpQQOoIEVy5wE8YyRRxxiw51hi7ooU/t6lGsvxGw3WQObhX0= 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+importer2=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 167501673868322.06148562319254; Sun, 29 Jan 2023 10:25:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMCMf-0004v5-JY; Sun, 29 Jan 2023 13:25:17 -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 1pMCMP-0004j4-76 for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:25:01 -0500 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 1pMCML-000603-Oe for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:25:00 -0500 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-544-Hmy-5sD8OB2XiUkjvTzCEg-1; Sun, 29 Jan 2023 13:24:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 27DC0101A521; Sun, 29 Jan 2023 18:24:52 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93FFF1121314; Sun, 29 Jan 2023 18:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675016696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NhHXydFI0TtNZY/17kwXRMemx9Mdt7dhyIDBKvB2xRg=; b=P6TD2y4ME1fp2MZEofUndszZolkoj+33WCI9rXjHfddS7MSy3ZAQe0274NYsyHLWrJGihO dkr7Mbg+FvfJOzF0XV/l9ZX54G+uajylFO5R73LpLGi0pU+tDLlToleyKB0Dyz4Ftb5nod YLSjf23XBRVT8fg28dp2oVgtuIB8eCA= X-MC-Unique: Hmy-5sD8OB2XiUkjvTzCEg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Stefan Weil , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Beraldo Leal , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Michael Roth , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 6/9] qapi: implement conditional command arguments Date: Sun, 29 Jan 2023 22:24:11 +0400 Message-Id: <20230129182414.583349-7-marcandre.lureau@redhat.com> In-Reply-To: <20230129182414.583349-1-marcandre.lureau@redhat.com> References: <20230129182414.583349-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, 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 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675016740527100008 From: Marc-Andr=C3=A9 Lureau The generated code doesn't quite handle the conditional arguments. For example, 'bar' in 'test-if-cmd' is not correctly surrounded by #if conditions. See generated code in qmp_marshal_test_if_cmd(). Note that if there are multiple optional arguments at the last position, there might be compilation issues due to extra comas. I left an assert and FIXME for later. Signed-off-by: Marc-Andr=C3=A9 Lureau --- scripts/qapi/commands.py | 4 ++++ scripts/qapi/gen.py | 19 ++++++++++++++----- scripts/qapi/visit.py | 2 ++ tests/qapi-schema/qapi-schema-test.json | 3 ++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index 79c5e5c3a9..07997d1586 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -64,9 +64,13 @@ def gen_call(name: str, elif arg_type: assert not arg_type.variants for memb in arg_type.members: + if memb.ifcond.is_present(): + argstr +=3D '\n' + memb.ifcond.gen_if() if memb.need_has(): argstr +=3D 'arg.has_%s, ' % c_name(memb.name) argstr +=3D 'arg.%s, ' % c_name(memb.name) + if memb.ifcond.is_present(): + argstr +=3D '\n' + memb.ifcond.gen_endif() =20 lhs =3D '' if ret_type: diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index b5a8d03e8e..ba57e72c9b 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -111,22 +111,31 @@ def build_params(arg_type: Optional[QAPISchemaObjectT= ype], boxed: bool, extra: Optional[str] =3D None) -> str: ret =3D '' - sep =3D '' if boxed: assert arg_type ret +=3D '%s arg' % arg_type.c_param_type() - sep =3D ', ' + if extra: + ret +=3D ', ' elif arg_type: assert not arg_type.variants + n =3D 0 for memb in arg_type.members: - ret +=3D sep - sep =3D ', ' + n +=3D 1 + if memb.ifcond.is_present(): + ret +=3D '\n' + memb.ifcond.gen_if() if memb.need_has(): ret +=3D 'bool has_%s, ' % c_name(memb.name) ret +=3D '%s %s' % (memb.type.c_param_type(), c_name(memb.name)) + if extra or n !=3D len(arg_type.members): + ret +=3D ', ' + else: + # FIXME: optional last argument may break compilation + assert not memb.ifcond.is_present() + if memb.ifcond.is_present(): + ret +=3D '\n' + memb.ifcond.gen_endif() if extra: - ret +=3D sep + extra + ret +=3D extra return ret if ret else 'void' =20 =20 diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index 26a584ee4c..c56ea4d724 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -74,11 +74,13 @@ def gen_visit_object_members(name: str, sep =3D '' for memb in members: if memb.optional and not memb.need_has(): + ret +=3D memb.ifcond.gen_if() ret +=3D mcgen(''' bool has_%(c_name)s =3D !!obj->%(c_name)s; ''', c_name=3Dc_name(memb.name)) sep =3D '\n' + ret +=3D memb.ifcond.gen_endif() ret +=3D sep =20 if base: diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qa= pi-schema-test.json index ba7302f42b..baa4e69f63 100644 --- a/tests/qapi-schema/qapi-schema-test.json +++ b/tests/qapi-schema/qapi-schema-test.json @@ -258,7 +258,8 @@ =20 { 'event': 'TEST_IF_EVENT', 'data': { 'foo': 'TestIfStruct', - 'bar': { 'type': ['TestIfEnum'], 'if': 'TEST_IF_EVT_BAR' } }, + 'bar': { 'type': ['TestIfEnum'], 'if': 'TEST_IF_EVT_BAR' }, + 'baz': 'int' }, 'if': { 'all': ['TEST_IF_EVT', 'TEST_IF_STRUCT'] } } =20 { 'event': 'TEST_IF_EVENT2', 'data': {}, --=20 2.39.1 From nobody Fri Mar 29 02:17:15 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675016723; cv=none; d=zohomail.com; s=zohoarc; b=GV45d4IO7OSvH48WaP1afwiWIfCtkNhnzfOKxXVeCv+GOV2sKkkwKrYslOPnIEFdV3sWg1ebXruLrQdyzQCWwNC+bcUsAjWFtTw5zRisWCWgR6aupxGHkuRe6IfLBpfUQ/vjAHoFjuSdwhOettWy+fDmcfxDsa4ncYEO7+rKFt8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675016723; h=Content-Type: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=iXnWXWUy2VOUkfKzFoE3RbpkwDAs84VO76GolSsfxeg=; b=aDpsJJw+NZrY+dxXqbu7OcAV2Isjre/EnojGtI7kapLYmx0c9IMzKrvFvcy/qywMrXxdXX2nUdX8h6RXD89a2Bn3aMJIREVNk/Q8N8Z86DUR9neHr12sgI966xtRzFWVoJXMXdgsRWWjTHcGbOioh7EQZtDDhhPw8qxuw4hkd74= 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+importer2=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 1675016723811319.8590362739733; Sun, 29 Jan 2023 10:25:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMCMi-00054A-4r; Sun, 29 Jan 2023 13:25:20 -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 1pMCMd-0004vJ-3e for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:25:17 -0500 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 1pMCMb-0006Dd-FB for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:25:14 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-513-BmsSiegGOseIRJoMR1PumQ-1; Sun, 29 Jan 2023 13:24:56 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 271F43C02B6F; Sun, 29 Jan 2023 18:24:56 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB9F21121315; Sun, 29 Jan 2023 18:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675016712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iXnWXWUy2VOUkfKzFoE3RbpkwDAs84VO76GolSsfxeg=; b=EGPyw5sZtc6Pr7gK5qm7YYlTw1VHXFP3lIrxyudtXNbLI0/57n7p36+kcoP1awny0fF0IK rEX/ORynsTAS02Rlrak1YRIGaju7eCszp2ALCd69P42stM63cMcTYs81dtlTuY0690luy0 89okDbyTlL6DgPFpmtSmAIjfxu3hk1U= X-MC-Unique: BmsSiegGOseIRJoMR1PumQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Stefan Weil , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Beraldo Leal , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Michael Roth , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 7/9] qmp: teach 'getfd' to import sockets on win32 Date: Sun, 29 Jan 2023 22:24:12 +0400 Message-Id: <20230129182414.583349-8-marcandre.lureau@redhat.com> In-Reply-To: <20230129182414.583349-1-marcandre.lureau@redhat.com> References: <20230129182414.583349-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, 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 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675016724528100004 From: Marc-Andr=C3=A9 Lureau A process with enough capabilities can duplicate a socket to QEMU. Modify 'getfd' to import it and add it to the monitor fd list, so it can be later used by other commands. Note that we actually store the SOCKET in the FD list, appropriate care must now be taken to use the correct socket functions (similar approach is taken by our io/ code and in glib, this is internal and shouldn't affect the QEMU/QMP users) Signed-off-by: Marc-Andr=C3=A9 Lureau --- qapi/misc.json | 16 ++++++++-- monitor/hmp-cmds.c | 6 +++- monitor/misc.c | 75 ++++++++++++++++++++++++++++++++++++---------- 3 files changed, 79 insertions(+), 18 deletions(-) diff --git a/qapi/misc.json b/qapi/misc.json index 27ef5a2b20..cd36d8befb 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -249,10 +249,18 @@ ## # @getfd: # -# Receive a file descriptor via SCM rights and assign it a name +# On UNIX, receive a file descriptor via SCM rights and assign it a name. +# +# On Windows, (where ancillary socket fd-passing isn't an option yet), add= a +# socket that was duplicated to QEMU process with WSADuplicateSocketW() via +# WSASocket() & WSAPROTOCOL_INFOW structure and assign it a name. A SOCKET= is +# considered as a kind of "file descriptor" in QMP context, for historical +# reasons and simplicity. QEMU takes care to use socket functions appropri= ately. # # @fdname: file descriptor name # +# @wsa-info: a WSAPROTOCOL_INFOW structure (encoded in base64). Since 8.0. +# # Returns: Nothing on success # # Since: 0.14 @@ -270,7 +278,11 @@ # <- { "return": {} } # ## -{ 'command': 'getfd', 'data': {'fdname': 'str'} } +{ 'command': 'getfd', 'data': { + 'fdname': 'str', + '*wsa-info': {'type': 'str', 'if': 'CONFIG_WIN32'} + } +} =20 ## # @closefd: diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 1dba973092..fc9145b8fa 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1232,7 +1232,11 @@ void hmp_getfd(Monitor *mon, const QDict *qdict) const char *fdname =3D qdict_get_str(qdict, "fdname"); Error *err =3D NULL; =20 - qmp_getfd(fdname, &err); + qmp_getfd(fdname, +#ifdef WIN32 + NULL, +#endif + &err); hmp_handle_error(mon, err); } =20 diff --git a/monitor/misc.c b/monitor/misc.c index 053af4045e..96c4977e5a 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -71,6 +71,7 @@ #include "qapi/error.h" #include "qapi/qmp-event.h" #include "qemu/cutils.h" +#include "qemu/sockets.h" =20 #if defined(TARGET_S390X) #include "hw/s390x/storage-keys.h" @@ -957,27 +958,29 @@ static void hmp_wavcapture(Monitor *mon, const QDict = *qdict) QLIST_INSERT_HEAD (&capture_head, s, entries); } =20 -void qmp_getfd(const char *fdname, Error **errp) +static void close_fd(int fd) { - Monitor *cur_mon =3D monitor_cur(); - mon_fd_t *monfd; - int fd, tmp_fd; - - fd =3D qemu_chr_fe_get_msgfd(&cur_mon->chr); - if (fd =3D=3D -1) { - error_setg(errp, "No file descriptor supplied via SCM_RIGHTS"); - return; + if (fd_is_socket(fd)) { + closesocket(fd); + } else { + close(fd); } +} + +static void monitor_add_fd(Monitor *mon, int fd, const char *fdname, Error= **errp) +{ + mon_fd_t *monfd; + int tmp_fd; =20 if (qemu_isdigit(fdname[0])) { - close(fd); + close_fd(fd); error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "fdname", "a name not starting with a digit"); return; } =20 - QEMU_LOCK_GUARD(&cur_mon->mon_lock); - QLIST_FOREACH(monfd, &cur_mon->fds, next) { + QEMU_LOCK_GUARD(&mon->mon_lock); + QLIST_FOREACH(monfd, &mon->fds, next) { if (strcmp(monfd->name, fdname) !=3D 0) { continue; } @@ -985,7 +988,7 @@ void qmp_getfd(const char *fdname, Error **errp) tmp_fd =3D monfd->fd; monfd->fd =3D fd; /* Make sure close() is outside critical section */ - close(tmp_fd); + close_fd(tmp_fd); return; } =20 @@ -993,7 +996,49 @@ void qmp_getfd(const char *fdname, Error **errp) monfd->name =3D g_strdup(fdname); monfd->fd =3D fd; =20 - QLIST_INSERT_HEAD(&cur_mon->fds, monfd, next); + QLIST_INSERT_HEAD(&mon->fds, monfd, next); +} + +void qmp_getfd(const char *fdname, +#ifdef WIN32 + const char *wsa_info, +#endif + Error **errp) +{ + Monitor *cur_mon =3D monitor_cur(); + int fd; + +#ifdef WIN32 + if (wsa_info) { + g_autofree WSAPROTOCOL_INFOW *info =3D NULL; + gsize len; + SOCKET sk; + + info =3D (void *)g_base64_decode(wsa_info, &len); + if (len !=3D sizeof(*info)) { + error_setg(errp, "Invalid WSAPROTOCOL_INFOW value"); + return; + } + + sk =3D WSASocketW(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, + FROM_PROTOCOL_INFO, info, 0, 0); + if (sk =3D=3D INVALID_SOCKET) { + g_autofree gchar *emsg =3D g_win32_error_message(WSAGetLastErr= or()); + error_setg(errp, "Couldn't create socket: %s", emsg); + return; + } + + return monitor_add_fd(cur_mon, sk, fdname, errp); + } +#endif + + fd =3D qemu_chr_fe_get_msgfd(&cur_mon->chr); + if (fd =3D=3D -1) { + error_setg(errp, "No file descriptor supplied via SCM_RIGHTS"); + return; + } + + return monitor_add_fd(cur_mon, fd, fdname, errp); } =20 void qmp_closefd(const char *fdname, Error **errp) @@ -1014,7 +1059,7 @@ void qmp_closefd(const char *fdname, Error **errp) g_free(monfd); qemu_mutex_unlock(&cur_mon->mon_lock); /* Make sure close() is outside critical section */ - close(tmp_fd); + close_fd(tmp_fd); return; } =20 --=20 2.39.1 From nobody Fri Mar 29 02:17:15 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675016740; cv=none; d=zohomail.com; s=zohoarc; b=ZrlP2PTz8d3ALDh2TpJqrFoAaHM+Ee1znDWy9Lmdo3CeU+dV7XGoUbyec8KOuVj3Zt9HFSsJnhpRNXKF7yPskdnPJDdrCXW7Nr841K512gcSkMUbXc09FbCw0a0T+K+gLf1qXZkSaFMEN9pOhzhv4EhhA1T8b3EifVDkppPh3XY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675016740; h=Content-Type: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=NYYGbU4+VCQyccn3EjyMVYJtukXx7ENFQ5jJFpqb+ZY=; b=GOFpTGj/q1rdaJPiF4sjxEgdF4KyUFtpVCIjfa8Xh0zHnqVEXQod42IpsypWFHmEsBurP+7oXsqAATbFVot4E5aGhY6WrfGXny7ki+/L86HmKcojS3w1f4+JuI67O+20xTL47zUz6MAOyaHznbwWJGRF4TT2Lfzk8affo0j3kMs= 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+importer2=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 1675016740016497.9691487603445; Sun, 29 Jan 2023 10:25:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMCMo-0005AW-71; Sun, 29 Jan 2023 13:25:26 -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 1pMCMW-0004pR-5W for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:25:14 -0500 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 1pMCMU-0006CZ-8u for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:25:07 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-Rn38cSv8ONmrvR2cDRuZ7A-1; Sun, 29 Jan 2023 13:25:01 -0500 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 9BF4D3C02B70; Sun, 29 Jan 2023 18:25:00 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B3C714171BB; Sun, 29 Jan 2023 18:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675016705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NYYGbU4+VCQyccn3EjyMVYJtukXx7ENFQ5jJFpqb+ZY=; b=cYo2pjfFEULK23HZly3wYc5/d+pIOpxOsI16tJzr3J+GEhvwGfWVo6AqmhXOBJ9754EPks UlaI2c6ziJQ6dHXESYVhaiSPt3wMj8b3nG6BWhTty+RFKICndZ2PsHq9+MilcVpX5fW+on 2UvVzZXaIKFBAUIKbnms9XRAVnFk7ro= X-MC-Unique: Rn38cSv8ONmrvR2cDRuZ7A-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Stefan Weil , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Beraldo Leal , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Michael Roth , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 8/9] libqtest: make qtest_qmp_add_client work on win32 Date: Sun, 29 Jan 2023 22:24:13 +0400 Message-Id: <20230129182414.583349-9-marcandre.lureau@redhat.com> In-Reply-To: <20230129182414.583349-1-marcandre.lureau@redhat.com> References: <20230129182414.583349-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, 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 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675016740510100007 From: Marc-Andr=C3=A9 Lureau Duplicate a socket to QEMU, and add it via 'getfd' on win32. Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Thomas Huth --- tests/qtest/libqtest.h | 2 -- tests/qtest/libqtest.c | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h index fcf1c3c3b3..36186cd946 100644 --- a/tests/qtest/libqtest.h +++ b/tests/qtest/libqtest.h @@ -758,7 +758,6 @@ void qtest_qmp_device_add_qdict(QTestState *qts, const = char *drv, void qtest_qmp_device_add(QTestState *qts, const char *driver, const char = *id, const char *fmt, ...) G_GNUC_PRINTF(4, 5); =20 -#ifndef _WIN32 /** * qtest_qmp_add_client: * @qts: QTestState instance to operate on @@ -768,7 +767,6 @@ void qtest_qmp_device_add(QTestState *qts, const char *= driver, const char *id, * Call QMP ``getfd`` followed by ``add_client`` with the given @fd. */ void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd); -#endif /* _WIN32 */ =20 /** * qtest_qmp_device_del_send: diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 6b2216cb20..7542c169da 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -1456,13 +1456,26 @@ void qtest_qmp_device_add(QTestState *qts, const ch= ar *driver, const char *id, qobject_unref(args); } =20 -#ifndef _WIN32 void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd) { QDict *resp; =20 +#ifdef WIN32 + WSAPROTOCOL_INFOW info; + g_autofree char *info64 =3D NULL; + + assert(fd_is_socket(fd)); + if (WSADuplicateSocketW(fd, GetProcessId((HANDLE)qts->qemu_pid), &info= ) =3D=3D SOCKET_ERROR) { + g_autofree char *emsg =3D g_win32_error_message(WSAGetLastError()); + g_error("WSADuplicateSocketW failed: %s", emsg); + } + info64 =3D g_base64_encode((guchar *)&info, sizeof(info)); + resp =3D qtest_qmp(qts, "{'execute': 'getfd'," + "'arguments': {'fdname': 'fdname', 'wsa-info': %s}}",= info64); +#else resp =3D qtest_qmp_fds(qts, &fd, 1, "{'execute': 'getfd'," "'arguments': {'fdname': 'fdname'}}"); +#endif g_assert(resp); g_assert(!qdict_haskey(resp, "event")); /* We don't expect any events = */ g_assert(!qdict_haskey(resp, "error")); @@ -1476,7 +1489,6 @@ void qtest_qmp_add_client(QTestState *qts, const char= *protocol, int fd) g_assert(!qdict_haskey(resp, "error")); qobject_unref(resp); } -#endif =20 /* * Generic hot-unplugging test via the device_del QMP command. --=20 2.39.1 From nobody Fri Mar 29 02:17:15 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675016768; cv=none; d=zohomail.com; s=zohoarc; b=k4dXmz1OgCvGfRa4960t0uUTcXs1PuIBZOxnFSwOeSbu4ECCwVBBCkP9QRJGVdZIBzrS5zFMsfeAEwFYPDfFG7TrY5G3Eq6KA3dCPWhajjyOZV2DO77F6iGLZP+es9dbBc2PWieavTz7OVi/Lune7FFkPUjGt71c88rJvTJLfFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675016768; h=Content-Type: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=QUZx7tGQmuMMGb4ed+u8ExLLIrcz62tcOV82aB9v5O4=; b=YkDz3c3ARY/Sh45c7OswP70sohmrxBxAm/tdwT7HLbROUSN6yvDgZxfGzCsM7Dx8ebsvvoW6YMP062p5KTzs1S3PISMytG/5a4BwwWxTKERYcP2/z5aTVIpXptXpiLM0RD7M2fzk2AlwRcrrPMexxj48C+K7w2IsDVoEF6cmHgY= 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+importer2=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 1675016768060834.5880818513511; Sun, 29 Jan 2023 10:26:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMCMh-00052D-1N; Sun, 29 Jan 2023 13:25:19 -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 1pMCMa-0004tC-8c for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:25:14 -0500 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 1pMCMY-0006Cs-CD for qemu-devel@nongnu.org; Sun, 29 Jan 2023 13:25:12 -0500 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-505-uBAemS56PbqaDWn8-kCwug-1; Sun, 29 Jan 2023 13:25:04 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5CF998533A2; Sun, 29 Jan 2023 18:25:04 +0000 (UTC) Received: from localhost (unknown [10.39.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9735040C945A; Sun, 29 Jan 2023 18:25:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675016709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QUZx7tGQmuMMGb4ed+u8ExLLIrcz62tcOV82aB9v5O4=; b=bieJIfxEZl6PozdgfMGYqRps8/lNgMsY7q/l/v7ILLh2OZJxpro+2oavluU91bdQqqPVjL YlwkMeeCU6zMwAVogoMyM/oBbD3Q2qbZaE3YCzcdSsQK8rls2FG0LyAysEe9xjWpr+Id15 BIYJwAvm00Hrrj+Xw3OOjWqBZxfOvcc= X-MC-Unique: uBAemS56PbqaDWn8-kCwug-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Stefan Weil , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eric Blake , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Beraldo Leal , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Michael Roth , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 9/9] qtest: enable vnc-display test on win32 Date: Sun, 29 Jan 2023 22:24:14 +0400 Message-Id: <20230129182414.583349-10-marcandre.lureau@redhat.com> In-Reply-To: <20230129182414.583349-1-marcandre.lureau@redhat.com> References: <20230129182414.583349-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, 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 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675016768630100001 From: Marc-Andr=C3=A9 Lureau Now that qtest_qmp_add_client() works on win32, we can enable the VNC test. Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Thomas Huth --- tests/qtest/vnc-display-test.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/qtest/vnc-display-test.c b/tests/qtest/vnc-display-test.c index e2a9d682bb..2997edc6ec 100644 --- a/tests/qtest/vnc-display-test.c +++ b/tests/qtest/vnc-display-test.c @@ -34,10 +34,6 @@ static void on_vnc_auth_failure(VncConnection *self, static bool test_setup(Test *test) { -#ifdef WIN32 - g_test_skip("Not supported on Windows yet"); - return false; -#else int pair[2]; =20 test->qts =3D qtest_init("-vnc none -name vnc-test"); @@ -56,7 +52,6 @@ test_setup(Test *test) =20 test->loop =3D g_main_loop_new(NULL, FALSE); return true; -#endif } =20 static void --=20 2.39.1