From nobody Thu May 16 01:13:01 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672744150; cv=none; d=zohomail.com; s=zohoarc; b=O/tok6ikPqq8zLG6tOdLq+A/FDcgsoZ1F7NJ/TGdgAVefJvgw9Og48WkwLkIx8/a3RuE5/hbdGV74i8P9IxZUn9c2zkCt4xrhWNifk5Ma1wgGRxrFIRPKHa+ascGLRTTAhL5kSWcIiWo2MZ1WG9ez/7RUynbI4n54q27ejoAbnw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672744150; 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=Y1W++VYL+z4VyR2NnOaVoONBMBUS4lZxscdw6XMVABo=; b=QPf8W/Qmk4vuVtPfD+PbjthbCcYM8KEmxtyVmpEEB52bwUz8nVHtqfvLf2LE3v8LUwfZ+Ic4tTjm3HKFfbpGD1p8aeTnNLF26TYjYDHx+gT4oz/LXtnbluJs4rJVnU1j/VyTnoxkiffquvHILOi7VdOA9YjpKRgYqMWX7Qf7fhg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672744150783895.6382390240179; Tue, 3 Jan 2023 03:09:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCf9o-00053A-SX; Tue, 03 Jan 2023 06:08:36 -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 1pCf9k-00051U-Ui for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:32 -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 1pCf9j-0005DD-7k for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:32 -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-397-aPSKxajTOWa6Gx855ddj6w-1; Tue, 03 Jan 2023 06:08:22 -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 3D737101A55E; Tue, 3 Jan 2023 11:08:22 +0000 (UTC) Received: from localhost (unknown [10.39.208.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 753EB140EBF4; Tue, 3 Jan 2023 11:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672744105; 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=Y1W++VYL+z4VyR2NnOaVoONBMBUS4lZxscdw6XMVABo=; b=f6TZTVY5qu7/SJIzKe++Xj0OkhRZ7Gr1GV5K3pqRuPgIFpfVeqnUAlvfN/bfvEl2LsUtNX WE7XxPEKg/SUxYk18/iJPHLHZGw/foKuOFm9MjhFqG0ySUR2UnPcgiDUCAiApKgDWs5S1m s+mIfsJi/8L0H6JBNTxQrA/IFpJIrUw= X-MC-Unique: aPSKxajTOWa6Gx855ddj6w-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eric Blake , Beraldo Leal , Thomas Huth , Wainer dos Santos Moschetta , Gerd Hoffmann , Stefan Weil , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 01/10] ccid-card-emulated: fix cast warning/error Date: Tue, 3 Jan 2023 15:08:05 +0400 Message-Id: <20230103110814.3726795-2-marcandre.lureau@redhat.com> In-Reply-To: <20230103110814.3726795-1-marcandre.lureau@redhat.com> References: <20230103110814.3726795-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+importer=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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672744152478100003 From: Marc-Andr=C3=A9 Lureau ../hw/usb/ccid-card-emulated.c: In function 'handle_apdu_thread': ../hw/usb/ccid-card-emulated.c:251:24: error: cast from pointer to integer = of different size [-Werror=3Dpointer-to-int-cast] 251 | assert((unsigned long)event > 1000); Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth --- hw/usb/ccid-card-emulated.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index ee41a81801..c328660075 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card-emulated.c @@ -248,7 +248,7 @@ static void *handle_apdu_thread(void* arg) WITH_QEMU_LOCK_GUARD(&card->vreader_mutex) { while (!QSIMPLEQ_EMPTY(&card->guest_apdu_list)) { event =3D QSIMPLEQ_FIRST(&card->guest_apdu_list); - assert((unsigned long)event > 1000); + assert(event !=3D NULL); QSIMPLEQ_REMOVE_HEAD(&card->guest_apdu_list, entry); if (event->p.data.type !=3D EMUL_GUEST_APDU) { DPRINTF(card, 1, "unexpected message in handle_apdu_th= read\n"); --=20 2.39.0 From nobody Thu May 16 01:13:01 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672744150; cv=none; d=zohomail.com; s=zohoarc; b=h/i3rcECs4GfLKUdmczQuCK+RCapTKKJpoG84HIc0ciy1MUp0+PMdoNMIixGVpcmz3DEVf33Pi0oPHvY7KDsV/HPLjhBdKlHZAjfgf+cikequW/RYSLXAvKbzXmKaRDAZl/KY68iBPAVavk9tTh1sskAc43wZx0lyuGFcbAFO+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672744150; 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=4fSJrKzZFdVdedArApVYxgiQ8/m5vRosglbCkGsnUd4=; b=ZH4aeOU/vkh/NFK13Sy+wtNt+o5dUnRKb/ppwFjJkkvW3LNkyZnsSBy7kY4cwQEX0xzCwkJtiSMEjQ3NIbNK9Zda7/egOj68BbgvQ26BlH2pQPz/k93wMJ0byrb9Bzjs9TEm2iWrfEkU2YzcmxKGc9xf+VxfR+fDJoJyMf8Yr9A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672744150800546.6312611346084; Tue, 3 Jan 2023 03:09:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCf9o-000539-Se; Tue, 03 Jan 2023 06:08:36 -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 1pCf9k-00051T-T4 for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:32 -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 1pCf9j-0005DI-BZ for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:32 -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-97-6fClbJMQOw-KiMozQyoVbg-1; Tue, 03 Jan 2023 06:08:27 -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 D8CF729AA38E; Tue, 3 Jan 2023 11:08:26 +0000 (UTC) Received: from localhost (unknown [10.39.208.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C7741121314; Tue, 3 Jan 2023 11:08:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672744110; 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=4fSJrKzZFdVdedArApVYxgiQ8/m5vRosglbCkGsnUd4=; b=PrCjZDBJjF9uBt51fSgxTgMhMsNcUviCrKOxpppbXN5fjGBUWkK5bPg8NIy0wXDxvmDFPt GbVl75QWlb7lVsfq9qL2im5O4cB0tNT8uFyEa14eVXDvi2JXb5nCypmj/DM7qxyDTIpJpc 0SKiqGxVhkFwoFdTn90hE2eVAKXYLsE= X-MC-Unique: 6fClbJMQOw-KiMozQyoVbg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eric Blake , Beraldo Leal , Thomas Huth , Wainer dos Santos Moschetta , Gerd Hoffmann , Stefan Weil , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 02/10] tests: fix path separator, use g_build_filename() Date: Tue, 3 Jan 2023 15:08:06 +0400 Message-Id: <20230103110814.3726795-3-marcandre.lureau@redhat.com> In-Reply-To: <20230103110814.3726795-1-marcandre.lureau@redhat.com> References: <20230103110814.3726795-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+importer=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672744152472100001 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.0 From nobody Thu May 16 01:13:01 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672744150; cv=none; d=zohomail.com; s=zohoarc; b=XAI8EtJxWjfCnnRQeIJ/HkXNQbEYU0VvPlT6RBdCuLSFYtG5LJh3i6cmUtyF35PmPxCW3IDIreOFaSoqza9zodn0GKhxo62Ac7ZVgjlHECjiMxLpEQLwAoixYkNJYTuvLvnyojSYGUYxAqYI/fuP+EMKwTpZ9Xi973VYOJ52o7c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672744150; 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=Cj4tllIfmyjARqgynypzKtG8qemG7TkFqBawo0KtELg=; b=i4dfkTd46wiLeJsih8DWy+pxj6YC1mPPGGThyxqs1QPJvLbpbOWj77twOfeOldM/lTPOif2Z5ymj2OGulm3lHWgePx2ZNMcxs0GkBVvGSgTn+XQz/YlqqaqU9D3Gop/2BgFzqmAqLJs6RCyuH0omb/TqM8EtN9UUhOSQ2hLxtYY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672744150810162.93826781328323; Tue, 3 Jan 2023 03:09:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCf9r-00054z-7m; Tue, 03 Jan 2023 06:08:39 -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 1pCf9p-00053r-0z for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:37 -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 1pCf9n-0005Df-J4 for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:36 -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-482-HWdgmn5BPMeKCdemMquQDg-1; Tue, 03 Jan 2023 06:08:31 -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 725AA8F6E81; Tue, 3 Jan 2023 11:08:31 +0000 (UTC) Received: from localhost (unknown [10.39.208.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67F3540C1141; Tue, 3 Jan 2023 11:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672744115; 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=Cj4tllIfmyjARqgynypzKtG8qemG7TkFqBawo0KtELg=; b=PtJWr+mKZY57X42APDojR7fcJjLmMLyRaK1l9RSmjrThcU6Fcc3UsnKhJprE5sHMgr3WT3 Bz9wk/Gkd4iXJReB2Ek1hq4VVdRiSjs3+DcrLpkyOaOIFTU6lz19sLxQI2BXgKPU7LJoit R0LJyZ+caypX08QniixJ196QOhEPPm0= X-MC-Unique: HWdgmn5BPMeKCdemMquQDg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eric Blake , Beraldo Leal , Thomas Huth , Wainer dos Santos Moschetta , Gerd Hoffmann , Stefan Weil , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 03/10] tests: fix test-io-channel-command on win32 Date: Tue, 3 Jan 2023 15:08:07 +0400 Message-Id: <20230103110814.3726795-4-marcandre.lureau@redhat.com> In-Reply-To: <20230103110814.3726795-1-marcandre.lureau@redhat.com> References: <20230103110814.3726795-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+importer=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672744152480100004 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.0 From nobody Thu May 16 01:13:01 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672744156; cv=none; d=zohomail.com; s=zohoarc; b=BeZ6v5VMATkpV/sRjCB9IkDMcSbeQ3yg6BdJ/F4/DYsbsaxxrZGBRilI5422p615CkN4CRqCO4UvhLztqlorImxMDmpcH3Ofl8SN2PNdliYku/omHDNOZk78mnKhglYPVxF1qKRIBw/+lx1z70HZxI19eUwqZpuP68VDA3yNJaA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672744156; 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=M9oJci2K7SoLeNKJa/aMaN5sZylBePdghORP+T/AkNc=; b=EiBEtmrJVeeaaxvf9rrX4qJUVTqKPJdRocxaXCwwvLn/jGlJfzw6+UToOm45XglI0F4lsR/CThf4oycqBgWUohhO4Pmix2AToBeYxkqnTew6EAdtLrU8CfRwkz1t6E83Hq3Qn2vxXzXzNFM2ggYRJvr474vztmI83RGZTh/AL3I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672744156152313.56726662706706; Tue, 3 Jan 2023 03:09:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCf9w-0005CL-BO; Tue, 03 Jan 2023 06:08: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 1pCf9t-00058L-Jr for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:41 -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 1pCf9s-0005Du-8i for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:41 -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-575-slV-E7mIPxuBA-R_7LH1Xg-1; Tue, 03 Jan 2023 06:08:36 -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 0158D101A52E; Tue, 3 Jan 2023 11:08:36 +0000 (UTC) Received: from localhost (unknown [10.39.208.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A5761121314; Tue, 3 Jan 2023 11:08:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672744119; 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=M9oJci2K7SoLeNKJa/aMaN5sZylBePdghORP+T/AkNc=; b=Szwsjt3hjR5Hxbw8fSPW9Yupo52WAb8zVPV9aACTm7oUfZUSxTWRbSdjMFtR4mME8bjY8/ enAcS9HVeLrn6mYQTwbR5g/ZyNb5zjWvPCbrZuo1t6Cc10/41bFa3xRFdGv9nUexQX9KW2 rIi6vkDhUV3RF0oIQoPUKg2LU5sS0Ks= X-MC-Unique: slV-E7mIPxuBA-R_7LH1Xg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eric Blake , Beraldo Leal , Thomas Huth , Wainer dos Santos Moschetta , Gerd Hoffmann , Stefan Weil , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 04/10] tests/docker: fix a win32 error due to portability Date: Tue, 3 Jan 2023 15:08:08 +0400 Message-Id: <20230103110814.3726795-5-marcandre.lureau@redhat.com> In-Reply-To: <20230103110814.3726795-1-marcandre.lureau@redhat.com> References: <20230103110814.3726795-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+importer=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672744158104100001 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.0 From nobody Thu May 16 01:13:01 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672744168; cv=none; d=zohomail.com; s=zohoarc; b=emJSh6wo+vEsEA5MRSXQnVug1r1QUILTF+tycZllcQ/03lWs4XluOqjZ2oIOmKPg6AamSzaiyis7KTke82q9otyXOTxviKBttYCpvTg8yqqWb3DaZwes+ME23aVtcGaLXRmxT3mcawutYH9QuWGM1Racn49oimeWdUZUfTsjrnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672744168; 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=1x1nyouCPKbpTgkt0ZiXSb5aulxYAxy2EYdUhTpbC9s=; b=JSMWCTnljcMEaqOPRjlxWAzxJrZRELT84pL7F7i/fFZpj6z+/2m57lrFQLMrSUf1RKgMD9dOKiUSa9g8a9S/vEh8nE1E9nEVcI2p1tjGaAg1sDkg8T+HOOWe8Cz/+SH24ygF61ICvua1Khj41uC0MfmQM4nJgLk/eRBHpRb5mGg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167274416879861.82081034830958; Tue, 3 Jan 2023 03:09:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCfA0-0005IG-Cq; Tue, 03 Jan 2023 06:08:48 -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 1pCf9y-0005FH-Bk for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:46 -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 1pCf9w-0005EC-SN for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:46 -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-619-c4yy7r_3Ml64oGrgCT8WPg-1; Tue, 03 Jan 2023 06:08:41 -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 A52603806713; Tue, 3 Jan 2023 11:08:40 +0000 (UTC) Received: from localhost (unknown [10.39.208.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A9A3492D8B; Tue, 3 Jan 2023 11:08:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672744124; 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=1x1nyouCPKbpTgkt0ZiXSb5aulxYAxy2EYdUhTpbC9s=; b=XuzqQsul8sjprZahyWQRGdQk0PKoDElk3Rv81psIqF09NWs+/RXS+/6pOsJUR+PU+L+nwi HDETYeAf2zIa2Y+k0n5lR7wm0ais7P9mZcO5ucjzBmeQ7u+P5UkEJwHXlC98WlPOlPF55U XWHYmOaqA0hKeH01mCeJ7pfmOkuW4R4= X-MC-Unique: c4yy7r_3Ml64oGrgCT8WPg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eric Blake , Beraldo Leal , Thomas Huth , Wainer dos Santos Moschetta , Gerd Hoffmann , Stefan Weil , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 05/10] tests/readconfig: spice doesn't support unix socket on windows yet Date: Tue, 3 Jan 2023 15:08:09 +0400 Message-Id: <20230103110814.3726795-6-marcandre.lureau@redhat.com> In-Reply-To: <20230103110814.3726795-1-marcandre.lureau@redhat.com> References: <20230103110814.3726795-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+importer=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672744170222100003 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth --- tests/qtest/readconfig-test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/qtest/readconfig-test.c b/tests/qtest/readconfig-test.c index c7a9b0c7dd..9ef870643d 100644 --- a/tests/qtest/readconfig-test.c +++ b/tests/qtest/readconfig-test.c @@ -109,8 +109,10 @@ static void test_spice(void) QTestState *qts; const char *cfgdata =3D "[spice]\n" - "disable-ticketing =3D \"on\"\n" - "unix =3D \"on\"\n"; +#ifndef WIN32 + "unix =3D \"on\"\n" +#endif + "disable-ticketing =3D \"on\"\n"; =20 qts =3D qtest_init_with_config(cfgdata); /* Test valid command */ --=20 2.39.0 From nobody Thu May 16 01:13:01 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672744150; cv=none; d=zohomail.com; s=zohoarc; b=QqQw843Lp7H30iD54I6d+ihcUj4PC/oB9NrLtlx7MpTK1qMqjeVxVjFQWH1UyaxjL9gv/z6QGJo5gto4M2siszf3e7kOQyYx9FSKeAn5+tcxw5vNa57CcoX6cwak2hhOqEc/YBmWFzpK0zocrS5oMkt/lOqkac+dHWSgQ7gy8XA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672744150; 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=RKOpCRi1MkWMPwp2hM/J/4sn8JPl8vtlh2CrbCGGR+s=; b=ikVEf1kWUNslUXa6AZD+JRteItpdhzE34tKBPxQSpVa9CUEeWDzawj3hnY/NeaFoGmey0+GrRSqgTSKeih8hUQ/phEciDouojIpqSDBpFF7/RqV81GMGcThPgq9Dxvpr3C8bUIo6VcEVz3GulRH/he1hanLjStctzaYmASVTl9g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672744150780486.34527431470883; Tue, 3 Jan 2023 03:09:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCfA4-0005OY-Rv; Tue, 03 Jan 2023 06:08:52 -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 1pCfA3-0005MW-Kk for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:51 -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 1pCfA1-0005Ed-Ss for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:51 -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-126-Hob5w8fiM5Snjlhakr6p6A-1; Tue, 03 Jan 2023 06:08:46 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C39BC1C05EAC; Tue, 3 Jan 2023 11:08:45 +0000 (UTC) Received: from localhost (unknown [10.39.208.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55DA9C15BA0; Tue, 3 Jan 2023 11:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672744129; 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=RKOpCRi1MkWMPwp2hM/J/4sn8JPl8vtlh2CrbCGGR+s=; b=UB3CLOX46+fAVikBBDv3OcMOCnU1UXPsndkg02+7dTZ7L3A1NKN/7aBUHk3xIRlq00JhlY g7hDFXmKIcG5hDpQPoUYeECVBmDCIIxkutv1cIFznOpHP+AffRn74BsrN1gmy/nrb9LZru KSj6ZYUbl3BjGs2xmNY6ydBwz0IWD2o= X-MC-Unique: Hob5w8fiM5Snjlhakr6p6A-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eric Blake , Beraldo Leal , Thomas Huth , Wainer dos Santos Moschetta , Gerd Hoffmann , Stefan Weil , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 06/10] osdep: implement qemu_socketpair() for win32 Date: Tue, 3 Jan 2023 15:08:10 +0400 Message-Id: <20230103110814.3726795-7-marcandre.lureau@redhat.com> In-Reply-To: <20230103110814.3726795-1-marcandre.lureau@redhat.com> References: <20230103110814.3726795-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.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672744152491100005 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.0 From nobody Thu May 16 01:13:01 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672744180; cv=none; d=zohomail.com; s=zohoarc; b=ZtZpO4IMdFBXCa4L6QXmcvRs6kcjlU3CzsNV+iIe/GsUle7oju7DSTMyNiKO9HTvhC8rdYJY+cIOYzaceBHl36k6/vI4/eZ8+5Yz43e3fQ1Ch2ARXiWLKROdyDr2VTfB61sCoQsohr9AeWTc3ZcgLRlWV//4MnHe9M1jKyseCKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672744180; 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=0PreR5Ei6Fw8qP9AzrblH/jDo7Gi98t8fcPxixkCwUo=; b=UkSjnTd5gOSsjzYRTZLoas0c97TZHkaeu16rohYGHS/+R/sSGgQjxJ9o5RND+kORh4EHPM0kLEe05c009OO+sf/pO9z14hcc6EaWw1Ll8tWkMrO3+Y0cQlq8pUJ36j9rGB6OWUtVQdj37WEdRj+XKbq/ZrLfi/VemPPOOV8XazY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167274418047169.11935043649964; Tue, 3 Jan 2023 03:09:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCfA7-0005SQ-Bz; Tue, 03 Jan 2023 06:08:55 -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 1pCfA5-0005QD-Tf for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:53 -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 1pCfA4-0005En-Bt for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:53 -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-214-iSX3FzyIODiCMXX-eesPow-1; Tue, 03 Jan 2023 06:08:50 -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 E46BC3806713; Tue, 3 Jan 2023 11:08:49 +0000 (UTC) Received: from localhost (unknown [10.39.208.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 28658140EBF4; Tue, 3 Jan 2023 11:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672744131; 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=0PreR5Ei6Fw8qP9AzrblH/jDo7Gi98t8fcPxixkCwUo=; b=UpWkjTwf2fsfmi5cbfG6dE/pUCnCGoBYvlH3smCM0aD4SnRtV2EZdIMGckdWHjPxYIV4Gk kaw0n9UBZhmO1owf2JYti91Gku0ZtgkGX4BkzAmxtb/9YYdhYLB168bHCVh542Er4B4ZPH Yl71XLqZd3fRHBzsduQD8HHnW2rjIhc= X-MC-Unique: iSX3FzyIODiCMXX-eesPow-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eric Blake , Beraldo Leal , Thomas Huth , Wainer dos Santos Moschetta , Gerd Hoffmann , Stefan Weil , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 07/10] qmp: 'add_client' actually expects sockets Date: Tue, 3 Jan 2023 15:08:11 +0400 Message-Id: <20230103110814.3726795-8-marcandre.lureau@redhat.com> In-Reply-To: <20230103110814.3726795-1-marcandre.lureau@redhat.com> References: <20230103110814.3726795-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+importer=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672744182456100001 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 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 2932b3f3a5..c491eb262b 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -20,6 +20,7 @@ #include "sysemu/sysemu.h" #include "qemu/config-file.h" #include "qemu/uuid.h" +#include "qemu/sockets.h" #include "chardev/char.h" #include "ui/qemu-spice.h" #include "ui/console.h" @@ -248,16 +249,22 @@ 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; + } + if (strcmp(protocol, "spice") =3D=3D 0) { if (!qemu_using_spice(errp)) { - close(fd); + closesocket(fd); return; } skipauth =3D has_skipauth ? skipauth : false; tls =3D has_tls ? tls : false; if (qemu_spice.display_add_client(fd, skipauth, tls) < 0) { error_setg(errp, "spice failed to add client"); - close(fd); + closesocket(fd); } return; #ifdef CONFIG_VNC @@ -269,11 +276,11 @@ void qmp_add_client(const char *protocol, const char = *fdname, #ifdef CONFIG_DBUS_DISPLAY } else if (strcmp(protocol, "@dbus-display") =3D=3D 0) { if (!qemu_using_dbus_display(errp)) { - close(fd); + closesocket(fd); return; } if (!qemu_dbus_display.add_client(fd, errp)) { - close(fd); + closesocket(fd); return; } return; @@ -281,14 +288,14 @@ void qmp_add_client(const char *protocol, const char = *fdname, } else if ((s =3D qemu_chr_find(protocol)) !=3D NULL) { if (qemu_chr_add_client(s, fd) < 0) { error_setg(errp, "failed to add client"); - close(fd); + closesocket(fd); return; } return; } =20 error_setg(errp, "protocol '%s' is invalid", protocol); - close(fd); + closesocket(fd); } =20 =20 --=20 2.39.0 From nobody Thu May 16 01:13:01 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672744166; cv=none; d=zohomail.com; s=zohoarc; b=HhSqczVPoFp5NYhraPGZBG5Z3nTTD6fxtOYESGAgxHH8883XIrSU7KHFrwCCLiMf7GRzLMRqVJho+NAN/D+PgfMqUDeC1MrD3B09CA50s769lkOShKppl3yIl2Va0mwGPREbfc4FXoVLm06nEpJbBhO5RtMvRndrzB85W2Qy5XE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672744166; 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=gS/H2kJ5iu/hszxvqB7vTpfhoqUwZ4nZXbFYP75rS3w=; b=AJAP77R0UV2d8RD4D9H5d1OmITSTtheXeG9FERGsGlzrSmmc1s0rw82dBRZcUXYWQbnEwLxiup5FTnyrAf4kJwa4M5+w5JFEbjczuXw3JH/L4JFx8arM57r9FwaBtlMOGN5seDLn1oMoxEqgYu85DjeR0A5ccp3Vn6Pw1QmtM/w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672744166330323.39586436599745; Tue, 3 Jan 2023 03:09:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCfAC-0005ah-Pn; Tue, 03 Jan 2023 06:09:00 -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 1pCfAA-0005Y4-So for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:58 -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 1pCfA9-0005Ez-4x for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:08:58 -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-615-C-NympMuNhumwVBRzzVTpQ-1; Tue, 03 Jan 2023 06:08:55 -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 DFBB91C05EAC; Tue, 3 Jan 2023 11:08:54 +0000 (UTC) Received: from localhost (unknown [10.39.208.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92E26492D8B; Tue, 3 Jan 2023 11:08:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672744136; 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=gS/H2kJ5iu/hszxvqB7vTpfhoqUwZ4nZXbFYP75rS3w=; b=IwgO7jLKOiCcCfTxOLiJLmSRwyU64xCCs12/ZR0KiA6O0FS2oNrnPUDuhq+d82q77WkJFX QXBHfunAMXezjkwoTST8hllU9kNgsTVGVcnm4Q4VxAWYhItRTr5nrIY1g5K4y3XlnnncuM KCkBeWVcp9emgHui07MY3OIk18+YSWY= X-MC-Unique: C-NympMuNhumwVBRzzVTpQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eric Blake , Beraldo Leal , Thomas Huth , Wainer dos Santos Moschetta , Gerd Hoffmann , Stefan Weil , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 08/10] qmp: add 'get-win32-socket' Date: Tue, 3 Jan 2023 15:08:12 +0400 Message-Id: <20230103110814.3726795-9-marcandre.lureau@redhat.com> In-Reply-To: <20230103110814.3726795-1-marcandre.lureau@redhat.com> References: <20230103110814.3726795-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+importer=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672744168164100001 From: Marc-Andr=C3=A9 Lureau A process with enough capabilities can duplicate a socket to QEMU. Add a QMP command 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 | 32 ++++++++++++++++++++++ monitor/misc.c | 74 ++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 91 insertions(+), 15 deletions(-) diff --git a/qapi/misc.json b/qapi/misc.json index 27ef5a2b20..a19dd78fab 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -272,6 +272,38 @@ ## { 'command': 'getfd', 'data': {'fdname': 'str'} } =20 +## +# @get-win32-socket: +# +# Add a socket that was duplicated to QEMU process with WSADuplicateSocket= W() +# via WSASocket() & WSAPROTOCOL_INFOW structure and assign it a name. A SO= CKET +# is considered as a kind of "file descriptor" by QMP clients, for histori= cal +# reasons and simplicity, although QEMU takes care to use socket functions +# appropriately. +# +# @info: the WSAPROTOCOL_INFOW structure (encoded in base64) +# +# @fdname: file descriptor name +# +# Returns: Nothing on success +# +# Since: 8.0 +# +# Notes: If @fdname already exists, the file descriptor assigned to +# it will be closed and replaced by the received file +# descriptor. +# +# The 'closefd' command can be used to explicitly close the +# file descriptor when it is no longer needed. +# +# Example: +# +# -> { "execute": "get-win32-socket", "arguments": { "info": "abcd123..", = fdname": "skclient" } } +# <- { "return": {} } +# +## +{ 'command': 'get-win32-socket', 'data': {'info': 'str', 'fdname': 'str'},= 'if': 'CONFIG_WIN32' } + ## # @closefd: # diff --git a/monitor/misc.c b/monitor/misc.c index bf3f1c67ca..4dd76afb4f 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -73,6 +73,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" @@ -1002,27 +1003,29 @@ static void hmp_wavcapture(Monitor *mon, const QDic= t *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; } @@ -1030,7 +1033,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 @@ -1038,7 +1041,21 @@ 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, Error **errp) +{ + Monitor *cur_mon =3D monitor_cur(); + int 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; + } + + return monitor_add_fd(cur_mon, fd, fdname, errp); } =20 void qmp_closefd(const char *fdname, Error **errp) @@ -1059,7 +1076,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 @@ -1152,6 +1169,33 @@ error: return NULL; } =20 +#ifdef _WIN32 +void qmp_get_win32_socket(const char *infos, const char *fdname, Error **e= rrp) +{ + g_autofree WSAPROTOCOL_INFOW *info =3D NULL; + gsize len; + SOCKET sk; + + info =3D (void *)g_base64_decode(infos, &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(WSAGetLastError()= ); + error_setg(errp, "Couldn't create socket: %s", emsg); + return; + } + + monitor_add_fd(monitor_cur(), sk, fdname, errp); +} +#endif + void qmp_remove_fd(int64_t fdset_id, bool has_fd, int64_t fd, Error **errp) { MonFdset *mon_fdset; --=20 2.39.0 From nobody Thu May 16 01:13:01 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672744199; cv=none; d=zohomail.com; s=zohoarc; b=Tnrq2uZ+PpL9B4jtoKd/cdoFVrZbqCI7F1FCQazsztt3VeWIG6HH925qtERzNqJrxoiJ0uV3H8XWK9xcydFADCEaeM+L+nd878YOxX+8t+Jc2mB2M6NKON/59RV+FBBcSWsaIaNdvRwTNhAlQ4JH6Ey26tApxqE71M0NpkWEEjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672744199; 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=u9ZSSTQmq45eN33CWPNOgaR1C1o4yK5Q/D6KawIPCV4=; b=CsFs2aBzyiieAP0Ltyb0nbD3qajL+L94cwGjz6h5JIVG7zdBqUM2FEYnJnlPBdKeiPAmfR0vmuZH1vg5QgvJbGJTZ8FhzzurRim7MB8VzmZFS3F1Fq7jgNyL6qv6Ek+KlPKBbDqAVWdjb2IOmULUTJ6V9ADdIDMFVD5YhKiPGCk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672744199493274.69673004640833; Tue, 3 Jan 2023 03:09:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCfAQ-0006FF-7f; Tue, 03 Jan 2023 06:09:14 -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 1pCfAN-00061h-2r for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:09:11 -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 1pCfAL-0005GE-4s for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:09:10 -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-212-k50zb7m1Nt2hOVRELwvlww-1; Tue, 03 Jan 2023 06:09:05 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 174D28F6E81; Tue, 3 Jan 2023 11:09:05 +0000 (UTC) Received: from localhost (unknown [10.39.208.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B68340C2064; Tue, 3 Jan 2023 11:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672744148; 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=u9ZSSTQmq45eN33CWPNOgaR1C1o4yK5Q/D6KawIPCV4=; b=btbtvZkjBkwXWC6ikf+9x1dV2NNPlmn5jB6hMhb+MX+XQFhnW+dsV1Gvyai7f3+DU3s7oc BApPmM1QJO6nqqxHhjiU87rv3I5goZ5943d3/AvKJYjDzKLBhStGRzfqoscAu05HlgV4Pj QIdFmklt3zxQZekQn6RrT7E+SEl1BnA= X-MC-Unique: k50zb7m1Nt2hOVRELwvlww-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eric Blake , Beraldo Leal , Thomas Huth , Wainer dos Santos Moschetta , Gerd Hoffmann , Stefan Weil , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 09/10] libqtest: make qtest_qmp_add_client work on win32 Date: Tue, 3 Jan 2023 15:08:13 +0400 Message-Id: <20230103110814.3726795-10-marcandre.lureau@redhat.com> In-Reply-To: <20230103110814.3726795-1-marcandre.lureau@redhat.com> References: <20230103110814.3726795-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.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672744200357100001 From: Marc-Andr=C3=A9 Lureau Use the "get-win32-socket" function to pass an opened socket to QEMU, instead of using "getfd", which relies on socket ancillary FD message passing. Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Thomas Huth --- tests/qtest/libqtest.h | 5 ++--- tests/qtest/libqtest.c | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h index fcf1c3c3b3..8d7d450963 100644 --- a/tests/qtest/libqtest.h +++ b/tests/qtest/libqtest.h @@ -758,17 +758,16 @@ void qtest_qmp_device_add_qdict(QTestState *qts, cons= t 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 * @protocol: the protocol to add to * @fd: the client file-descriptor * - * Call QMP ``getfd`` followed by ``add_client`` with the given @fd. + * Call QMP ``getfd`` (on Windows ``get-win32-socket``) 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 2fbc3b88f3..63ec328e27 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -1440,13 +1440,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': 'get-win32-socket'," + "'arguments': {'fdname': 'fdname', 'info': %s}}", inf= o64); +#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")); @@ -1460,7 +1473,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.0 From nobody Thu May 16 01:13:01 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672744326; cv=none; d=zohomail.com; s=zohoarc; b=H3oKaBV2uoE1+wNjp/tAcueokeqUp24wHl7VMREAxztOYbgSE+jXbSpEHIl7dvhcKv47QH4TjKEl0fSzLmlehQ36eSQyXfO/wFDTcAfJyuEcan40+JKMu023Gy3jDCptq43E7J9rFIBP3e1zaD5Y17xWK23TMPV5gT9DJW9Ml+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672744326; 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=jQ9LtivY9CR5RPIbb7tTsm7r9crWb6ab4EdtyVrUrxE=; b=H5SZQfIra0Vro71Q0USynLleTFn/EbxjtekwxL2A8bbmY1m2J55OpLO4S5YhR5iI36chg2nURhslX96aP/sHZFKxFQ028a5cYRwlwgXiAyFftDvtgW7eYj8MGNCb+T9vlmxdzIRFHSER6pB2UdwCfVeTztBAyiXxyVhsFxzYAJM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672744326143873.8920909134379; Tue, 3 Jan 2023 03:12:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCfAX-0006M2-6S; Tue, 03 Jan 2023 06:09:21 -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 1pCfAS-0006KD-Co for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:09:16 -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 1pCfAQ-0005IP-SS for qemu-devel@nongnu.org; Tue, 03 Jan 2023 06:09:16 -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-83-goScLYm5PB20lzsaDT4X4A-1; Tue, 03 Jan 2023 06:09:10 -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 430CA3810781; Tue, 3 Jan 2023 11:09:10 +0000 (UTC) Received: from localhost (unknown [10.39.208.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0DC82026D4B; Tue, 3 Jan 2023 11:09:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672744154; 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=jQ9LtivY9CR5RPIbb7tTsm7r9crWb6ab4EdtyVrUrxE=; b=F470SJy1Igh/jjelOV0ABzYCfokhSX5PW2iu5yHktf5sdk0sUfAwMGsG9q1u6uioedZ+Cg rGxKaz8PdUVQTlt73bAS+7e/LzWXhbCDXGxR0f0ii/dxUnG4l6G8avPZsCm1w/R+7ZEZJZ slTKToHMJ0uiATC8TsA/EiOHGsDgqnU= X-MC-Unique: goScLYm5PB20lzsaDT4X4A-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eric Blake , Beraldo Leal , Thomas Huth , Wainer dos Santos Moschetta , Gerd Hoffmann , Stefan Weil , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 10/10] qtest: enable vnc-display test on win32 Date: Tue, 3 Jan 2023 15:08:14 +0400 Message-Id: <20230103110814.3726795-11-marcandre.lureau@redhat.com> In-Reply-To: <20230103110814.3726795-1-marcandre.lureau@redhat.com> References: <20230103110814.3726795-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+importer=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672744326907100001 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.0