From patchwork Tue Sep 15 12:12:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273727 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 091BEC433E2 for ; Tue, 15 Sep 2020 12:24:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 75DBA2078E for ; Tue, 15 Sep 2020 12:24:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GJ1StaBr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75DBA2078E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIA0f-0002zF-FC for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:24:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9qE-0000TF-BT; Tue, 15 Sep 2020 08:13:47 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:42200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9qC-00088x-EN; Tue, 15 Sep 2020 08:13:46 -0400 Received: by mail-pl1-x644.google.com with SMTP id y6so1238554plt.9; Tue, 15 Sep 2020 05:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hrJEqDkxFKpoRhRzMOgEeJejUGbXqPW0+cFjCJrQlA0=; b=GJ1StaBr/nZdQchwU/7KeA7/NzcOt0HN5hJLx1Kbbhh6vaoV2oM7Make5Pwx5Wqh0s cJXJgAwi6Cv4Y1PArVIl+BxCaLGtVpZFnmEOjdQQY1JPXNrnLqVZKMUhM9n/oMTpIl27 0mVvzpzst0iJqZmhGiZiC+naauOy4A04VQkbbmwuyzuRU+fABqkHaGWyj6lipSwJYmVP EqAdRLRFY1dFwcKx/3jR9ws18Tj9nzcfI0+BsSeQUrvzpKEZqcK+gXpDZlYfYeAayUmW s5cnOGKbKjQ6enQdCIwqOOkvBe7DTxSg91nrZdSNilW1SyUAdnCPKbWFnbjwasocuKvO 6BMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hrJEqDkxFKpoRhRzMOgEeJejUGbXqPW0+cFjCJrQlA0=; b=PGfV9PqsHKA7ytDzgAnTMelhNyIcB29ICzj9SkY6n62gM6aSS4oXkx3/MUemc8viUB lyXwJFGRbbsfEjKDP/LGR9I4HS4RZ7UMvXbdKR21KhkHXj0FP9aF61SOSaVTMtW8lEBF daVfVdu4geWiI33STIV8c3pQred2MkcjQkgHjAx0xRqT0GEyGiFNpFu7WN87Im77Tt5J S4tJnIaSVj0TEJSX9MLKCRnEHCa40n9WbzW/Rup0gchL1KTH4r3pABB33iALLvlzKaTj nXeBl00PX6XduZ3IeYQnuKugYNAcR9gnGsi+maCKlWC+NgkvkbhdNUN+dBaUyl5JPZMs IoTQ== X-Gm-Message-State: AOAM5320Tsc37LgNeCJD0qt3JvlehM+pD+1R6KJASHdOZUzp5txGSDCj lJbkTj8LQVP/kFBIFYx9zfbojuMGMi77WJIe2Ek= X-Google-Smtp-Source: ABdhPJwmjqGvN4a+j3C220iTzyKPgVJJria+iIneKlGbcg1aJmnxM3IeYRl2ySuay3yttnhKKhZUrg== X-Received: by 2002:a17:902:d714:b029:d0:cbe1:e7a2 with SMTP id w20-20020a170902d714b02900d0cbe1e7a2mr18447239ply.19.1600172022299; Tue, 15 Sep 2020 05:13:42 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:13:41 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 01/26] rcu: Implement drain_call_rcu Date: Tue, 15 Sep 2020 20:12:53 +0800 Message-Id: <20200915121318.247-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::644; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x644.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Maxim Levitsky , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Hajnoczi , Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Gerd Hoffmann , Stefan Hajnoczi , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Maxim Levitsky This will allow is to preserve the semantics of hmp_device_del, that the device is deleted immediatly which was changed by previos patch that delayed this to RCU callback Signed-off-by: Maxim Levitsky Suggested-by: Stefan Hajnoczi Reviewed-by: Stefan Hajnoczi --- include/qemu/rcu.h | 1 + util/rcu.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/include/qemu/rcu.h b/include/qemu/rcu.h index 570aa603eb..0e375ebe13 100644 --- a/include/qemu/rcu.h +++ b/include/qemu/rcu.h @@ -133,6 +133,7 @@ struct rcu_head { }; extern void call_rcu1(struct rcu_head *head, RCUCBFunc *func); +extern void drain_call_rcu(void); /* The operands of the minus operator must have the same type, * which must be the one that we specify in the cast. diff --git a/util/rcu.c b/util/rcu.c index 60a37f72c3..c4fefa9333 100644 --- a/util/rcu.c +++ b/util/rcu.c @@ -293,6 +293,61 @@ void call_rcu1(struct rcu_head *node, void (*func)(struct rcu_head *node)) qemu_event_set(&rcu_call_ready_event); } + +struct rcu_drain { + struct rcu_head rcu; + QemuEvent drain_complete_event; +}; + +static void drain_rcu_callback(struct rcu_head *node) +{ + struct rcu_drain *event = (struct rcu_drain *)node; + qemu_event_set(&event->drain_complete_event); +} + +/* + * This function ensures that all pending RCU callbacks + * on the current thread are done executing + + * drops big qemu lock during the wait to allow RCU thread + * to process the callbacks + * + */ + +void drain_call_rcu(void) +{ + struct rcu_drain rcu_drain; + bool locked = qemu_mutex_iothread_locked(); + + memset(&rcu_drain, 0, sizeof(struct rcu_drain)); + qemu_event_init(&rcu_drain.drain_complete_event, false); + + if (locked) { + qemu_mutex_unlock_iothread(); + } + + + /* + * RCU callbacks are invoked in the same order as in which they + * are registered, thus we can be sure that when 'drain_rcu_callback' + * is called, all RCU callbacks that were registered on this thread + * prior to calling this function are completed. + * + * Note that since we have only one global queue of the RCU callbacks, + * we also end up waiting for most of RCU callbacks that were registered + * on the other threads, but this is a side effect that shoudn't be + * assumed. + */ + + call_rcu1(&rcu_drain.rcu, drain_rcu_callback); + qemu_event_wait(&rcu_drain.drain_complete_event); + + if (locked) { + qemu_mutex_lock_iothread(); + } + +} + void rcu_register_thread(void) { assert(rcu_reader.ctr == 0); From patchwork Tue Sep 15 12:12:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273717 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1EC7C43461 for ; Tue, 15 Sep 2020 12:38:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5875D20731 for ; Tue, 15 Sep 2020 12:38:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FJLN2R8R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5875D20731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAEY-0006dI-EG for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:38:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9qI-0000XJ-S3; Tue, 15 Sep 2020 08:13:51 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:40210) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9qH-000899-1G; Tue, 15 Sep 2020 08:13:50 -0400 Received: by mail-pj1-x1044.google.com with SMTP id gf14so1614294pjb.5; Tue, 15 Sep 2020 05:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qBiHjFc2XldMuU70Rv/GASQm/Q1CmoJMQE32Qhbbw0w=; b=FJLN2R8RyyiCUgjf4S7wi5csg/znuwBY8H9s2TJQJ2ni/KB0yZaDm+TeNK1KBT5iNg 7fLoZimL7CufnMQo1TrFW0xHKCTmxb1K9jQD8GlDZsNWjW7BwlihqkcDWiFE58uXFNv6 INUy35fQmuNohONEhl84oDPahsjKWSnQoAtFjjP0/C3MG3J+VKrIaUqvqEX5OnaCDBgN AlXVetsJFmuAUhGuO37xhsgLXKeJ7cgL5DaMcUAirJp0Rt3QHA1O1mLGOxLdlI7Y+vd/ WactelzQkIVSQCOJamFB5yNit/LxzUkRwExt8A4PsVdFStiQhH1e7OLWON7/lowyLU1i 0ccw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qBiHjFc2XldMuU70Rv/GASQm/Q1CmoJMQE32Qhbbw0w=; b=p44MfaKw+ajJwN8+chDgX18eBYH5DUuj2nSfi0jwiNUkUvjI8FZmLXH6my6oW0z0E3 1tOLteM6RMjEMr/yB6YTbwcuzXF2xFNLMvZjP82gnU1EgRNiEhpZZQk+xGA+US31Ywmo w015pyl1CMv15ZYYOc6KiyW+yz9xBwCFOMWInph9Kd6pUcoYE/3cBzH3BMPW8fhoaEZb 84FrK7ZrAqu35wk82mj27Z4TyaESITyleKZinCMgKm6/1MHktY10zKOHAoGTLbwfZGB3 VwTXfjh/cSVM2CSjYEYDYvJsfUIy2vxRh5vEVA8hEfRep5WeId1iWB0kFv1gbyaQV1iB aUaQ== X-Gm-Message-State: AOAM53338pbZE6fAFSDcMs6mgxayisZLYFJViiqRyUve5ueyvbOYqdPu IZdYIYWDG6yQnHgBb7qWCAM2+SqsJmYBKLhfrR8= X-Google-Smtp-Source: ABdhPJwUGnNJNo26A0ff1ET+pLtDkOBF7JIHVPUdG6sQi+qP73QgIUQ71caVdf1G9VDGAyPKh3qkHA== X-Received: by 2002:a17:902:c202:b029:d1:cbf4:c596 with SMTP id 2-20020a170902c202b02900d1cbf4c596mr7840166pll.27.1600172026597; Tue, 15 Sep 2020 05:13:46 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.13.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:13:45 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 02/26] ci: fixes msys2 build by upgrading capstone to 4.0.2 Date: Tue, 15 Sep 2020 20:12:54 +0800 Message-Id: <20200915121318.247-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1044.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The currently random version capstone have the following compiling issue: CC /c/work/xemu/qemu/build/slirp/src/arp_table.o make[1]: *** No rule to make target “/c/work/xemu/qemu/build/capstone/capstone.lib”。 Stop. Subproject commit 1d230532840a37ac032c6ab80128238fc930c6c1 are the tagged version 4.0.2 when upgrading to this version, the folder structure of include are changed to qemu\capstone\include │ platform.h │ ├─capstone │ arm.h │ arm64.h │ capstone.h │ evm.h │ m680x.h │ m68k.h │ mips.h │ platform.h │ ppc.h │ sparc.h │ systemz.h │ tms320c64x.h │ x86.h │ xcore.h │ └─windowsce intrin.h stdint.h in capstone. so we need add extra include path -I${source_path}/capstone/include/capstone for directly #include , and the exist include path should preserve, because in capstone code there something like #include "capstone/capstone.h" If only using capstone_cflags="-I${source_path}/capstone/include/capstone" Then will cause the following compiling error: CC cs.o cs.c:17:10: fatal error: 'capstone/capstone.h' file not found #include ^~~~~~~~~~~~~~~~~~~~~ 1 error generated. Signed-off-by: Yonggang Luo --- capstone | 2 +- configure | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/capstone b/capstone index 22ead3e0bf..1d23053284 160000 --- a/capstone +++ b/capstone @@ -1 +1 @@ -Subproject commit 22ead3e0bfdb87516656453336160e0a37b066bf +Subproject commit 1d230532840a37ac032c6ab80128238fc930c6c1 diff --git a/configure b/configure index ce27eafb0a..f59080703e 100755 --- a/configure +++ b/configure @@ -5157,7 +5157,7 @@ case "$capstone" in LIBCAPSTONE=libcapstone.a fi capstone_libs="-Lcapstone -lcapstone" - capstone_cflags="-I${source_path}/capstone/include" + capstone_cflags="-I${source_path}/capstone/include -I${source_path}/capstone/include/capstone" ;; system) From patchwork Tue Sep 15 12:12:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFF70C2D0E0 for ; Tue, 15 Sep 2020 12:31:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 920E320731 for ; Tue, 15 Sep 2020 12:31:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qk+YOmHE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 920E320731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIA7o-0004cO-KV for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:31:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9qP-0000ak-Bd; Tue, 15 Sep 2020 08:13:58 -0400 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:52112) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9qL-00089k-Ga; Tue, 15 Sep 2020 08:13:56 -0400 Received: by mail-pj1-x1043.google.com with SMTP id a9so1680480pjg.1; Tue, 15 Sep 2020 05:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7fnZxHJTw3qRgRORiSXEFhRbwParpG4yt1WADaHZ43Y=; b=Qk+YOmHE3tfPOAjPdwg5eTeSHt5mAzdry6/GkWmwhid6/i/9Xlh39nIdj6RnI+QQZv 3Djvyj0PYubZmVv293ZvYCohUX+UxyChDIxb9+mfmR6G2FTaZF5Kvt1y5eWBbfEz/qUd ym86n3W63rWlu81PmClxdyOHyZ5vE1ggbhyY6b29DbG4SPruhMOS2WPP0C2nNb01Dg5M r+ihDpXPguMWMLXPXdBZzQCBdJOP6n7oRFa6A7c8vp20rEgLmeSBNqiCwNjHLokVgl4v tgFQ5cGIBC0JXPttvcfkklXaJ2/72MCq2EetZbFxGtfs8fQCpdo1Jt3zkqSC/ax1osdI R1mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7fnZxHJTw3qRgRORiSXEFhRbwParpG4yt1WADaHZ43Y=; b=i7TKa+mLihLIxrF2oFfXMWyx1YNH8IHOv/D8Tkpk74jCvyUtWXSlJ5LM2NVXhgKnsO o9CVe7cDPCbI8ZDGuiXopWiEXyPrL3AiqhTYiDbWoEMsSenSjc3tmm2hBAiGvlZJzn1r xF0OXgpibi+XYZ4s8C64JyXQ/4UmGJ/INO+GCsJoTBgnY5E3LC5v0WhmFgmDXNABeva+ bfUaguyGZVSiURvJVZvKGI1m3oe7oavPeOiKwjscPYJRhv5rEyzpfLW2XrP29oEoxZ3g pbwUS4LbDZvXfbx4uo9y2pseby4A3mqDxSTITKwF+8L5imdC47u+g9aQyzaesVf+4gcu z7Lg== X-Gm-Message-State: AOAM532KRW5ZBK9spcvmRmPONermCaGdx/IHHc1H5ViptZUQaI3hkcD4 M6dAjphtJ+rI8o9LEeZoE9Ed++Zrk5oJz4SUCCs= X-Google-Smtp-Source: ABdhPJyl4klwCFGrZGeA2OMJwRj8JoB7N1FAbf2S8i/OGmxPaJPhPiQIgE2ygnBCAtDCGWjelIWwkQ== X-Received: by 2002:a17:90b:b0b:: with SMTP id bf11mr3879872pjb.227.1600172031043; Tue, 15 Sep 2020 05:13:51 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.13.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:13:50 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 03/26] configure: Fixes ncursesw detection under msys2/mingw and enable curses Date: Tue, 15 Sep 2020 20:12:55 +0800 Message-Id: <20200915121318.247-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1043.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The mingw pkg-config are showing following absolute path and contains : as the separator, so we must not use : as path separator. and we know the command line parameter are not likely contains newline, we could use newline as path command line parameter separator -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC:/CI-Tools/msys64/mingw64/include/ncursesw:-I/usr/include/ncursesw: -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -lncursesw -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -lcursesw -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lncursesw -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lcursesw -DNCURSES_WIDECHAR -I/usr/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lncursesw -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lcursesw Refer to https://unix.stackexchange.com/a/103011/218958 If your file names are guaranteed not to contain newlines, you can use newlines as the separator. W hen you expand the variable, first turn off globbing with set -f and set the list of field splitting characters IFS to contain only a newline. msys2/mingw lacks the POSIX-required langinfo.h. gcc test.c -DNCURSES_WIDECHAR -I/mingw64/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv test.c:4:10: fatal error: langinfo.h: No such file or directory 4 | #include | ^~~~~~~~~~~~ compilation terminated. So we using g_get_codeset instead of nl_langinfo(CODESET) Signed-off-by: Yonggang Luo Reviewed-by: Gerd Hoffmann --- configure | 25 +++++++++++++++---------- ui/curses.c | 10 +++++----- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/configure b/configure index f59080703e..dc4b7a2e55 100755 --- a/configure +++ b/configure @@ -3654,35 +3654,40 @@ if test "$iconv" = "no" ; then fi if test "$curses" != "no" ; then if test "$mingw32" = "yes" ; then - curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):" - curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses" + curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null) + $($pkg_config --cflags ncursesw 2>/dev/null)" + curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null) + $($pkg_config --libs ncursesw 2>/dev/null) + -lpdcurses" else - curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null):-I/usr/include/ncursesw:" - curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null):-lncursesw:-lcursesw" + curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null) + -I/usr/include/ncursesw:" + curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null) + -lncursesw + -lcursesw" fi curses_found=no cat > $TMPC << EOF #include #include #include -#include int main(void) { - const char *codeset; wchar_t wch = L'w'; setlocale(LC_ALL, ""); resize_term(0, 0); addwstr(L"wide chars\n"); addnwstr(&wch, 1); add_wch(WACS_DEGREE); - codeset = nl_langinfo(CODESET); - return codeset != 0; + return 0; } EOF - IFS=: + IFS=' +' # turn off variable value expansion except for splitting at newlines for curses_inc in $curses_inc_list; do # Make sure we get the wide character prototypes curses_inc="-DNCURSES_WIDECHAR $curses_inc" - IFS=: + IFS=' +' # turn off variable value expansion except for splitting at newlines for curses_lib in $curses_lib_list; do unset IFS if compile_prog "$curses_inc" "$curses_lib" ; then diff --git a/ui/curses.c b/ui/curses.c index a59b23a9cf..12bc682cf9 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -30,7 +30,6 @@ #endif #include #include -#include #include #include "qapi/error.h" @@ -526,6 +525,7 @@ static void font_setup(void) iconv_t nativecharset_to_ucs2; iconv_t font_conv; int i; + g_autofree gchar *local_codeset = g_get_codeset(); /* * Control characters are normally non-printable, but VGA does have @@ -566,14 +566,14 @@ static void font_setup(void) 0x25bc }; - ucs2_to_nativecharset = iconv_open(nl_langinfo(CODESET), "UCS-2"); + ucs2_to_nativecharset = iconv_open(local_codeset, "UCS-2"); if (ucs2_to_nativecharset == (iconv_t) -1) { fprintf(stderr, "Could not convert font glyphs from UCS-2: '%s'\n", strerror(errno)); exit(1); } - nativecharset_to_ucs2 = iconv_open("UCS-2", nl_langinfo(CODESET)); + nativecharset_to_ucs2 = iconv_open("UCS-2", local_codeset); if (nativecharset_to_ucs2 == (iconv_t) -1) { iconv_close(ucs2_to_nativecharset); fprintf(stderr, "Could not convert font glyphs to UCS-2: '%s'\n", @@ -581,7 +581,7 @@ static void font_setup(void) exit(1); } - font_conv = iconv_open(nl_langinfo(CODESET), font_charset); + font_conv = iconv_open(local_codeset, font_charset); if (font_conv == (iconv_t) -1) { iconv_close(ucs2_to_nativecharset); iconv_close(nativecharset_to_ucs2); @@ -602,7 +602,7 @@ static void font_setup(void) /* DEL */ convert_ucs(0x7F, 0x2302, ucs2_to_nativecharset); - if (strcmp(nl_langinfo(CODESET), "UTF-8")) { + if (strcmp(local_codeset, "UTF-8")) { /* Non-Unicode capable, use termcap equivalents for those available */ for (i = 0; i <= 0xFF; i++) { wchar_t wch[CCHARW_MAX]; From patchwork Tue Sep 15 12:12:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05EF0C43461 for ; Tue, 15 Sep 2020 12:34:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2AFC20731 for ; Tue, 15 Sep 2020 12:34:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DSqmYusz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2AFC20731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAA5-0008K2-TI for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:34:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9qS-0000b3-NU; Tue, 15 Sep 2020 08:14:02 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:56016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9qQ-0008AD-Nm; Tue, 15 Sep 2020 08:14:00 -0400 Received: by mail-pj1-x1044.google.com with SMTP id q4so1668671pjh.5; Tue, 15 Sep 2020 05:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lgYFFisioEl97r43OtBikET9wKvUFSMqnEjDRJxGeJs=; b=DSqmYuszXxPS5LG1pe5A6JX7lTPMlpa49EH+xIihxSHnBnCnO/82Tdz68pWEXIChL5 kfQXWCLA5x5V2HAQ5cxq/VsHPhuUyfPMkBOUnZsNuAWiQLC1K/hV0b4dkN10QWRydjVo OBQjPTKrsEOGxrhZVawDjUV4v5YqoA+NIDQ+LD+n9EKZFXRXmizskXtDeIJ2aKI+USnT O4r32pFBJdBQYhsnXYfGiuhHcQOishSUr3bdAtW7lS7nagN/WbuPdtQ8fH/Csii1Za6+ a8tgyVHIp0+peCgvnatbamPN0L1M3wDddR8p0y868PO3N7n06TajY8Af0rl9Er+NXC1H R0Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lgYFFisioEl97r43OtBikET9wKvUFSMqnEjDRJxGeJs=; b=hjnsG8TIaPtOxmA+B01RsldySZe+fqld+Glc95YguXg3k1/2IK7/L/VTyfzaoE8kkt rb9PRZTQBkm++QPFwVN+GVQV4XrRtZLNsCJvUS3BN7JnKvqR1Ot1jti+JTv+M83DMJBK jxPV4tv39QOQmnAb07vcpSimVowfipXBqYrtR2FzixSVSNWWUUA9G9uLbOxgoJ51tyzV FXvsrZJz80qYa++uQ3/yDuXABuYMiNV4PK3zWPFwvTPJS9Ucj/mNyf0c9P6DZIy9mLOx Aea2c1dUl8OCAbU166LNcsP00lneR7jcm1UUOPBjoFzN1tQO3W8nLrWavdzTAMzKgr06 KT8A== X-Gm-Message-State: AOAM533wSdx3Qd2jDPiz8JqGnfSewOMvh9ho3ekCWGPXUp2oxpRBcoZZ qD5JsWCWMiBNDOUf1X59L6Fij5PxYMCMq/GlxBI= X-Google-Smtp-Source: ABdhPJzeoF8zMjcgl4UnoLgbJmK4WTcNahNp9a+LhUuY3heEySjnNWGPaVmKTVKvFT9YWLst7UnQ0w== X-Received: by 2002:a17:90b:1245:: with SMTP id gx5mr3696887pjb.193.1600172035259; Tue, 15 Sep 2020 05:13:55 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:13:54 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 04/26] win32: Simplify gmtime_r detection direct base on _POSIX_THREAD_SAFE_FUNCTIONS. Date: Tue, 15 Sep 2020 20:12:56 +0800 Message-Id: <20200915121318.247-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1044.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" First, this reduce the size of configure, configure are tending to removal in future, and this didn't introduce any new feature or remove any exist feature. Second, the current localtime_r detection are conflict with ncursesw detection in mingw, when ncursesw detected, it will provide the following compile flags pkg-config --cflags ncursesw -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC:/CI-Tools/msys64/mingw64/include/ncursesw And the compile flag _POSIX_C_SOURCE will always cause _POSIX_THREAD_SAFE_FUNCTIONS to be defined, in new version of mingw, that's will cause localtime_r to be defined. But the configure script didn't provide _POSIX_C_SOURCE macro, and that's will result localtime_r not detected because localtime_r are defined in forceinline manner. And finally cause conflict between QEMU defined localtime_r struct tm *localtime_r(const time_t *timep, struct tm *result); with mingw defined localtime_r ``` #if defined(_POSIX_C_SOURCE) && !defined(_POSIX_THREAD_SAFE_FUNCTIONS) #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L #endif #ifdef _POSIX_THREAD_SAFE_FUNCTIONS __forceinline struct tm *__CRTDECL localtime_r(const time_t *_Time, struct tm *_Tm) { return localtime_s(_Tm, _Time) ? NULL : _Tm; } __forceinline struct tm *__CRTDECL gmtime_r(const time_t *_Time, struct tm *_Tm) { return gmtime_s(_Tm, _Time) ? NULL : _Tm; } __forceinline char *__CRTDECL ctime_r(const time_t *_Time, char *_Str) { return ctime_s(_Str, 0x7fffffff, _Time) ? NULL : _Str; } __forceinline char *__CRTDECL asctime_r(const struct tm *_Tm, char * _Str) { return asctime_s(_Str, 0x7fffffff, _Tm) ? NULL : _Str; } #endif ``` So I suggest remove this configure script, and restrict msys2/mingw version to easy to maintain. And use _POSIX_THREAD_SAFE_FUNCTIONS to guard the localtime_r and counterpart functions Signed-off-by: Yonggang Luo --- configure | 34 ---------------------------------- include/sysemu/os-win32.h | 4 ++-- util/oslib-win32.c | 2 +- 3 files changed, 3 insertions(+), 37 deletions(-) diff --git a/configure b/configure index dc4b7a2e55..bac48b5b49 100755 --- a/configure +++ b/configure @@ -2496,37 +2496,6 @@ if test "$vhost_net" = ""; then test "$vhost_kernel" = "yes" && vhost_net=yes fi -########################################## -# MinGW / Mingw-w64 localtime_r/gmtime_r check - -if test "$mingw32" = "yes"; then - # Some versions of MinGW / Mingw-w64 lack localtime_r - # and gmtime_r entirely. - # - # Some versions of Mingw-w64 define a macro for - # localtime_r/gmtime_r. - # - # Some versions of Mingw-w64 will define functions - # for localtime_r/gmtime_r, but only if you have - # _POSIX_THREAD_SAFE_FUNCTIONS defined. For fun - # though, unistd.h and pthread.h both define - # that for you. - # - # So this #undef localtime_r and #include - # are not in fact redundant. -cat > $TMPC << EOF -#include -#include -#undef localtime_r -int main(void) { localtime_r(NULL, NULL); return 0; } -EOF - if compile_prog "" "" ; then - localtime_r="yes" - else - localtime_r="no" - fi -fi - ########################################## # pkg-config probe @@ -7088,9 +7057,6 @@ if [ "$bsd" = "yes" ] ; then echo "CONFIG_BSD=y" >> $config_host_mak fi -if test "$localtime_r" = "yes" ; then - echo "CONFIG_LOCALTIME_R=y" >> $config_host_mak -fi if test "$qom_cast_debug" = "yes" ; then echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak fi diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index d8978e28c0..3ac8a53bac 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -48,12 +48,12 @@ #define siglongjmp(env, val) longjmp(env, val) /* Missing POSIX functions. Don't use MinGW-w64 macros. */ -#ifndef CONFIG_LOCALTIME_R +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS #undef gmtime_r struct tm *gmtime_r(const time_t *timep, struct tm *result); #undef localtime_r struct tm *localtime_r(const time_t *timep, struct tm *result); -#endif /* CONFIG_LOCALTIME_R */ +#endif static inline void os_setup_signal_handling(void) {} static inline void os_daemonize(void) {} diff --git a/util/oslib-win32.c b/util/oslib-win32.c index c654dafd93..f2fa9a3549 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -106,7 +106,7 @@ void qemu_anon_ram_free(void *ptr, size_t size) } } -#ifndef CONFIG_LOCALTIME_R +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS /* FIXME: add proper locking */ struct tm *gmtime_r(const time_t *timep, struct tm *result) { From patchwork Tue Sep 15 12:12:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273725 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CE45C433E2 for ; Tue, 15 Sep 2020 12:27:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94338206DC for ; Tue, 15 Sep 2020 12:27:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jKybfE1z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94338206DC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIA3Y-0006sv-LW for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:27:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9qa-0000eb-3P; Tue, 15 Sep 2020 08:14:08 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:41750) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9qT-0008As-UX; Tue, 15 Sep 2020 08:14:07 -0400 Received: by mail-pf1-x444.google.com with SMTP id z19so1808920pfn.8; Tue, 15 Sep 2020 05:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fONA64XSdMINk4Pb3HJvl02BkTmqUfaoSQk6W/tx2aE=; b=jKybfE1zI6d5pOXCnoptelswEFg9Q5NF1fHohETbbhb93vmuXRaCXzf/kRf1IKvm6+ Sj/bxo8VcYK9d1BrJMYf9LYG3S9o467Pf2rwLNWvcKgABcs+WT4bqOg9PMWhIplwrXIz e+UazDFtbp1POsEGzmKcBEEqOmBaxl65JKLai9W6jnUpWZX+39k/4i6tNGG3oufcfX8N H0fVliMM/nB+z28+Az/vylvXtgpNFaPJaUvNwiDuceMr6auAySYd6bZDC38aXWptBly7 iIpqntLv0mkfpP1JMYg8wSYfQUG3MkUdreXRc4wQAJy7DAHzQR78YP0Ewox+K9NLM2m6 QDAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fONA64XSdMINk4Pb3HJvl02BkTmqUfaoSQk6W/tx2aE=; b=tIJHEUYkWSOn29LE5F4hvCOejHzykJICy7hKbpzb4GsAl9C+qI868rO3JUKXBCd1ks Vm1z/tvmXf6akMIsGtDSb6udRLWpSZJsZ3ab8S2piBU0V+gNkr0A9WFUInHtkCveYma3 L62zGUEI0Q9Jd492vKvD/W+UVmP35FrrlO7ggZHk+l7vnmMjKwHWOOOX9PscJu48bFLI J07qrJVAHGJoRVibNadPfcDgBcDciISTFXzyU36DGPJJcZIEoFq/jSbVIe+oZWOeWO3e tl6Uclw39pZwMYLhNswlxJVIIilOUN7WcG1RkMVCcFYhrVKhpt9szlYQaiZAWwL5wMSu Etsw== X-Gm-Message-State: AOAM533q2iR1CYT/IsfKEUuDytd2rZI4Y4ZeNm1RKXPqoB4xMJImTqJL JUPJL+0C8c3ckLkWEqZJi54dS8jRid46xhiuszE= X-Google-Smtp-Source: ABdhPJzdzT8iRWgMQKzs4bB23T80Qz2ezB5i1OtrNNoyDM7v6I/09rK2+HxMa0JMwAKcimsPgsy1yg== X-Received: by 2002:a63:34d:: with SMTP id 74mr15263390pgd.364.1600172039676; Tue, 15 Sep 2020 05:13:59 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:13:58 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 05/26] curses: Fixes curses compiling errors. Date: Tue, 15 Sep 2020 20:12:57 +0800 Message-Id: <20200915121318.247-6-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::444; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This is the compiling error: ../ui/curses.c: In function 'curses_refresh': ../ui/curses.c:256:5: error: 'next_maybe_keycode' may be used uninitialized in this function [-Werror=maybe-uninitialized] 256 | curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keycode) | ^~~~~~~~~~ ../ui/curses.c:302:32: note: 'next_maybe_keycode' was declared here 302 | enum maybe_keycode next_maybe_keycode; | ^~~~~~~~~~~~~~~~~~ ../ui/curses.c:256:5: error: 'maybe_keycode' may be used uninitialized in this function [-Werror=maybe-uninitialized] 256 | curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keycode) | ^~~~~~~~~~ ../ui/curses.c:265:24: note: 'maybe_keycode' was declared here 265 | enum maybe_keycode maybe_keycode; | ^~~~~~~~~~~~~ cc1.exe: all warnings being treated as errors gcc version 10.2.0 (Rev1, Built by MSYS2 project) Signed-off-by: Yonggang Luo Reviewed-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrangé --- ui/curses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index 12bc682cf9..e4f9588c3e 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -262,7 +262,7 @@ static int curses2foo(const int _curses2foo[], const int _curseskey2foo[], static void curses_refresh(DisplayChangeListener *dcl) { int chr, keysym, keycode, keycode_alt; - enum maybe_keycode maybe_keycode; + enum maybe_keycode maybe_keycode = CURSES_KEYCODE; curses_winch_check(); @@ -299,7 +299,7 @@ static void curses_refresh(DisplayChangeListener *dcl) /* alt or esc key */ if (keycode == 1) { - enum maybe_keycode next_maybe_keycode; + enum maybe_keycode next_maybe_keycode = CURSES_KEYCODE; int nextchr = console_getch(&next_maybe_keycode); if (nextchr != -1) { From patchwork Tue Sep 15 12:12:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C445C2D0E0 for ; Tue, 15 Sep 2020 12:38:52 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B49820731 for ; Tue, 15 Sep 2020 12:38:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GUe2lBps" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B49820731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAEU-0006Sj-IM for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:38:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9qb-0000hH-2O; Tue, 15 Sep 2020 08:14:09 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:37175) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9qY-0008BP-8G; Tue, 15 Sep 2020 08:14:08 -0400 Received: by mail-pf1-x436.google.com with SMTP id w7so1837632pfi.4; Tue, 15 Sep 2020 05:14:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=27ajP4GoRfKO+nbwUgNlBqHfhHBZSCkZ9ODFQ91KtVY=; b=GUe2lBpstfxB3kYLuX7Wd6/cy1HN+HDs9AQtXVMtA7JUG6GM2Ot2H7N8z2nYXfHlxL 08TMIqdH0HBRm+1aW2noJ/dpSN0b3bc8FStLKEh7IaqXzRg8e6vUxlvQIlxobKvq19nE 79np6VzkMVF3L/1vx6qsvnoG7yDy+vtV4CzAHOrNCEvumtLgyhagptnyqyJ1wCgTYIrE M09TeGjlPh5MOSwQkn9/6NSSckURiKbMI0NXlcclXW0gZ6CVXEUajIfEay+I8YnSUNlY X/VyzxC0+XWljSobnjevawFjk3EIjZQBjPS0mPYXD4YdmpqZFaAPF5Ni3910TN0vpj3q HJDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=27ajP4GoRfKO+nbwUgNlBqHfhHBZSCkZ9ODFQ91KtVY=; b=WRqINx4jwrlsbGRiEMnpGXT9WQUL+qPEYoY1y44gQwBkhQeIksgoT1vH+97V/6y4Nb hiImPv/VnFvf86Z0XPAxXe7NulN/i12C4OnLkrZkcTq5x5A8+K+w/MH2+gOl2Ns4GBgE U6s2ICGZTSK/Nqf1Es2MMSzc/VIHIdBXcuTvsmZbGjs/P7Jf4IC8vtHd95cPsGIdtN6U 5OEY2b/MEfj5Y0YiFnFleb18I+wVFT1uyoZgY549zP5VfH02Otj+sMEr9Pvc60wmvUXE TvmfYWOFN0rDARjUzoDD70RXXr6uw2dqfl8FVvendTax8N55Ifz/AABcsqBsREQch8As mOkA== X-Gm-Message-State: AOAM531s+gZF7XXRqPKr/nfhaQW4apv4/9x017BNgU4hssMtJtOPcthz Fndkm6ySrTvMXCQ2OV2bGyMzbyuiVvh4vfUNdiM= X-Google-Smtp-Source: ABdhPJyp5ZHhYYbx9Isymvvx64yDk8hWtwos7sDORYs/JSs4diauC3d/hmzXj0nWh3gsfwT05tEklw== X-Received: by 2002:a63:4d5:: with SMTP id 204mr14831317pge.0.1600172043892; Tue, 15 Sep 2020 05:14:03 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:03 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 06/26] tests: disable /char/stdio/* tests in test-char.c on win32 Date: Tue, 15 Sep 2020 20:12:58 +0800 Message-Id: <20200915121318.247-7-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x436.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" These tests are blocking test-char to be finished. Disable them by using variable is_win32, so we doesn't need macro to open it. and easy recover those function latter. Signed-off-by: Yonggang Luo --- tests/test-char.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tests/test-char.c b/tests/test-char.c index d35cc839bc..184ddceab8 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -77,7 +77,6 @@ static void fe_event(void *opaque, QEMUChrEvent event) } } -#ifdef _WIN32 static void char_console_test_subprocess(void) { QemuOpts *opts; @@ -102,7 +101,7 @@ static void char_console_test(void) g_test_trap_assert_passed(); g_test_trap_assert_stdout("CONSOLE"); } -#endif + static void char_stdio_test_subprocess(void) { Chardev *chr; @@ -1448,7 +1447,11 @@ static SocketAddress unixaddr = { int main(int argc, char **argv) { - bool has_ipv4, has_ipv6; + bool has_ipv4, has_ipv6, is_win32 = false; + +#ifdef _WIN32 + is_win32 = true; +#endif qemu_init_main_loop(&error_abort); socket_init(); @@ -1467,12 +1470,15 @@ int main(int argc, char **argv) g_test_add_func("/char/invalid", char_invalid_test); g_test_add_func("/char/ringbuf", char_ringbuf_test); g_test_add_func("/char/mux", char_mux_test); -#ifdef _WIN32 - g_test_add_func("/char/console/subprocess", char_console_test_subprocess); - g_test_add_func("/char/console", char_console_test); -#endif - g_test_add_func("/char/stdio/subprocess", char_stdio_test_subprocess); - g_test_add_func("/char/stdio", char_stdio_test); + if (0) { + g_test_add_func("/char/console/subprocess", char_console_test_subprocess); + g_test_add_func("/char/console", char_console_test); + } + + if (!is_win32) { + g_test_add_func("/char/stdio/subprocess", char_stdio_test_subprocess); + g_test_add_func("/char/stdio", char_stdio_test); + } #ifndef _WIN32 g_test_add_func("/char/pipe", char_pipe_test); #endif @@ -1534,7 +1540,7 @@ int main(int argc, char **argv) g_test_add_data_func("/char/socket/client/dupid-reconnect/" # name, \ &client8 ##name, char_socket_client_dupid_test) - if (has_ipv4) { + if (has_ipv4 && !is_win32) { SOCKET_SERVER_TEST(tcp, &tcpaddr); SOCKET_CLIENT_TEST(tcp, &tcpaddr); g_test_add_data_func("/char/socket/server/two-clients/tcp", &tcpaddr, From patchwork Tue Sep 15 12:12:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49733C433E2 for ; Tue, 15 Sep 2020 12:41:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A738E2068D for ; Tue, 15 Sep 2020 12:41:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F/P3YYzR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A738E2068D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAGu-0000wn-O8 for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:41:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9qf-0000px-Lc; Tue, 15 Sep 2020 08:14:13 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:35255) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9qc-0008Bm-LJ; Tue, 15 Sep 2020 08:14:13 -0400 Received: by mail-pj1-x1044.google.com with SMTP id jw11so1628426pjb.0; Tue, 15 Sep 2020 05:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7zvfu2AU8jmrgTOs2oC3Qnm1T8TZc9G/7u0+CpqNJic=; b=F/P3YYzR0YuSzBEdsJviIwBK2niP82FmxoDAU4tfieBU18a8Dx4laMQo3wDQy1MpXk 83EqUv6Bt/NQFVJhVFBpeDhQ6SLYY8HWHf7lLvsyd/aIeNmzaGTupDedAP28Dv21DF9/ T3ogRMOMnbMOW2TSeUZqyLscsMAsUCgxs8qjIAZU86XeNkiQ85RH9EbDW5sSsV6flLT6 0qmPja7JUs7Rio3YPO4t4Sq3f3PHeY/76l3ki/EXLBaOwPNZZ9MkcyPVDKhDSydhHvxq glgdPFiciqfPurTyyY65xltp+gQaF4GUJ5+de0B9nxH1zB/oL3/no3VboKDcJ1zaUfLt yJsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7zvfu2AU8jmrgTOs2oC3Qnm1T8TZc9G/7u0+CpqNJic=; b=gYZWnT/Mya2gft3gThUrZEYEBhwLcI0JHNjd6YFaytYCgDkO+2++Y0AWvb0uyHVmZD /3rR6+udMlZPXx1TP8d6sXB9vLnCi7+zBRn3QAVSGDhBpVlOdVo+am1DphYGidU/s54y /YkKBwy9wHf+uWnQw+2dQ99Prn2j/5uemEKx+7ISclPdCEHmyB0dzXP3DvjZYccdiXR6 35+VQn2k+HM+gOf6OtGraxaebH8f6i/tPighc7n9R5GLlaq5ZHBZOAt1OMCvYxUHqlCA 184maczV1i32scu0iWUSzxdBvMkuYGn7CdPikTxiURzVXrcpyiA+VJ1rVOki7O/tIvHh W0fg== X-Gm-Message-State: AOAM530xYQI+zdi4wvFBbxrHs7fSWCMkZOwWC557aL5RD6xKo8VcoMlt t4MxG/YBBVJol0B5IVM8oYZg/jxJ7iffBNKKdd4= X-Google-Smtp-Source: ABdhPJxAJ3Q7byMBM1HV/edK0uLNbE0H4MLcNVMHoshKrEDVyrSu4I29uEnQ9PfyKsVM2BLofJjdvw== X-Received: by 2002:a17:902:7d95:b029:d1:c91f:5675 with SMTP id a21-20020a1709027d95b02900d1c91f5675mr9052078plm.34.1600172048586; Tue, 15 Sep 2020 05:14:08 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:07 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 07/26] tests: Fixes test-replication.c on msys2/mingw. Date: Tue, 15 Sep 2020 20:12:59 +0800 Message-Id: <20200915121318.247-8-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1044.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Windows there is no path like /tmp/s_local_disk.XXXXXX Use g_get_tmp_dir instead of /tmp. Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- tests/test-replication.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/test-replication.c b/tests/test-replication.c index 9ab3666a90..e7cbd6b144 100644 --- a/tests/test-replication.c +++ b/tests/test-replication.c @@ -23,14 +23,14 @@ /* primary */ #define P_ID "primary-id" -static char p_local_disk[] = "/tmp/p_local_disk.XXXXXX"; +static char *p_local_disk; /* secondary */ #define S_ID "secondary-id" #define S_LOCAL_DISK_ID "secondary-local-disk-id" -static char s_local_disk[] = "/tmp/s_local_disk.XXXXXX"; -static char s_active_disk[] = "/tmp/s_active_disk.XXXXXX"; -static char s_hidden_disk[] = "/tmp/s_hidden_disk.XXXXXX"; +static char *s_local_disk; +static char *s_active_disk; +static char *s_hidden_disk; /* FIXME: steal from blockdev.c */ QemuOptsList qemu_drive_opts = { @@ -571,6 +571,11 @@ static void setup_sigabrt_handler(void) int main(int argc, char **argv) { int ret; + const char *tmpdir = g_get_tmp_dir(); + p_local_disk = g_strdup_printf("%s/p_local_disk.XXXXXX", tmpdir); + s_local_disk = g_strdup_printf("%s/s_local_disk.XXXXXX", tmpdir); + s_active_disk = g_strdup_printf("%s/s_active_disk.XXXXXX", tmpdir); + s_hidden_disk = g_strdup_printf("%s/s_hidden_disk.XXXXXX", tmpdir); qemu_init_main_loop(&error_fatal); bdrv_init(); @@ -605,5 +610,10 @@ int main(int argc, char **argv) cleanup_imgs(); + g_free(p_local_disk); + g_free(s_local_disk); + g_free(s_active_disk); + g_free(s_hidden_disk); + return ret; } From patchwork Tue Sep 15 12:13:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305384 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9512C43461 for ; Tue, 15 Sep 2020 12:42:00 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 63E1F20B1F for ; Tue, 15 Sep 2020 12:42:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oi0id3Ef" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63E1F20B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAHX-0001wU-Hr for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:41:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9qj-0000sK-6Y; Tue, 15 Sep 2020 08:14:17 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:38283) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9qh-0008C7-8r; Tue, 15 Sep 2020 08:14:16 -0400 Received: by mail-pl1-x641.google.com with SMTP id c3so1240792plz.5; Tue, 15 Sep 2020 05:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=18mOftWXQC3Rn89AKTi/Z7fcDnMtQzhw+fXUDjoqjy0=; b=oi0id3Ef5S21OscB0m0KS6YTaIT6lEmxCHYaY+qlayRdwcWNuseh3dILjroHdi3laW nampCaDP2o4H2qk1z/gOe3ku/Whm9WfwaMuEAgl/VyQsksv8XhTH/aJssKdzouRp9R8S +LLCIY5zoinDhAkLEE0NRv7gLBHtTIsiocR5KxXWQWhR3gqfwH6ok5Qf924T1e/6oOCx 4L8tM40XFARGU4QW0VfDocPjYjzbIjdnczh/wrxaEz2RHeAzmMWcuVWq3+5Ec+ZwKfLP O75C4Yp+QZwLl37rZHa0DiOFsEqKG3i8EOMUAOyiH5YAibZivZP2F/GsEOkbXd3Ax5pW mTQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=18mOftWXQC3Rn89AKTi/Z7fcDnMtQzhw+fXUDjoqjy0=; b=Deo9SPmxt1wxhc04eDV68bVvME4RzFr4B45wnxykp9MitWm7Mvjn7JNQgHLm1F8q90 NpBrwFUQc+YG03CyPfN8xQcBeOCXmCIjqOo5c5vM3fEF9diill9T2dFha1iAiX/Tkeji I/fSVMRlL9AmpKMDApLHUAYwDc1R0e6iAvxsQU1smfz1AdZAAdgzu8l28n00wcqIRx4J LOAR09iDVxotXFSQAniDrPEypKC/nCSjJsD+HM61U0jmtXjukjQ8ArHD74Odzfbmz1Z/ 8jYYhpmNmjTTey1BZ2LURkOjP5gBrbR+BIAR3btd9hqhQymy3fla8yxmjYq4XmV0/U+5 r4pg== X-Gm-Message-State: AOAM5305o/VSzYbBxZR4yAMNdVsMexGsL1XC2SShMVwtCEsTAodopOJ+ 0ZOBpb9+yaGJD5JXOvPsfrjk+oAL7TT/9h0qL4I= X-Google-Smtp-Source: ABdhPJytWGexA3ggBgj3K8R8B0dxuj/JCnV8HpPcMGBhbaHZxJXi4g1i+wk0CFMNnQ+c0eavPytQiw== X-Received: by 2002:a17:90a:a111:: with SMTP id s17mr3883928pjp.28.1600172053114; Tue, 15 Sep 2020 05:14:13 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:12 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 08/26] tests: test-replication disable /replication/secondary/* on msys2/mingw. Date: Tue, 15 Sep 2020 20:13:00 +0800 Message-Id: <20200915121318.247-9-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::641; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x641.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" They caused failure on msys2/mingw, that's because file-win32.c not implement .bdrv_reopen_prepare/commit/abort yet. This is the error message: > $ ./tests/test-replication.exe > # random seed: R02S3f4d1c01af2b0a046990e0235c481faf > 1..13 > # Start of replication tests > # Start of primary tests > ok 1 /replication/primary/read > ok 2 /replication/primary/write > ok 3 /replication/primary/start > ok 4 /replication/primary/stop > ok 5 /replication/primary/do_checkpoint > ok 6 /replication/primary/get_error_all > # End of primary tests > # Start of secondary tests > ok 7 /replication/secondary/read > ok 8 /replication/secondary/write > Unexpected error in bdrv_reopen_prepare() at ../block.c:4191: > Block format 'file' used by node '#block4287' does not support reopening > files Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- tests/test-replication.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test-replication.c b/tests/test-replication.c index e7cbd6b144..b067240add 100644 --- a/tests/test-replication.c +++ b/tests/test-replication.c @@ -392,6 +392,7 @@ static void test_secondary_write(void) teardown_secondary(); } +#ifndef _WIN32 static void test_secondary_start(void) { BlockBackend *top_blk, *local_blk; @@ -546,6 +547,7 @@ static void test_secondary_get_error_all(void) teardown_secondary(); } +#endif static void sigabrt_handler(int signo) { @@ -597,6 +599,7 @@ int main(int argc, char **argv) /* Secondary */ g_test_add_func("/replication/secondary/read", test_secondary_read); g_test_add_func("/replication/secondary/write", test_secondary_write); +#ifndef _WIN32 g_test_add_func("/replication/secondary/start", test_secondary_start); g_test_add_func("/replication/secondary/stop", test_secondary_stop); g_test_add_func("/replication/secondary/continuous_replication", @@ -605,6 +608,7 @@ int main(int argc, char **argv) test_secondary_do_checkpoint); g_test_add_func("/replication/secondary/get_error_all", test_secondary_get_error_all); +#endif ret = g_test_run(); From patchwork Tue Sep 15 12:13:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273718 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1691C433E2 for ; Tue, 15 Sep 2020 12:36:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E31920731 for ; Tue, 15 Sep 2020 12:36:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nglpp7Vb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E31920731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIACS-0003Ta-Q7 for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:36:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9qq-0000xI-NK; Tue, 15 Sep 2020 08:14:26 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:37085) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9qn-0008Ce-3W; Tue, 15 Sep 2020 08:14:24 -0400 Received: by mail-pl1-x644.google.com with SMTP id u9so1237967plk.4; Tue, 15 Sep 2020 05:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=08QvrHPKEN4GbCfMFC4QXPv5o40Q0NOGDJhtin5ahIA=; b=nglpp7Vbz1cImKfKJYdVyhKLTHX7VsUhuaJ2L1iNOr2eM6wwcUffLpLeYvSTeE1qa4 m/bgsnCYj2c6ccaPnBiq6eZ2S1CrapAoGLuDz3q9Q1negU/X76+i1ZSqAWtbj9nN1tOk FkLE+ok8hErOm+8RFmMwNJga2I19+CRUakj6jlOzDircx9r8K/WBQ5Ikc8K35U9YcS+h HP7SnSczdtp5Lt9vahuNXGF9hvuNLHRd4RWzUO5PKoxdzGw96pGR1k9kam4mmsOhs15P gNeCBJteFSQj7EI8ZS/NtCDWItbRACx5lBsRzoekdnlmdHBKdjsf0erJzCUOj/04/CM8 MKZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=08QvrHPKEN4GbCfMFC4QXPv5o40Q0NOGDJhtin5ahIA=; b=r1zluS8qOCyaJ/bxkc3ZcKDVG3yxFetQBluXJgOvu8c+5JGI+y0UySbPootkT8oIZP JRZSoPKwJy7wxNYDcS5A/G5H8zqNcIj66PNcEu3NU6b8uV6LQaTAcU6t9CeFL6EkIlEe sz8C7hj4GYiMcMsquyTI8UVCrcHv4V86wF71VebmoGSIJThOa3XtnjZkdis9shJxs6KK p2mUPVvxdebp2QeY8gaL/GL7TY8/q6nw2VvRm10XrdZhLuibaP9C8uyau/oRv+RIh0No r0+xPqywH2B14oBMi14UdGvVJdedBudr5NT8Rv+X0Ur6sn9OojCuPyCvkiwvk+H4ZPEW oafQ== X-Gm-Message-State: AOAM532HuP8Fs8FwMlhSJN5YMczU9Zu7u+DDF8iFhtDhoDQFtC9iyhzp rxEsaUK9ijU9uGSHfVbMQ47Xrw3mzlzaecvIl4I= X-Google-Smtp-Source: ABdhPJyWbrNn7g0s7T6NMINRHiBCQttHFQUCu5CFhAusmZBgyRdfLE6SZ5O9IOBpLbUGuQKHuTdK7g== X-Received: by 2002:a17:902:522:b029:d1:9bc8:15df with SMTP id 31-20020a1709020522b02900d19bc815dfmr19540125plf.25.1600172057481; Tue, 15 Sep 2020 05:14:17 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:16 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 09/26] osdep: file locking functions are not available on Win32 Date: Tue, 15 Sep 2020 20:13:01 +0800 Message-Id: <20200915121318.247-10-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::644; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x644.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Do not declare the following locking functions on Win32: int qemu_lock_fd(int fd, int64_t start, int64_t len, bool exclusive); int qemu_unlock_fd(int fd, int64_t start, int64_t len); int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive); bool qemu_has_ofd_lock(void); Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- include/qemu/osdep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 412962d91a..e80fddd1e8 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -502,11 +502,11 @@ int qemu_close(int fd); int qemu_unlink(const char *name); #ifndef _WIN32 int qemu_dup(int fd); -#endif int qemu_lock_fd(int fd, int64_t start, int64_t len, bool exclusive); int qemu_unlock_fd(int fd, int64_t start, int64_t len); int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive); bool qemu_has_ofd_lock(void); +#endif #if defined(__HAIKU__) && defined(__i386__) #define FMT_pid "%ld" From patchwork Tue Sep 15 12:13:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4B24C433E2 for ; Tue, 15 Sep 2020 12:43:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55BE620936 for ; Tue, 15 Sep 2020 12:43:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ublds1wZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55BE620936 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAJQ-0004xf-BH for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:43:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9qv-0000zU-No; Tue, 15 Sep 2020 08:14:29 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:44209) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9qs-0008DD-Ev; Tue, 15 Sep 2020 08:14:29 -0400 Received: by mail-pf1-x429.google.com with SMTP id o20so1800659pfp.11; Tue, 15 Sep 2020 05:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/tGNcDT+soty377wKryHTaQKgDiEnZiZY12oC2sg7jk=; b=Ublds1wZL7FnLdSB0HV8YmB+djhFL+5FNY5UWiZGG7Id6B8IRr7VmO9te+cDnXR7ML MtVfEWrRoW2aAr9kQDVxbVNBvFq0WZ1O3Ex3SVbmvzzJf2GVy/BfjCx/rS3QwHAQOKVE sGH64MXVhnk+F1EkyfQLqVEoLqN40oj0yjdu+vUC+q91FQCcCCk3V+6b0yz2xGHVt+P+ S+ZLclwHVXejV2c+SlE/ZwYrGpGujbaIVly6/JSLPrfWkH82eD2ZVaEL0EdYNPNApsJz zNPDlcb4lzmZVZH0GqgiVNLN0kn+2G3BRgOInKjT2MWccKjYMs8/JpXMcrRZz7BnFDiq Zq2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/tGNcDT+soty377wKryHTaQKgDiEnZiZY12oC2sg7jk=; b=MVoMrFSuHRCvOTozAQXfQ/MTrne0YdICqRwDQ7GJS+gxtah2LkT51/s4STUgs4we6C 9j1eph5EvMDcyHsSsIKHF82n2bL3zy7AwhpuKGjXmIkfoV76qlX2O45sOT0yHFaraS0W ui381ccd0Ex4+W+fuf+I9/HFBr3PSTgRi/nCdLHFRzZGC4ubywk5/AzN70i/EMH7ysz5 sFMTlJaUGtY+iCEPPBJ4ZEkAQVfEcPf0n19x3C4cZTrquX+aL8c7kqeHY1djeDYOh4Fk 4f/LSf6wSAjeOdTHcsM23+/MWe9kxnzrew2QSGBZ2vBJa+Q68Fy09FTewxaqbcbCmkBF LsGA== X-Gm-Message-State: AOAM5315oXG2B2QkyhOrFJI3IMAFGas8MhpgNwHB9uYMTrSTGc7P1Js1 9TdPdfOQSO+dSeYhLd/i+m8b1iPanI93tkyUs+w= X-Google-Smtp-Source: ABdhPJyIR68ALKdgN/MzGwe3TRAKxwg2b36GkFje7CpkacDYwOJLOCBnh98ByxA5qe2t7+eP95bZ3w== X-Received: by 2002:a62:1557:0:b029:13e:d13d:a060 with SMTP id 84-20020a6215570000b029013ed13da060mr17699900pfv.38.1600172063327; Tue, 15 Sep 2020 05:14:23 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:22 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 10/26] meson: Use -b to ignore CR vs. CR-LF issues on Windows Date: Tue, 15 Sep 2020 20:13:02 +0800 Message-Id: <20200915121318.247-11-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x429.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Ideally we would use the '--strip-trailing-cr' option, but not being POSIX is a portability problem (i.e. BSDs and Solaris based OSes). Instead use the '-b' option which, although doing slightly more, produce the expected result on Windows." Signed-off-by: Yonggang Luo Reviewed-by: Eric Blake Reviewed-by: Daniel P. Berrangé --- tests/qapi-schema/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index c87d141417..f1449298b0 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -220,6 +220,6 @@ qapi_doc = custom_target('QAPI doc', # "full_path()" needed here to work around # https://github.com/mesonbuild/meson/issues/7585 -test('QAPI doc', diff, args: ['-u', files('doc-good.texi'), qapi_doc[0].full_path()], +test('QAPI doc', diff, args: ['-b', '-u', files('doc-good.texi'), qapi_doc[0].full_path()], depends: qapi_doc, suite: ['qapi-schema', 'qapi-doc']) From patchwork Tue Sep 15 12:13:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F163DC43461 for ; Tue, 15 Sep 2020 12:39:00 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 598A520731 for ; Tue, 15 Sep 2020 12:39:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VoBtXm1i" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 598A520731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAEd-0006ty-Gr for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:38:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9qx-00011n-Oq; Tue, 15 Sep 2020 08:14:31 -0400 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:37364) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9qv-0008Ep-N3; Tue, 15 Sep 2020 08:14:31 -0400 Received: by mail-pj1-x1042.google.com with SMTP id kk9so1624064pjb.2; Tue, 15 Sep 2020 05:14:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oGHfde2/p7Unz0ZWASemFfUTS9Iu9gtXZvUHoGMG0N8=; b=VoBtXm1iXA2cWPMVJjiuvbaRmJfadoHiieVIKykWquoVeayOo3GLcPawOKzS8A5ani Lf/5b4Rk1sVWPjbHLoAUXrXMmRIk2oCVSjpxXqCcFtxCkHjBPTqLRPDyvOpH0x+l3OOG XEtRECeKQiEH0yqshV9KIhWj0IrRkVjzQw1kLOIpJ+0B0dywuXjGznQnMQjeOANlmaCR WGAoOFbYfjF0/lnYGoYCcwJhmVcxJnjmBEWJjruypMQ2SpkEq1WP+xBsMKn58oWGbw3Y g2KHap6m2rHqcQ991nDNVZDGIXW//aEXDRY1k+8MZ8KjtQitUcg/rrOYYdQHM74dN37s zjyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oGHfde2/p7Unz0ZWASemFfUTS9Iu9gtXZvUHoGMG0N8=; b=m1wMJ5S//YU3yx/MotzN0btr8RGrXMw+7zYXGPK3B77KElSF4A8MZPHsh/TQn8c2k1 WDOQWmpIEvaH6ofacTq/Lyi/aqrrVcRJ7jV0kAYxjK/oakQOlM098iXHx4QwKLZfDQql qOULdjSpo02Ouz7YN/Eiin6s6yfe3UemVlL55bleklAaDpW37CmZho/JDcyvSFkBdIlZ AlEy6czMEG3MsyBb4tTW1e74lG7VrEW/e6im4mjeiZNdjnkpsxqiuB+wHnehugMJ3z+U AQO0H0KHXAXO/yPEOiFvkIi0FqOFJxqcArsXjWH4ijYyBQBTUk8YpCbwZbpuxff23KNx dV0g== X-Gm-Message-State: AOAM533JvLSVpwzhWhHNjiQZga1XS5XghpJrda6/5Yi1y9lLYPIAWYiy dGY5uYhaqe/W/zrNhcrh2evvixHzlykEVVEMbj0= X-Google-Smtp-Source: ABdhPJxf67dWEUzcJ29bQNXsHeYqVbM44nvPNU97E1rJTq6ySQStXsTGRcdjrXbbqjHKxK2vaHF6cA== X-Received: by 2002:a17:902:c1cb:b029:d0:cb2d:f271 with SMTP id c11-20020a170902c1cbb02900d0cb2df271mr19226911plc.10.1600172067565; Tue, 15 Sep 2020 05:14:27 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:26 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 11/26] gcrypt: test_tls_psk_init should write binary file instead text file. Date: Tue, 15 Sep 2020 20:13:03 +0800 Message-Id: <20200915121318.247-12-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1042; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1042.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On windows, if open file with "w", it's will automatically convert "\n" to "\r\n" when writing to file. Signed-off-by: Yonggang Luo --- tests/crypto-tls-psk-helpers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/crypto-tls-psk-helpers.c b/tests/crypto-tls-psk-helpers.c index a8395477c3..4f3bd446ad 100644 --- a/tests/crypto-tls-psk-helpers.c +++ b/tests/crypto-tls-psk-helpers.c @@ -26,13 +26,15 @@ #include "crypto-tls-psk-helpers.h" #include "qemu/sockets.h" +#include + #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT void test_tls_psk_init(const char *pskfile) { FILE *fp; - fp = fopen(pskfile, "w"); + fp = fopen(pskfile, "wb"); if (fp == NULL) { g_critical("Failed to create pskfile %s", pskfile); abort(); From patchwork Tue Sep 15 12:13:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41835C43461 for ; Tue, 15 Sep 2020 12:43:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B2D742068D for ; Tue, 15 Sep 2020 12:43:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EILE9744" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2D742068D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAIp-0003fC-Ru for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:43:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9r3-00016y-Ob; Tue, 15 Sep 2020 08:14:37 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:37086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9r0-0008FJ-Ao; Tue, 15 Sep 2020 08:14:37 -0400 Received: by mail-pl1-x642.google.com with SMTP id u9so1238253plk.4; Tue, 15 Sep 2020 05:14:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yy3OwZAAIk6Dcs0xK9Qh35lWKWe9KAtCgjjpQmut8QA=; b=EILE9744Wv81LpGwwRoYb3IlShUNhAdbizZTdO+ngkpWfT4gRTc2JdQ3Ics4zEWVwk gfZhop7zrHIeeGo/ZI444Xt4cVhOFDdClvPQwy6ablSFivx3oNWTz26PikkDgKMSlYQX rgnnMDNkAQyWp4nhNua3fUHNrAj8AGVq7ziIhVAISPjLlcH8mRqB7P2Igkhog6Rr9CPi loMMAxBbu5XlFTV9pCLO/1xadlmyxLeuoopcjWtT1Sf7edtquuwFkdbZHZbUYbZ/r3RX NYH7tYbWibnNfcYRK6D99mLP14xVqD1sYCilxuD71vYiajAjjvbwG68RvTptDiHcvOBy 8Wbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yy3OwZAAIk6Dcs0xK9Qh35lWKWe9KAtCgjjpQmut8QA=; b=MwXlQdQ/naRqEBmryOMsodsomHPE7GTKcb6dcsyHeXgaq2iGwGAwpaVdAgsdQm8H8o vEQdvy9WYm1CfiTb2q+SAqTz6VgShY3JYNGKFeAXfVkEfSL3fJMWBg2PkgbDS4jT7q8g G2rv3RDr31Y9sQuv9NGngPJ8XPv93RuD80MFbofr+/dfGwo+3l6MKHA8/Xe5DUeHbNvU t5q/gzF+7i09nCjJC+7EWzy2sb1uRMo78pHKsesS9ZYFyT1Y8DeyxZoiUVIbgkE1Dgsy VT2X5e0OH7AmlBSEWNVXJndYPJk6dMdyKzlHcw2kNTCJPZ5HkS22zbdyTLRycKU97TXN GeJg== X-Gm-Message-State: AOAM533MhHF1AoVJLCgW51SXWbJHhLYRRHG6094dDuWEm8x9n6FSZO2B kcxim70p4sWJ6PKAwoNaOVulPVTjTUlAq1G+S0A= X-Google-Smtp-Source: ABdhPJzq9WcHKvGFpPCw51g1Mr+SwRAXhdn7dkgU3Kw6D47cV0/7HAePn/VHC8ZML65ghEu5JPlutg== X-Received: by 2002:a17:90a:d3c2:: with SMTP id d2mr3866734pjw.112.1600172072003; Tue, 15 Sep 2020 05:14:32 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:31 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 12/26] tests: Enable crypto tests under msys2/mingw Date: Tue, 15 Sep 2020 20:13:04 +0800 Message-Id: <20200915121318.247-13-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Fixes following tests on msys2/mingw 'test-crypto-tlscredsx509' test-crypto-tlssession' 'test-io-channel-tls' These tests are failure with: ERROR test-crypto-tlscredsx509 - missing test plan ERROR test-crypto-tlssession - missing test plan ERROR test-io-channel-tls - missing test plan Because on win32 those test case are all disabled in the header Add qemu_socket_pair for cross platform support Convert file system handling functions to glib Add qemu_link function instead posix only link function. Use send ad recv from qemu that convert Windows Socks error to errno properly. Use g_remove instead unlink Use g_mkdir instead mkdir Signed-off-by: Yonggang Luo --- tests/crypto-tls-psk-helpers.c | 2 +- tests/crypto-tls-x509-helpers.c | 106 ++++++++++++++++++++++++++++++- tests/crypto-tls-x509-helpers.h | 9 ++- tests/test-crypto-tlscredsx509.c | 47 +++++++------- tests/test-crypto-tlssession.c | 68 +++++++++++--------- tests/test-io-channel-tls.c | 51 ++++++++------- 6 files changed, 204 insertions(+), 79 deletions(-) diff --git a/tests/crypto-tls-psk-helpers.c b/tests/crypto-tls-psk-helpers.c index 4f3bd446ad..58888d5537 100644 --- a/tests/crypto-tls-psk-helpers.c +++ b/tests/crypto-tls-psk-helpers.c @@ -46,7 +46,7 @@ void test_tls_psk_init(const char *pskfile) void test_tls_psk_cleanup(const char *pskfile) { - unlink(pskfile); + g_remove(pskfile); } #endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */ diff --git a/tests/crypto-tls-x509-helpers.c b/tests/crypto-tls-x509-helpers.c index 01b3daf358..1238983755 100644 --- a/tests/crypto-tls-x509-helpers.c +++ b/tests/crypto-tls-x509-helpers.c @@ -23,6 +23,8 @@ #include "crypto-tls-x509-helpers.h" #include "crypto/init.h" #include "qemu/sockets.h" +#include +#include #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT @@ -133,7 +135,7 @@ void test_tls_init(const char *keyfile) void test_tls_cleanup(const char *keyfile) { asn1_delete_structure(&pkix_asn1); - unlink(keyfile); + g_remove(keyfile); } /* @@ -501,8 +503,108 @@ void test_tls_discard_cert(QCryptoTLSTestCertReq *req) req->crt = NULL; if (getenv("QEMU_TEST_DEBUG_CERTS") == NULL) { - unlink(req->filename); + g_remove(req->filename); } } +int qemu_link(const char *exist_path1, const char *new_path2) +{ +#if defined(_WIN32) + g_autofree gchar *current_dir = g_get_current_dir(); + g_autofree gchar *full_path = g_build_filename(current_dir, exist_path1, NULL); + return CreateSymbolicLinkA( + new_path2, full_path, 0 | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE) ? 0 : -1; +#else + return link(exist_path1, new_path2); +#endif +} + +#if defined(_WIN32) + +int qemu_socketpair(int family, int type, int protocol, int channel[2]) +{ + struct addrinfo addr_data; + struct addrinfo *addr = NULL; + int sock_listener = -1; + int sock_client = -1; + int sock_server = -1; + int one = 1; + + memset(&addr_data, 0, sizeof(addr_data)); + addr_data.ai_family = AF_INET; + addr_data.ai_socktype = type; + addr_data.ai_protocol = protocol; + if (0 != getaddrinfo("127.0.0.1", "0", &addr_data, &addr)) { + goto error; + } + + if (NULL == addr) { + goto error; + } + + sock_listener = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); + if (-1 == sock_listener) { + goto error; + } + + if (-1 == setsockopt(sock_listener, SOL_SOCKET, SO_REUSEADDR, (const char *)&one, sizeof(one))) { + goto error; + } + if (-1 == bind(sock_listener, addr->ai_addr, addr->ai_addrlen)) { + goto error; + } + if (-1 == getsockname(sock_listener, addr->ai_addr, (int *)&(addr->ai_addrlen))) { + goto error; + } + if (-1 == listen(sock_listener, 1)) { + goto error; + } + + sock_client = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); + + if (-1 == sock_client) { + goto error; + } + + if (-1 == connect(sock_client, addr->ai_addr, addr->ai_addrlen)) { + goto error; + } + + sock_server = accept(sock_listener, 0, 0); + + if (-1 == sock_server) { + goto error; + } + + closesocket(sock_listener); + + channel[0] = sock_client; + channel[1] = sock_server; + return 0; + +error: + if (-1 != sock_server) { + closesocket(sock_server); + } + if (-1 != sock_client) { + closesocket(sock_client); + } + if (-1 != sock_listener) { + closesocket(sock_listener); + } + if (NULL != addr) { + freeaddrinfo(addr); + } + return -1; +} + +#else + +int qemu_socketpair(int family, int type, int protocol, int recv[2]) +{ + return socketpair(family, type, protocol, recv); +} + +#endif + #endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */ diff --git a/tests/crypto-tls-x509-helpers.h b/tests/crypto-tls-x509-helpers.h index 08efba4e19..6902d43af7 100644 --- a/tests/crypto-tls-x509-helpers.h +++ b/tests/crypto-tls-x509-helpers.h @@ -24,8 +24,9 @@ #include #include -#if !(defined WIN32) && \ - defined(CONFIG_TASN1) +#include "qemu/osdep.h" + +#if defined(CONFIG_TASN1) # define QCRYPTO_HAVE_TLS_TEST_SUPPORT #endif @@ -127,6 +128,10 @@ void test_tls_cleanup(const char *keyfile); extern const ASN1_ARRAY_TYPE pkix_asn1_tab[]; +int qemu_link(const char *exist_path1, const char *new_path2); + +int qemu_socketpair(int family, int type, int protocol, int channel[2]); + #endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */ #endif diff --git a/tests/test-crypto-tlscredsx509.c b/tests/test-crypto-tlscredsx509.c index f487349c32..620fbde1ca 100644 --- a/tests/test-crypto-tlscredsx509.c +++ b/tests/test-crypto-tlscredsx509.c @@ -25,6 +25,9 @@ #include "qapi/error.h" #include "qemu/module.h" +#include +#include + #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT #define WORKDIR "tests/test-crypto-tlscredsx509-work/" @@ -77,34 +80,34 @@ static void test_tls_creds(const void *opaque) QCryptoTLSCreds *creds; #define CERT_DIR "tests/test-crypto-tlscredsx509-certs/" - mkdir(CERT_DIR, 0700); + g_mkdir_with_parents(CERT_DIR, 0700); - unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); + g_remove (CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); if (data->isServer) { - unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); - unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); + g_remove (CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); + g_remove (CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); } else { - unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); - unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); + g_remove (CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); + g_remove (CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); } - if (access(data->cacrt, R_OK) == 0) { - g_assert(link(data->cacrt, + if (g_access(data->cacrt, R_OK) == 0) { + g_assert(qemu_link(data->cacrt, CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0); } if (data->isServer) { - if (access(data->crt, R_OK) == 0) { - g_assert(link(data->crt, + if (g_access(data->crt, R_OK) == 0) { + g_assert(qemu_link(data->crt, CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT) == 0); } - g_assert(link(KEYFILE, + g_assert(qemu_link(KEYFILE, CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY) == 0); } else { - if (access(data->crt, R_OK) == 0) { - g_assert(link(data->crt, + if (g_access(data->crt, R_OK) == 0) { + g_assert(qemu_link(data->crt, CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT) == 0); } - g_assert(link(KEYFILE, + g_assert(qemu_link(KEYFILE, CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY) == 0); } @@ -121,15 +124,15 @@ static void test_tls_creds(const void *opaque) g_assert(creds != NULL); } - unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); + g_remove(CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); if (data->isServer) { - unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); - unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); + g_remove(CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); + g_remove(CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); } else { - unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); - unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); + g_remove(CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); + g_remove(CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); } - rmdir(CERT_DIR); + g_rmdir(CERT_DIR); if (creds) { object_unparent(OBJECT(creds)); } @@ -143,7 +146,7 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); - mkdir(WORKDIR, 0700); + g_mkdir_with_parents(WORKDIR, 0700); test_tls_init(KEYFILE); @@ -699,7 +702,7 @@ int main(int argc, char **argv) test_tls_discard_cert(&cacertlevel2areq); test_tls_discard_cert(&servercertlevel3areq); test_tls_discard_cert(&clientcertlevel2breq); - unlink(WORKDIR "cacertchain-ctx.pem"); + g_remove(WORKDIR "cacertchain-ctx.pem"); test_tls_cleanup(KEYFILE); rmdir(WORKDIR); diff --git a/tests/test-crypto-tlssession.c b/tests/test-crypto-tlssession.c index 8b2453fa79..f726219593 100644 --- a/tests/test-crypto-tlssession.c +++ b/tests/test-crypto-tlssession.c @@ -28,9 +28,13 @@ #include "qom/object_interfaces.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qemu/main-loop.h" #include "qemu/sockets.h" #include "authz/list.h" +#include +#include + #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT #define WORKDIR "tests/test-crypto-tlssession-work/" @@ -40,15 +44,16 @@ static ssize_t testWrite(const char *buf, size_t len, void *opaque) { int *fd = opaque; - - return write(*fd, buf, len); + int written = send(*fd, buf, len, 0); + return written; } static ssize_t testRead(char *buf, size_t len, void *opaque) { int *fd = opaque; - return read(*fd, buf, len); + int readed = recv(*fd, buf, len, 0); + return readed; } static QCryptoTLSCreds *test_tls_creds_psk_create( @@ -84,7 +89,7 @@ static void test_crypto_tls_session_psk(void) int ret; /* We'll use this for our fake client-server connection */ - ret = socketpair(AF_UNIX, SOCK_STREAM, 0, channel); + ret = qemu_socketpair(AF_UNIX, SOCK_STREAM, 0, channel); g_assert(ret == 0); /* @@ -238,7 +243,7 @@ static void test_crypto_tls_session_x509(const void *opaque) int ret; /* We'll use this for our fake client-server connection */ - ret = socketpair(AF_UNIX, SOCK_STREAM, 0, channel); + ret = qemu_socketpair(AF_UNIX, SOCK_STREAM, 0, channel); g_assert(ret == 0); /* @@ -251,29 +256,29 @@ static void test_crypto_tls_session_x509(const void *opaque) #define CLIENT_CERT_DIR "tests/test-crypto-tlssession-client/" #define SERVER_CERT_DIR "tests/test-crypto-tlssession-server/" - mkdir(CLIENT_CERT_DIR, 0700); - mkdir(SERVER_CERT_DIR, 0700); + g_mkdir_with_parents(CLIENT_CERT_DIR, 0700); + g_mkdir_with_parents(SERVER_CERT_DIR, 0700); - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); - g_assert(link(data->servercacrt, + g_assert(qemu_link(data->servercacrt, SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0); - g_assert(link(data->servercrt, + g_assert(qemu_link(data->servercrt, SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT) == 0); - g_assert(link(KEYFILE, + g_assert(qemu_link(KEYFILE, SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY) == 0); - g_assert(link(data->clientcacrt, + g_assert(qemu_link(data->clientcacrt, CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0); - g_assert(link(data->clientcrt, + g_assert(qemu_link(data->clientcrt, CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT) == 0); - g_assert(link(KEYFILE, + g_assert(qemu_link(KEYFILE, CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY) == 0); clientCreds = test_tls_creds_x509_create( @@ -369,16 +374,16 @@ static void test_crypto_tls_session_x509(const void *opaque) g_assert(!data->expectClientFail); } - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); - rmdir(CLIENT_CERT_DIR); - rmdir(SERVER_CERT_DIR); + g_rmdir(CLIENT_CERT_DIR); + g_rmdir(SERVER_CERT_DIR); object_unparent(OBJECT(serverCreds)); object_unparent(OBJECT(clientCreds)); @@ -397,10 +402,13 @@ int main(int argc, char **argv) int ret; module_call_init(MODULE_INIT_QOM); + qemu_init_main_loop(&error_abort); + socket_init(); + g_test_init(&argc, &argv, NULL); g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); - mkdir(WORKDIR, 0700); + g_mkdir_with_parents(WORKDIR, 0700); test_tls_init(KEYFILE); test_tls_psk_init(PSKFILE); @@ -640,11 +648,11 @@ int main(int argc, char **argv) test_tls_discard_cert(&cacertlevel2areq); test_tls_discard_cert(&servercertlevel3areq); test_tls_discard_cert(&clientcertlevel2breq); - unlink(WORKDIR "cacertchain-sess.pem"); + g_remove(WORKDIR "cacertchain-sess.pem"); test_tls_psk_cleanup(PSKFILE); test_tls_cleanup(KEYFILE); - rmdir(WORKDIR); + g_rmdir(WORKDIR); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/test-io-channel-tls.c b/tests/test-io-channel-tls.c index ad7554c534..e858716192 100644 --- a/tests/test-io-channel-tls.c +++ b/tests/test-io-channel-tls.c @@ -31,9 +31,13 @@ #include "crypto/tlscredsx509.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qemu/main-loop.h" #include "authz/list.h" #include "qom/object_interfaces.h" +#include +#include + #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT #define WORKDIR "tests/test-io-channel-tls-work/" @@ -123,33 +127,33 @@ static void test_io_channel_tls(const void *opaque) GMainContext *mainloop; /* We'll use this for our fake client-server connection */ - g_assert(socketpair(AF_UNIX, SOCK_STREAM, 0, channel) == 0); + g_assert(qemu_socketpair(AF_UNIX, SOCK_STREAM, 0, channel) == 0); #define CLIENT_CERT_DIR "tests/test-io-channel-tls-client/" #define SERVER_CERT_DIR "tests/test-io-channel-tls-server/" - mkdir(CLIENT_CERT_DIR, 0700); - mkdir(SERVER_CERT_DIR, 0700); + g_mkdir(CLIENT_CERT_DIR, 0700); + g_mkdir(SERVER_CERT_DIR, 0700); - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); - g_assert(link(data->servercacrt, + g_assert(qemu_link(data->servercacrt, SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0); - g_assert(link(data->servercrt, + g_assert(qemu_link(data->servercrt, SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT) == 0); - g_assert(link(KEYFILE, + g_assert(qemu_link(KEYFILE, SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY) == 0); - g_assert(link(data->clientcacrt, + g_assert(qemu_link(data->clientcacrt, CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0); - g_assert(link(data->clientcrt, + g_assert(qemu_link(data->clientcrt, CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT) == 0); - g_assert(link(KEYFILE, + g_assert(qemu_link(KEYFILE, CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY) == 0); clientCreds = test_tls_creds_create( @@ -238,13 +242,13 @@ static void test_io_channel_tls(const void *opaque) QIO_CHANNEL(serverChanTLS)); qio_channel_test_validate(test); - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); - unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); + g_remove(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); - unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); + g_remove(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); rmdir(CLIENT_CERT_DIR); rmdir(SERVER_CERT_DIR); @@ -272,10 +276,13 @@ int main(int argc, char **argv) g_assert(qcrypto_init(NULL) == 0); module_call_init(MODULE_INIT_QOM); + qemu_init_main_loop(&error_abort); + socket_init(); + g_test_init(&argc, &argv, NULL); g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); - mkdir(WORKDIR, 0700); + g_mkdir(WORKDIR, 0700); test_tls_init(KEYFILE); From patchwork Tue Sep 15 12:13:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305382 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7D1BC433E2 for ; Tue, 15 Sep 2020 12:44:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 528E020936 for ; Tue, 15 Sep 2020 12:44:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b0q9q0Dy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 528E020936 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAKB-0006Fc-VC for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:44:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9r6-0001Db-Ez; Tue, 15 Sep 2020 08:14:40 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:33319) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9r4-0008Fb-Le; Tue, 15 Sep 2020 08:14:40 -0400 Received: by mail-pg1-x52d.google.com with SMTP id s65so1917946pgb.0; Tue, 15 Sep 2020 05:14:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rY6yNgCy25oDmt+nU7EZEt8FaOeANESnxbsMxWp5WF0=; b=b0q9q0DyvBaiAJzZat5zEJ6o9CIjzb0/Z/ACPCtPIZcjX4uStpz1XxM4HWMjfD4YP4 HI84HfJBYtbALEMOFGyh4Zo10XMtu8ZIgDwvlGHc2QprcD6HB32skdGo+87EbZmHj4kj 35qJZcxcfC740XuG72xS2L43MU1lOrX7TNdv6XnyCy3mVyNRlgw7HaVDOQnjMpmgXw31 JIWbeX/OvJEA08RpUNWNAmsVhq8O8lITMAq+2Jm/JprAD+XcsQJSLaD0vVK0j/8/7IYy rCSsSJi3BY30jp+KDY51DzgUsCwsa4XWQCCjKBMj98QjTitFIVdVqJT6uaFUm2GdZH4c zPSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rY6yNgCy25oDmt+nU7EZEt8FaOeANESnxbsMxWp5WF0=; b=SUr9sk71OkVVL5gY4RxBfDmWshWcPUyuvXcslWpmBqhyBhAhBaQoLObZ4Y4kzNEq6m P5WGb8YiIJr/BySfWFJsI1DbLx98O1OyTJX5XWqRr/jG2ABIZ2/rcIkAmd3JLDKb9l87 STlE9lRjtmhhQ/V4bzd3TdawxK8i+KTNCHeezQBjAiVhGF9JZ8vDTS1CgKPa00M52bG2 dNwQhyse2RPAxDMWgKXcu47hHtrPlMD9vSzQZ41Jh5O+gtRLkK/kCdWfcRjwRE72Kj70 QsY47iyTGKDcDddqZQ7Ve4Na7IYep5koyM7m6L5djXd9Xt8rEYbgBZsXPehN5YRheAcD wDCg== X-Gm-Message-State: AOAM530cIXyrZWhCNkJ3ZbPT7Q5I3hOw6muQAnVEWfAqdl6B1aZ9SPnF 1XA0n2rnrAxg/B7fqyX2xQw1qpEvpAG5IcHPdTI= X-Google-Smtp-Source: ABdhPJwWOaPx4+19DtbCxJUMqbg0owjQT5P5Z0NAUYxLnRi478kj5Aobj4fJXAqlvC2vaPgivJ50GA== X-Received: by 2002:a62:1c0f:0:b029:13e:d13d:a05e with SMTP id c15-20020a621c0f0000b029013ed13da05emr17423937pfc.36.1600172076333; Tue, 15 Sep 2020 05:14:36 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:35 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 13/26] meson: remove empty else and duplicated gio deps Date: Tue, 15 Sep 2020 20:13:05 +0800 Message-Id: <20200915121318.247-14-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x52d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- meson.build | 6 ------ 1 file changed, 6 deletions(-) diff --git a/meson.build b/meson.build index 690723b470..23cb1b8742 100644 --- a/meson.build +++ b/meson.build @@ -317,7 +317,6 @@ opengl = not_found if 'CONFIG_OPENGL' in config_host opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(), link_args: config_host['OPENGL_LIBS'].split()) -else endif gtk = not_found if 'CONFIG_GTK' in config_host @@ -344,11 +343,6 @@ if 'CONFIG_ICONV' in config_host iconv = declare_dependency(compile_args: config_host['ICONV_CFLAGS'].split(), link_args: config_host['ICONV_LIBS'].split()) endif -gio = not_found -if 'CONFIG_GIO' in config_host - gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(), - link_args: config_host['GIO_LIBS'].split()) -endif vnc = not_found png = not_found jpeg = not_found From patchwork Tue Sep 15 12:13:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49FD6C2D0E0 for ; Tue, 15 Sep 2020 12:46:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B25BC20756 for ; Tue, 15 Sep 2020 12:46:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sih/DL6p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B25BC20756 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIALy-0007nX-O6 for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:46:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9rB-0001PE-0c; Tue, 15 Sep 2020 08:14:49 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:45785) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9r9-0008GF-8i; Tue, 15 Sep 2020 08:14:44 -0400 Received: by mail-pf1-x442.google.com with SMTP id k15so1797059pfc.12; Tue, 15 Sep 2020 05:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cB+r+dkpxaxYLpmfHgr9Ib2dc/r134/ZQOU509IQ9fY=; b=sih/DL6pPq1DTQOvqIRMfLfFN1vftgjqX/sVsKe6z15+Ebk1S5Hknon8SQfjrBRzt/ 4VG0x5XO5Y7if9wFH8AA4K2N8FgSSRTBz78wu2COpjuZ03SYwHN5JJyaJ/mdWwd7jkID 66iM8YKPXikBkbL2smi0QpRY0EsLXj20WLh2vKNXkla4ku0NMLn0mRQchbS5sO8UTl0k SxoFQeVCHBKVkMM7oALRrU+EmpCHcMcsJoruU/27gXxRIBaqKbFGx6oZrTAS3Vdp/2CX 3jtacGPJtFZWaRsihPciWZGThoTETRMp2tC972hjPvMGqGBC9FGcdr5+tz7r6Xs48/e3 DGnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cB+r+dkpxaxYLpmfHgr9Ib2dc/r134/ZQOU509IQ9fY=; b=b7stpMZjcDXR79h/fQ3KOSroCCVP48awXaTOUAkTXCf+9eITUfVrq1eDUe+Olo0bGO 9WojG6mS4Rn7b1gtAwOAq5DIvYwKbLe0Ny7HZEwPpMdjnvF3pHaS8lbC9MY3LtpWYNgl QiKMbzuS65+pzoMiW9ZwqwmyEc7vY2+yiGERI1Sg2RQLK4DPzvlCgriMyG3//kj2kiZK zvB6+vjNwz3ThjPcrXRicYk75tLtivNKDkIyuHRfpu5ELS+juJmW8lj89P6rJx/oCiu+ DIapt8/n8pQKMukcfriI6Nlucub8reAJ2cUBnwXpK58NlX/vOfmDGG54kuM85Zemy1Af cEKg== X-Gm-Message-State: AOAM530LWDr+sfHXj3v16KtdrZPQP+/BD4fmJzAuvn4Zan1eHjpNERJ1 VyzLY6bo7unSz+ZZ6HMi5UWfeQBeOg4KYYTe+BY= X-Google-Smtp-Source: ABdhPJzjDHQU9QmUNa6pDcxha5MBLoGGfmaAOwJNnrI2HILNyn33TMyCBUR/fDVkOupZIAy4MfLmCw== X-Received: by 2002:a65:410c:: with SMTP id w12mr3892003pgp.411.1600172081027; Tue, 15 Sep 2020 05:14:41 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:40 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 14/26] vmstate: Fixes test-vmstate.c on msys2/mingw Date: Tue, 15 Sep 2020 20:13:06 +0800 Message-Id: <20200915121318.247-15-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::442; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Wen Congyang , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The vmstate are valid on win32, just need generate tmp path properly Signed-off-by: Yonggang Luo Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Daniel P. Berrangé --- tests/test-vmstate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index 1c763015d0..ac38bfcfe8 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -34,7 +34,6 @@ #include "qemu/module.h" #include "io/channel-file.h" -static char temp_file[] = "/tmp/vmst.test.XXXXXX"; static int temp_fd; @@ -1484,6 +1483,8 @@ static void test_tmp_struct(void) int main(int argc, char **argv) { + g_autofree char *temp_file = g_strdup_printf( + "%s/vmst.test.XXXXXX", g_get_tmp_dir()); temp_fd = mkstemp(temp_file); module_call_init(MODULE_INIT_QOM); From patchwork Tue Sep 15 12:13:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273712 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E595C2D0E0 for ; Tue, 15 Sep 2020 12:48:09 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD963206A5 for ; Tue, 15 Sep 2020 12:48:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LWGL2jH0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD963206A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:56318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIANT-0000b2-Pf for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:48:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9rF-0001Pg-RP; Tue, 15 Sep 2020 08:14:52 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:36804) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9rD-0008H2-K0; Tue, 15 Sep 2020 08:14:49 -0400 Received: by mail-pf1-x443.google.com with SMTP id d9so1835143pfd.3; Tue, 15 Sep 2020 05:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xS967nwniiPoKExhe31AY1Igl1jhGzMmH4nTv98GjJU=; b=LWGL2jH0BhQweSb6xxy55FJjQVE3jDYJNfQFFor3yCUYooR7DdVxjqQH43pUSSohZk TKRiE3Y50Mblh5SRGjKGE4pWYmwJ7K+Do7XZhsqR+TURXAljFDNVOuxXdRUK5m1Kx/ux 9lVP5DBAcylwmDyw9hMqHszk3aCXdKAVKEpERVA9yZen9YgFSJGztk4mMnaslEt9UiZM ppkA/4E52s0kjWU8axONwhzqzPY44CAMGGa7MB2Ei6Fndv3ec6W9weTAiGo0el3qam8A UdtjLT8z2lZhbTgnL1SckJpR3/aJ7C/4yLi32c8HeaYu281b0qofbvcperNbR0F16IUu Iq/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xS967nwniiPoKExhe31AY1Igl1jhGzMmH4nTv98GjJU=; b=TEikNU7MZbUgtr1t2enW2vMRtB2sBvOl/thmYzi3g0g9icbI0wh43OwvcnqARptLIJ ytMyPGLFWrBM9IQlZ7pDzippyVJJzL3mMTnTRwkUcPhSWePj6dpZzxXAXHM9GjjQ8IE2 BQ0aCFHymSjAr7R4kXqWRfjfOSPz5zVIbc6ne2lqZ+xrjwAWuAYsdxBZuMwYAfNcEUj/ Wqz2V5UsxGljvQz4BMiA+tSzSmuI0jdMC3Fhsu+xuXZ39ywQdPyIrV+2zVR0JqSelAJg kk0UXJUhIAA73MPlyuB2uIBLKSmkaGQO9OdkUg7F8R8GXy+mzRpG/YTFv2hYTPnGCh2E 3eOw== X-Gm-Message-State: AOAM533qYukHcZ/97/Oyz5ziUtAFL0L5h4+JdDRJB5zq4ZtOa76cgb33 ZZQW71tXboBhQDkwHQLdLiXvyPBYdEcUTqNOtpI= X-Google-Smtp-Source: ABdhPJwJGmwIT40KYnBDQSmL9gdh68crtqnv2UfXC/ET6mmmH80HrfikHaIWOQrOrMG4h8jXSOknDQ== X-Received: by 2002:a05:6a00:22d2:b029:142:2501:3966 with SMTP id f18-20020a056a0022d2b029014225013966mr1635057pfj.43.1600172085532; Tue, 15 Sep 2020 05:14:45 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:44 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 15/26] cirrus: Building freebsd in a single short Date: Tue, 15 Sep 2020 20:13:07 +0800 Message-Id: <20200915121318.247-16-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::443; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This reverts commit 45f7b7b9f38f5c4d1529a37c93dedfc26a231bba ("cirrus.yml: Split FreeBSD job into two parts"). freebsd 1 hour limit not hit anymore I think we going to a wrong direction, I think there is some tests a stall the test runner, please look at https://cirrus-ci.com/task/5110577531977728 When its running properly, the consumed time are little, but when tests running too long, look at the cpu usage, the cpu usage are nearly zero. doesn't consuming time. And look at https://cirrus-ci.com/task/6119341601062912 If the tests running properly, the time consuming are little We should not hide the error by split them Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé Reviewed-by: Ed Maste --- .cirrus.yml | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 3dd9fcff7f..690c6882e8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,38 +1,19 @@ env: CIRRUS_CLONE_DEPTH: 1 -freebsd_1st_task: +freebsd_12_task: freebsd_instance: image_family: freebsd-12-1 - cpu: 4 - memory: 4G - install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install -y - bash curl cyrus-sasl git glib gmake gnutls gsed - nettle perl5 pixman pkgconf png usbredir + cpu: 8 + memory: 8G + install_script: + - ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; + - pkg install -y bash curl cyrus-sasl git glib gmake gnutls gsed + nettle perl5 pixman pkgconf png usbredir script: - mkdir build - cd build - - ../configure --disable-user --target-list-exclude='alpha-softmmu - ppc64-softmmu ppc-softmmu riscv32-softmmu riscv64-softmmu s390x-softmmu - sparc64-softmmu sparc-softmmu x86_64-softmmu i386-softmmu' - --enable-werror || { cat config.log; exit 1; } - - gmake -j$(sysctl -n hw.ncpu) - - gmake -j$(sysctl -n hw.ncpu) check - -freebsd_2nd_task: - freebsd_instance: - image_family: freebsd-12-1 - cpu: 4 - memory: 4G - install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install -y - bash curl cyrus-sasl git glib gmake gnutls gtk3 gsed libepoxy mesa-libs - nettle perl5 pixman pkgconf png SDL2 usbredir - script: - - ./configure --enable-werror --target-list='alpha-softmmu ppc64-softmmu - ppc-softmmu riscv32-softmmu riscv64-softmmu s390x-softmmu - sparc64-softmmu sparc-softmmu x86_64-softmmu i386-softmmu - sparc-bsd-user sparc64-bsd-user x86_64-bsd-user i386-bsd-user' - || { cat config.log; exit 1; } + - ../configure --enable-werror || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake -j$(sysctl -n hw.ncpu) check From patchwork Tue Sep 15 12:13:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5951C43461 for ; Tue, 15 Sep 2020 12:29:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 897D0206DC for ; Tue, 15 Sep 2020 12:29:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="biHIMGS6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 897D0206DC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIA5s-0002Uv-Ku for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:29:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9rL-0001RN-6C; Tue, 15 Sep 2020 08:14:56 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:39598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9rJ-0008IB-3Y; Tue, 15 Sep 2020 08:14:54 -0400 Received: by mail-pg1-x544.google.com with SMTP id d13so1886689pgl.6; Tue, 15 Sep 2020 05:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8LMHSaPzW0hzgrIuj2ua/jt2cvPDmkrSyzCQ3oAKLyw=; b=biHIMGS6AUChj1Czn1FRvISeqJYf+hTbjKLcP7bQwdTE91OE39FghWrXxri1McM1iT G6gNK/mrR8H152hRT20/i9PZMxiOAHtjf2bDVLyL0Al820R6qcdywELu0WUkw8PByOBU JGNtNhiK5PikY1eTYr4YiM9KABuBWSHa3ycHTGcPvN2hD4HBrSFwJZ7iU72eM0X3C5QV 264FDVLua3f1pVIEOVYtdGBnSIAP32uCmymwOqrEdSJbuu/+IW53lbSplMsZM7EwrQW+ F1nCYpyaAiA8eSr/TtA/4Mw+deJF+bIPsY0FQPTcbPpFwQCvfdFwkQJDd3OVbf0Zr1qG Gx9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8LMHSaPzW0hzgrIuj2ua/jt2cvPDmkrSyzCQ3oAKLyw=; b=RBUmvaaY6d/NIHunNAEZZ2wihXWnz4JV1Yk5MRLCb+JDAELGvjg12LvyawV2bBF5WD ebfYC5S75SDbGvU2m005qntNyUPqPmD6VgrfUBNHgE/QcMUiQ5knbt5tVS5Pvl1gmyZq esWWiIOIIh34Av4fjcsSIIAUbobuo2Nx2G9WGOQQTQKKkGmBZIsIZlC81ShJ1OPqEOLb NLF6S/ZhVabj0T5XJ7vtBS+kzfJSp4AnUJlB6GRZsYYtJipFaLIEOavqYCRCEP++s0Ag 54PT+t6HssO/60VRHSZqnqUNsLKWb/Ow9XEzp4SihOaX3QFa3BCw+zu7R48nlINCbmA8 BjNg== X-Gm-Message-State: AOAM533PgQQwRzClNyLZuoM0+XCXGf+LDHPEjh1o5ZIg+I8eJeC2laq9 UgZY+xoail1ConKyVTZHeNQiYnsU3ZXldlG9LYU= X-Google-Smtp-Source: ABdhPJxaC4MoxRFEbFJq/mTw7qXEKnuuqctg0eNoPhLbUsH5kmWRsCcdgZ8W3KeJimUnBkFe0tjL0w== X-Received: by 2002:aa7:99c7:0:b029:13e:d13d:a056 with SMTP id v7-20020aa799c70000b029013ed13da056mr17610322pfi.28.1600172090242; Tue, 15 Sep 2020 05:14:50 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:49 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 16/26] tests: Convert g_free to g_autofree macro in test-logging.c Date: Tue, 15 Sep 2020 20:13:08 +0800 Message-Id: <20200915121318.247-17-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::544; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x544.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" g_autofree are prefer than g_free when possible. Signed-off-by: Yonggang Luo Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé --- tests/test-logging.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test-logging.c b/tests/test-logging.c index 8a1161de1d..783fe09a27 100644 --- a/tests/test-logging.c +++ b/tests/test-logging.c @@ -196,7 +196,7 @@ static void rmdir_full(gchar const *root) int main(int argc, char **argv) { - gchar *tmp_path = g_dir_make_tmp("qemu-test-logging.XXXXXX", NULL); + g_autofree gchar *tmp_path = g_dir_make_tmp("qemu-test-logging.XXXXXX", NULL); int rc; g_test_init(&argc, &argv, NULL); @@ -212,6 +212,5 @@ int main(int argc, char **argv) rc = g_test_run(); rmdir_full(tmp_path); - g_free(tmp_path); return rc; } From patchwork Tue Sep 15 12:13:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3996EC43461 for ; Tue, 15 Sep 2020 12:32:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94FD320731 for ; Tue, 15 Sep 2020 12:32:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M6gXfErn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94FD320731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIA8a-00060q-I9 for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:32:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9rO-0001Sl-BD; Tue, 15 Sep 2020 08:14:58 -0400 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:52972) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9rM-0008JL-M9; Tue, 15 Sep 2020 08:14:58 -0400 Received: by mail-pj1-x1041.google.com with SMTP id o16so1678388pjr.2; Tue, 15 Sep 2020 05:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ks2bOk3jYOHrXnI/Shz64S+t7ePZagOpQ3Ju/TypT6Y=; b=M6gXfErnngeeKfFhqv+Vgr0UqpYON1RVKk6pPLvTxMyiNu0d5gXcwRDkLcZ/YVoF4w XzEw0VFbEMVfptJ5HLql9O9VlxiI5PR0DSNfoxU7jq0Ll/wbOIyvfkoOyXfKc+yovwIl rO2ZkXDGrZk6sOSeVMEv6+biNrBalW0EnDwVUFZuN3CgHoUMmfNeYFCh7lVAfIiwmDDf +nzfKyyZnVwTsIF+vuo3vlHYs+mIOVfN4V8jpwOCSNPBuJG06dVKDrb/e4JymgOc1475 FDpJawkj3VIV28wET96wguSrm2BVBIJlH4g4xMihHanOkvTjsmsrD8WGWOA4fNSBolC8 vtXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ks2bOk3jYOHrXnI/Shz64S+t7ePZagOpQ3Ju/TypT6Y=; b=LNqMNFKXnAD1zKJ97ubSL4dXstxhBnQC8KMYCDkBlo1+QBsILzEpgUkqXDVCJXIAAZ GIzpVqd1iukiIR6Sic6onEhJZFZy3uhvgE0/qEe98dJP1dEIdKK4hTQmY85i37avecH/ pbqTQ871ntiW8nZo6SvBK5+6HcdCMimiO84ywj1ZbXJJxXM1F/iARKXI9g/uyTRNbj7d 7jNRtSUdrNGs3zHddHU6DiLPW4KMcdB3SuQxMFxAvtZ/wNaPyVSEod7/GHYZTeoDXOzR PYLDRkJDD9hB0Z79SupqZW2pQyMEp1dvlcJOBWAH1xoN+lVkNN9xXFbCPufhOUtpU9oa a4xw== X-Gm-Message-State: AOAM530Ey0xcuNW3h5n8puZYrYqJmTtGabw9Hp2u/nAMd97uWZ1lZqJZ x464NzXwzWzON3yrol1DeY2x5P89jY4G3ABdT2A= X-Google-Smtp-Source: ABdhPJwSlyNgD9I3zY8yY0qa0o7rPRisuPynZNgZvdKZ5zYH9SXLM8+VTZprLTCqcerRG79GyK+V+Q== X-Received: by 2002:a17:902:74c1:b029:d1:e598:401b with SMTP id f1-20020a17090274c1b02900d1e598401bmr1557161plt.85.1600172094637; Tue, 15 Sep 2020 05:14:54 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:53 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 17/26] tests: Fixes test-io-channel-socket.c tests under msys2/mingw Date: Tue, 15 Sep 2020 20:13:09 +0800 Message-Id: <20200915121318.247-18-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1041; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1041.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Currently test-io-channel-socket doesn't init with qemu_init_main_loop and that's cause the qemu_aio_context not inited, and the following is the stack when null pointer accessed: qemu_fd_register (c:\work\xemu\qemu\util\main-loop.c:336) qemu_try_set_nonblock (c:\work\xemu\qemu\util\oslib-win32.c:224) qemu_set_nonblock (c:\work\xemu\qemu\util\oslib-win32.c:230) socket_can_bind_connect (c:\work\xemu\qemu\tests\socket-helpers.c:93) socket_check_protocol_support (c:\work\xemu\qemu\tests\socket-helpers.c:141) main (c:\work\xemu\qemu\tests\test-io-channel-socket.c:568) __tmainCRTStartup (@__tmainCRTStartup:142) mainCRTStartup (@1400014f6..140001539:3) BaseThreadInitThunk (@BaseThreadInitThunk:9) RtlUserThreadStart (@RtlUserThreadStart:12) Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- tests/test-io-channel-socket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c index d43083a766..743577d744 100644 --- a/tests/test-io-channel-socket.c +++ b/tests/test-io-channel-socket.c @@ -25,6 +25,7 @@ #include "socket-helpers.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qemu/main-loop.h" static void test_io_channel_set_socket_bufs(QIOChannel *src, @@ -556,6 +557,7 @@ int main(int argc, char **argv) bool has_ipv4, has_ipv6; module_call_init(MODULE_INIT_QOM); + qemu_init_main_loop(&error_abort); socket_init(); g_test_init(&argc, &argv, NULL); From patchwork Tue Sep 15 12:13:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305380 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80499C433E2 for ; Tue, 15 Sep 2020 12:49:42 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EAB9E20756 for ; Tue, 15 Sep 2020 12:49:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ORmkE7Sr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAB9E20756 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:32770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAOz-0002a1-0a for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:49:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9rT-0001ax-DO; Tue, 15 Sep 2020 08:15:03 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:52975) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9rQ-0008Jf-Vs; Tue, 15 Sep 2020 08:15:03 -0400 Received: by mail-pj1-x1044.google.com with SMTP id o16so1678473pjr.2; Tue, 15 Sep 2020 05:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eTowCOmFGkug/aztHy6I04JZoGONhdCbvgRzQeqIV9w=; b=ORmkE7SrCuBO9Q89TIq+fj8LqIPGV4DJeFGxt1mcn8bhDlBzzDXZavsNkFhajh88nq nNoZz9H//Ka6v6LLKYghz6rL7577lbUOmIuijE78YKv4RB7hkFulF3SY9GMx20hRjOp/ caruDFKKbYGVfC6amTu/MUtIrylj38REwYYBehxCdGUnA/gATnAZN2gVEFMGfNtu1jYr f45JBNMZ343uehdIBk9GoX/ADSnN2ElLyDnLZZ3iYaYB6nGW0xq9lGnVZXmidOQp3qpH 9EbTXH3069fvrbfalKNVLjjBVLwu+qx5fkji4xx95hPBZ9c+Y8iax8sOzxLoaxgRVDTf DLaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eTowCOmFGkug/aztHy6I04JZoGONhdCbvgRzQeqIV9w=; b=PAQY7MlsW4FMWkFb7LhX7DoFtvDMd/D3Mpzb/Lq053rzU9ggIXrFVmDsk0dGQ13PRs /Z4/vDcFy/zrmz9h+by8c/vLygsoFWKr9kaCJ9vviNOZabEf21tLA7qMwQX8D6XpK/Rl MxZyiZ2A/VqIDTtKYGiCcZv1rNbIDgyfXf7Q6mrkhEauKmrPlpFPUHTP8zsXdAIEtF6E Oji8B3mFTz9Cg7s7FZAc6NpLWlu8bIZLoFWFaYYtDEwY0JsplubfRd3ubQ+XH1AWjUZc HCE+zogs7+0XNtYfHu0+xUX7YxCJVkdJ9q2lNKKJ/RWN3bbbYYOv75Z3ynj4d2vwiAvP mP5w== X-Gm-Message-State: AOAM5300BpHP9YcjSJe5r8TpUDEUCkHZwrcJOlydpWb7CTjuRFfJyyQT MCHHttqbZWvaGe5iiaDXKxpWQCyQwHpnTGQpksY= X-Google-Smtp-Source: ABdhPJzylrtBYOP6HBMQovno7GbcyIMj8u67KpmTHdz5HJEDbnl+iAVX+tB8EtT8Rt6xFD01j9pTjQ== X-Received: by 2002:a17:902:cf8f:b029:d0:90a3:24e9 with SMTP id l15-20020a170902cf8fb02900d090a324e9mr18444947ply.8.1600172098889; Tue, 15 Sep 2020 05:14:58 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:14:58 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 18/26] tests: fixes aio-win32 about aio_remove_fd_handler, get it consistence with aio-posix.c Date: Tue, 15 Sep 2020 20:13:10 +0800 Message-Id: <20200915121318.247-19-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1044.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This is a fixes for (C:\work\xemu\qemu\build\tests\test-aio-multithread.exe:19100): GLib-CRITICAL **: 23:03:24.965: g_source_remove_poll: assertion '!SOURCE_DESTROYED (source)' failed ERROR test-aio-multithread - Bail out! GLib-FATAL-CRITICAL: g_source_remove_poll: assertion '!SOURCE_DESTROYED (source)' failed (C:\work\xemu\qemu\build\tests\test-bdrv-drain.exe:21036): GLib-CRITICAL **: 23:03:29.861: g_source_remove_poll: assertion '!SOURCE_DESTROYED (source)' failed ERROR test-bdrv-drain - Bail out! GLib-FATAL-CRITICAL: g_source_remove_poll: assertion '!SOURCE_DESTROYED (source)' failed And the idea comes from https://patchwork.kernel.org/patch/9975239/ Signed-off-by: Yonggang Luo --- util/aio-win32.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/util/aio-win32.c b/util/aio-win32.c index 953c56ab48..9899546a8a 100644 --- a/util/aio-win32.c +++ b/util/aio-win32.c @@ -37,6 +37,15 @@ struct AioHandler { static void aio_remove_fd_handler(AioContext *ctx, AioHandler *node) { + /* If the GSource is in the process of being destroyed then + * g_source_remove_poll() causes an assertion failure. Skip + * removal in that case, because glib cleans up its state during + * destruction anyway. + */ + if (!g_source_is_destroyed(&ctx->source)) { + g_source_remove_poll(&ctx->source, &node->pfd); + } + /* If aio_poll is in progress, just mark the node as deleted */ if (qemu_lockcnt_count(&ctx->list_lock)) { node->deleted = 1; @@ -139,8 +148,6 @@ void aio_set_event_notifier(AioContext *ctx, /* Are we deleting the fd handler? */ if (!io_notify) { if (node) { - g_source_remove_poll(&ctx->source, &node->pfd); - aio_remove_fd_handler(ctx, node); } } else { From patchwork Tue Sep 15 12:13:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09AD1C433E2 for ; Tue, 15 Sep 2020 12:35:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A6C2420731 for ; Tue, 15 Sep 2020 12:35:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jotwSAVC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6C2420731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAAq-0000uM-Nw for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:35:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9rY-0001lD-8a; Tue, 15 Sep 2020 08:15:08 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:41758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9rV-0008L6-9g; Tue, 15 Sep 2020 08:15:07 -0400 Received: by mail-pf1-x441.google.com with SMTP id z19so1810642pfn.8; Tue, 15 Sep 2020 05:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=raGFyZs6MR9nEefX4kmRsgZPLq8a4zwcDe8/ve9JX8Y=; b=jotwSAVCO7QCer34R2d8YwkPUZNp0uU6b594L7lhhvvII3ieMBMS2Y+ROEAgAM6/4j 5m62ikOoprdB2JD1WDAt5wdOrmw8t1IrznnlXH878vzXMtMk8O2rD0RH3E6IMoE9lIJD mVDZNbJQnjHq65hirPRahzokThVLRgum4K96wSHlGfB/s0o+AoEhnYXTrnTjl5bKdtI0 fvDghLpWXgrELkFB6QVVm7lI78ufT/eoEqz6MNLtGvGBWyi007vxmq1sj7+fTwhS7PhW cF0rE9giAMK9+sbyRJaC5gOMlX9n9iikqFRBo6CciRYNjhx/3hQTRTdEZX+FiKj1Sq8t iyKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=raGFyZs6MR9nEefX4kmRsgZPLq8a4zwcDe8/ve9JX8Y=; b=KUgHLQbQNcSTcgYmwVWHQVbcio9qVnwMaJoI8+1cTcj0XWENJ2WQMrCp2qIsKPH9rO 5TEYQo9Rf8KFnwXplLKJUceTbNk3la7zQIELBL+Efe/uLQ3TrBUW8oBc6NQ5+Z4p1D+m Ig0hZTpX6lq/Lig8KxANLrV5+jAE15gcfRQILFVTete7zggKliXrHxYpKng3Q8c3x2W6 k8KwFtX7TxVT3cosHWu5AiFceqfjAF/fS+n/SoRcqaghkVSvZwjAEdfAwRrkj5A+08hN 6vdAg0R3y1Lv1wPhg7MAkVI28G/BlDDJNd6QDdEP1K6it6qv8B+L2E75bxvxj5UKrzMT TKoA== X-Gm-Message-State: AOAM532q9CHDwew5iyT3VKM1Mn8aNFB56gF0TC2o35z/PKd4vlS1ksip 4msxCcElQDZud1zU9kwR98MBOpJJV6knQPXzO1w= X-Google-Smtp-Source: ABdhPJyduO21GmjIrmdXNMu7zQnfW0lKAXbIwbo0BOdqY2z1Oiwo1EfWKWPq/9oLcKrZUOPulLNUlw== X-Received: by 2002:a63:580c:: with SMTP id m12mr13400026pgb.99.1600172103063; Tue, 15 Sep 2020 05:15:03 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:15:02 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 19/26] tests: Fixes test-io-channel-file by mask only owner file state mask bits Date: Tue, 15 Sep 2020 20:13:11 +0800 Message-Id: <20200915121318.247-20-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This is the error on msys2/mingw Running test test-io-channel-file ** ERROR:../tests/test-io-channel-file.c:59:test_io_channel_file_helper: assertion failed (TEST_MASK & ~mask == st.st_mode & 0777): (384 == 438) ERROR test-io-channel-file - Bail out! ERROR:../tests/test-io-channel-file.c:59:test_io_channel_file_helper: assertion failed (TEST_MASK & ~mask == st.st_mode & 0777): (384 == 438) Signed-off-by: Yonggang Luo --- tests/test-io-channel-file.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test-io-channel-file.c b/tests/test-io-channel-file.c index bac2b07562..1b0e8d7c1b 100644 --- a/tests/test-io-channel-file.c +++ b/tests/test-io-channel-file.c @@ -28,6 +28,12 @@ #define TEST_FILE "tests/test-io-channel-file.txt" #define TEST_MASK 0600 +#ifdef _WIN32 +#define TEST_MASK_EXPECT 0700 +#else +#define TEST_MASK_EXPECT 0777 +#endif + static void test_io_channel_file_helper(int flags) { QIOChannel *src, *dst; @@ -56,7 +62,9 @@ static void test_io_channel_file_helper(int flags) umask(mask); ret = stat(TEST_FILE, &st); g_assert_cmpint(ret, >, -1); - g_assert_cmpuint(TEST_MASK & ~mask, ==, st.st_mode & 0777); + /* On Windows the stat() function in the C library checks only + the FAT-style READONLY attribute and does not look at the ACL at all. */ + g_assert_cmpuint(TEST_MASK & ~mask, ==, st.st_mode & TEST_MASK_EXPECT); unlink(TEST_FILE); object_unref(OBJECT(src)); From patchwork Tue Sep 15 12:13:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273711 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76376C433E2 for ; Tue, 15 Sep 2020 12:50:20 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DACBC206A5 for ; Tue, 15 Sep 2020 12:50:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QQJe1JlC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DACBC206A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAPa-0003M8-R0 for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:50:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9rb-0001tP-Qi; Tue, 15 Sep 2020 08:15:11 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:41256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9rZ-0008LR-JM; Tue, 15 Sep 2020 08:15:11 -0400 Received: by mail-pg1-x541.google.com with SMTP id y1so1880489pgk.8; Tue, 15 Sep 2020 05:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BErOzaIvgNGZoOo8yO9vO+FZKR44ZCkaFrgaQmO82bU=; b=QQJe1JlCqlwTYES5U3ztYVuTFygN0q3ELhe7/4SyL4Gjhd/venDnNAqrCTEwsriNsN 5jgDIJ8yjgQRq5XYfM2vUzut3BuBqb6AFCtpOnTpL1rs8wVAxK2OQilNejW0G8quG5zG Z4I6YE5folluvVCCmD20gMt22mvyoyul8n6c/1P8y7HZDcjuosRpTAU7Ka5tXiaFWOT2 RKRQ84QiyEDITAz15ogVt6+qrG5lQUMM6Tv00GXVA3R4PyEZyH+3BD4T6umEjimBmWsB tcS/2/or+j87Mtsv1Xc8qEo5ZWMYccBAJkYURbx9+KepO/0NZQXaT6c3Qyg4hLHrtiXc 5f5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BErOzaIvgNGZoOo8yO9vO+FZKR44ZCkaFrgaQmO82bU=; b=SrqOrNKRPsDQqkM92j9+9K7RNsH3ctmuuGa+2ENb6QgN9rHk4XNUf/NGOptkUkNUue 9oae0WZHy7rc17KaW7O3rq0249af97h0U8kGGevF8yum8dMO6li6R8h0yNp4Dmj1KmgY tBt8tKndwnb6BIpNPUz/ZuhMo45HBgOzzKM8FbsBvhI/I7IxmdgDJZkQ3KPW0b0kAJcB 1pSk9sMov0y/uzZCCHrF9ha18JW7fWHv8LIBvhGbTruUAYiFgpWcdyxSHqURJVrT3DJD Boi1Zjethm9nf1OGE4rwngAtUXfuV6PBqYX8OjQqb1oy9NGNQvK8qfxDuv17UhXKENNx QYng== X-Gm-Message-State: AOAM531sfunPI4OPyXtLPlKpjYmBBowm4HvV/XK1J24C+0+8MwV9vSZ7 sXlT3R6P9rmiqtwg1yhdfIQ66PjcsbZNAEdVjJA= X-Google-Smtp-Source: ABdhPJxeZuhLBPz4WQtc9uumKcnVAgveodmD0fwT0Hj5kgERHz2uCnQXnHGjnpE56xG6H95O36FPig== X-Received: by 2002:aa7:869a:0:b029:142:2501:34d1 with SMTP id d26-20020aa7869a0000b0290142250134d1mr1665456pfo.42.1600172107393; Tue, 15 Sep 2020 05:15:07 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.15.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:15:06 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 20/26] tests: fix test-util-sockets.c Date: Tue, 15 Sep 2020 20:13:12 +0800 Message-Id: <20200915121318.247-21-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::541; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x541.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Fixes following errors: Running test test-util-sockets ERROR test-util-sockets - missing test plan # Start of name tests ** ERROR:../tests/test-util-sockets.c:93:test_socket_fd_pass_name_good: assertion failed (fd != -1): (-1 != -1) Bail out! ERROR:../tests/test-util-sockets.c:93:test_socket_fd_pass_name_good: assertion failed (fd != -1): (-1 != -1) First should call to qemu_init_main_loop before socket_init, then on win32 doesn't support for SOCKET_ADDRESS_TYPE_FD socket type Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- tests/test-util-sockets.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c index af9f5c0c70..1bbb16d9b1 100644 --- a/tests/test-util-sockets.c +++ b/tests/test-util-sockets.c @@ -75,7 +75,7 @@ int monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) { abort(); } void monitor_init_qmp(Chardev *chr, bool pretty, Error **errp) {} void monitor_init_hmp(Chardev *chr, bool use_readline, Error **errp) {} - +#ifndef _WIN32 static void test_socket_fd_pass_name_good(void) { SocketAddress addr; @@ -227,6 +227,7 @@ static void test_socket_fd_pass_num_nocli(void) g_free(addr.u.fd.str); } +#endif #ifdef __linux__ static gchar *abstract_sock_name; @@ -321,6 +322,7 @@ int main(int argc, char **argv) { bool has_ipv4, has_ipv6; + qemu_init_main_loop(&error_abort); socket_init(); g_test_init(&argc, &argv, NULL); @@ -340,6 +342,7 @@ int main(int argc, char **argv) test_fd_is_socket_bad); g_test_add_func("/util/socket/is-socket/good", test_fd_is_socket_good); +#ifndef _WIN32 g_test_add_func("/socket/fd-pass/name/good", test_socket_fd_pass_name_good); g_test_add_func("/socket/fd-pass/name/bad", @@ -352,6 +355,7 @@ int main(int argc, char **argv) test_socket_fd_pass_num_bad); g_test_add_func("/socket/fd-pass/num/nocli", test_socket_fd_pass_num_nocli); +#endif } #ifdef __linux__ From patchwork Tue Sep 15 12:13:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273710 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54EFEC43461 for ; Tue, 15 Sep 2020 12:53:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CAD0F20756 for ; Tue, 15 Sep 2020 12:53:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G7CuxFXC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CAD0F20756 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIASO-0006TC-Rb for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:53:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9rf-00023d-Ul; Tue, 15 Sep 2020 08:15:15 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:39931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9re-0008M3-20; Tue, 15 Sep 2020 08:15:15 -0400 Received: by mail-pl1-x641.google.com with SMTP id x18so1242300pll.6; Tue, 15 Sep 2020 05:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ajxFadu+yHNyg0D+X68nZFkcXE3tK/jib0sFS+8nB4w=; b=G7CuxFXCpOVB4PxoOUxDiLu6ip1jXjbq/yoDF3ecQzhTwo6Ah5wh8QX+Bje5Gj8QR2 nvizbCmtxPEcDvsW8LOkyNqQwnj95h2Ym7r8XTl83ZsuURr3HmR8pkRcp7ccIRuSJC+L 4u//mAgXPe2jY18zr1SzEGd0aY5L1H+YFWjP21ZaarT3RAl9NUGNResw6+IsB6MLUV6T sxePT3Ie3jMgbth0Lis6yn1qkZb008yBBDLjR6xNRtHPU2gt6o1JpJnLH9su4HeB5dXz BHSm1jYpw/wnjvErXFDtzL2AGtIT21uqVpoq2CG1TIHBxpP2OOyKtz1y7pHU1OCVumy0 0eNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ajxFadu+yHNyg0D+X68nZFkcXE3tK/jib0sFS+8nB4w=; b=hzCOCOx3UzcwlH/mMvV5ZhlXEExVKvciK+MmZ5dVpYo0+SThEqlY+LlWnhb0ZxD/2a XeDjb6YcJAlkb2dU1DDHxKiN8nFN2a2Zq4gV2dfDynRmFNLWV42+i1vbvuKylUkbIttf i/sbpjW6s4j6AEvAzN014xEE261qPdhHogrcgTNxtjZRm196s3f18Gc36v6L9x/o1Z0p 7VJXS6CfEgokXNZZoy7ZJrDbT1K/t9+SqNKAqT1xBOOkNNJxRrfyt+zPvtB+z5nwC9+S zK/cT9uIbYwBhUq55PO8Pdis92fvadnc6P8o1KKC+v5W/wIZ35EFl258mfhbRma0ZC5Q mRqw== X-Gm-Message-State: AOAM530iNVzpZ3tvqJyUHSIxgMk/G3JGWsZHUQR6FuJ+aljao55urhzb KiXP2X2CuPtRxdDMbKBBun3a8Xoab2p8FjfDZ9Q= X-Google-Smtp-Source: ABdhPJw98Lc3tzKeo+lgHNoH/mfvhrIsBq5BYSDWYwDbZL1WPZlRW2AY+2irudECSKY5NYNPPsrvbQ== X-Received: by 2002:a17:902:a512:b029:d0:92cc:a1f6 with SMTP id s18-20020a170902a512b02900d092cca1f6mr19579057plq.9.1600172111966; Tue, 15 Sep 2020 05:15:11 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:15:11 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 21/26] tests: Fixes test-qdev-global-props.c Date: Tue, 15 Sep 2020 20:13:13 +0800 Message-Id: <20200915121318.247-22-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::641; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x641.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On win32 the line ending are \r\n, so we skip the \n in function test_dynamic_globalprop Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- tests/test-qdev-global-props.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c index 8a3c14d92c..be6bcfc46b 100644 --- a/tests/test-qdev-global-props.c +++ b/tests/test-qdev-global-props.c @@ -251,10 +251,10 @@ static void test_dynamic_globalprop(void) g_test_trap_assert_passed(); g_test_trap_assert_stderr_unmatched("*prop1*"); g_test_trap_assert_stderr_unmatched("*prop2*"); - g_test_trap_assert_stderr("*warning: global dynamic-prop-type-bad.prop3 has invalid class name\n*"); + g_test_trap_assert_stderr("*warning: global dynamic-prop-type-bad.prop3 has invalid class name*"); g_test_trap_assert_stderr_unmatched("*prop4*"); - g_test_trap_assert_stderr("*warning: global nohotplug-type.prop5=105 not used\n*"); - g_test_trap_assert_stderr("*warning: global nondevice-type.prop6 has invalid class name\n*"); + g_test_trap_assert_stderr("*warning: global nohotplug-type.prop5=105 not used*"); + g_test_trap_assert_stderr("*warning: global nondevice-type.prop6 has invalid class name*"); g_test_trap_assert_stdout(""); } From patchwork Tue Sep 15 12:13:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC9E8C433E2 for ; Tue, 15 Sep 2020 12:43:09 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6979B2068D for ; Tue, 15 Sep 2020 12:43:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qrprkJGF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6979B2068D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAIe-0003Ng-FA for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:43:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9rk-0002El-94; Tue, 15 Sep 2020 08:15:20 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:40723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9ri-0008MZ-DE; Tue, 15 Sep 2020 08:15:19 -0400 Received: by mail-pg1-x541.google.com with SMTP id j34so1880700pgi.7; Tue, 15 Sep 2020 05:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K7y5ZJD/cG5cMFm0+/8rHEDw15+8VS3xMSK8qF/3N8U=; b=qrprkJGFBTA5f06N9KxqbEvcszJJFVkFgeYNFSrFkFTWriKydAnxEsTb4WjU2uLvUx TAcCdcOcG/F+z2l6IcYHGt5MuQI2SpzTZ9fKUlQhqBeIN3Gu0K9CjdixtWJChjCETUxC ewZdeRWwbXSo2IqruWVmcTZ7DwJNFLjNNl06E3Ob5Tx8rSMAdBp99IBpNT7ZRaUoLdYK JkSGEAfO7lwzxGpTYQZcy4G4WJAgq3UVZbSNZyGX4I6bSURUCwtKIz0AWR9XlY5iew4R KzmHktck7nP9xqkzPp57mepP5V0cDkTLS8NtwEG755C3AZ4JnU+oDR27YTINOG17sALa tf9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K7y5ZJD/cG5cMFm0+/8rHEDw15+8VS3xMSK8qF/3N8U=; b=KLcF8tF1AQTQR2rOaQRRxGKy3oOg5d0NitcUyNTmSZ8YPmXZtd878vBacdYMVV6Mk0 Om0RWwJFE9gKLYTUfyJfvcyCBfzEfKvflU4DruegCUlxdS5B009x6c/bdavuTA8MN36U DsLhwntBJsKvEqRRatlREsaB8HpgDlTHcnU2ZSAoaaum8PKYCMZjdh8JUDghKYkzzmGK Ea6zqwH5kUU4lJeOlQ330DBKMXQwuspXuvRtogwJQPn+7M1mXy0IjwuuFUyrU5MRqkPe Nd/JNz9tcL3Kd7PNgdbHgUHBg9FCAtVP6atB9QbEeJfJ394zVuk0hvkn16XVYIEa6xdX chZA== X-Gm-Message-State: AOAM530XbFEd7s2I+PPK8w9b3m9R1n5kssLZSAZTNoLMbqpeRHGY9d+W WY36WlN5Z/54YGoiRGeIW+i8bNbu8bQdKn+rDUc= X-Google-Smtp-Source: ABdhPJxYNjhoyvAfLT3zxUad4QAMR3RLj8w9OhaHENqD4FUV7HyOg3nFjnU3lx1npoZijt39ond7IQ== X-Received: by 2002:a63:4a0e:: with SMTP id x14mr14849667pga.222.1600172116266; Tue, 15 Sep 2020 05:15:16 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:15:15 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 22/26] rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full Date: Tue, 15 Sep 2020 20:13:14 +0800 Message-Id: <20200915121318.247-23-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::541; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x541.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" drain_call_rcu is necessary on win32, because under win32, if you don't close the file before remove it, the remove would be fail. Signed-off-by: Yonggang Luo --- tests/test-logging.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-logging.c b/tests/test-logging.c index 783fe09a27..8b1522cfed 100644 --- a/tests/test-logging.c +++ b/tests/test-logging.c @@ -210,6 +210,8 @@ int main(int argc, char **argv) tmp_path, test_logfile_lock); rc = g_test_run(); + qemu_log_close(); + drain_call_rcu(); rmdir_full(tmp_path); return rc; From patchwork Tue Sep 15 12:13:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07ADCC43461 for ; Tue, 15 Sep 2020 12:52:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34DEA20872 for ; Tue, 15 Sep 2020 12:52:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hPLfcdNJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34DEA20872 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIARf-0005TV-AC for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:52:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9rt-0002Sy-BT; Tue, 15 Sep 2020 08:15:30 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:56027) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9rm-0008N5-LR; Tue, 15 Sep 2020 08:15:28 -0400 Received: by mail-pj1-x1044.google.com with SMTP id q4so1670645pjh.5; Tue, 15 Sep 2020 05:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+2fNL50dgeI28TebAqSoSX6cTtGwDHyqvFUmnw67Jgc=; b=hPLfcdNJh2mAb1WJzhT1hAolY0afE4JC/xDRxkhejAJ707uQF/cPLW8/1Pr79T8sOx tqYLoC3rtqaOHUZ4UeTsataY2eSiLJdAETFmxmTMiKziLNN7zAmdrWp7zeBcLv+z0XYS wxj+f49My30sBK6p0YFWXZyzddNbe018csoFnJT9jRTALPabYEnZpy3olxnM2Vj5UVw1 1A8dm8fLC0D40G64HwWIv5gDujSe5zVzQSPTHbSlZtcKXhqmFG0bmTvcoSVEdm4gKIfd /w/Q24Oq26fkblg2wXFWP2Ou8lPSYbgdof60OEL9wf/mI5FUDhfYDEGErFWOTqsnoOku ITng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+2fNL50dgeI28TebAqSoSX6cTtGwDHyqvFUmnw67Jgc=; b=kBTxRaXKhdgL/qYjTbt86t33Gj64pTU4ymkG0sDV6KPebu7NUHhTxFmW+lkjXSNZt2 0VVlvKiEExi16KiQDuHDTiCVkiTEx1+07QE/aN4PXdj/XCYUbDLYYdEtb35wkT2zq63w 9Pj9b9i4U1m9cVgLSktF5ns11Iedhz4YUA1adGl6SoaXiipitohFIWocsXAoxNuArPsF luwgxI0rphZUu1bgpq8bsWVIadJ/PhrUGV9BlDAHhljYFyT16JSFD+WbfA8tTxIUNak6 bc4Pv5JG6KAYjFaY1kHmfDJrNSp+fwd5jK7BPjU0E6XmdfwQbInrZj7H+TxF8bRjHoI4 SCcw== X-Gm-Message-State: AOAM533gQayFEQuBQRdt4nt6QyZIwK5rrq3mjA9WlVJstl+VXGMj1887 Qj/HWPVyjbonxGXeMI0lDROPGQwmICLqF/YkpAI= X-Google-Smtp-Source: ABdhPJwUG0PKPwWFyT4VC2WhhJaU+ktfaYrk2uAto6ec/FOF0RrU/rwhFPo+AUfYpaj647aI2082KQ== X-Received: by 2002:a17:902:7c90:b029:d1:e626:ef9c with SMTP id y16-20020a1709027c90b02900d1e626ef9cmr1081993pll.64.1600172120555; Tue, 15 Sep 2020 05:15:20 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:15:19 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 23/26] meson: upgrade meson for execute custom ninjatool under msys2 properly Date: Tue, 15 Sep 2020 20:13:15 +0800 Message-Id: <20200915121318.247-24-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1044.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" * Bump versions to 0.55.2 for release * Tag Info: object 008d13038f95e7c7d8ad553f14e408da5b94c360 type commit tag 0.55.2 tagger Jussi Pakkanen 2020/9/11 1:24:47 Signed-off-by: Yonggang Luo --- meson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson b/meson index 68ed748f84..008d13038f 160000 --- a/meson +++ b/meson @@ -1 +1 @@ -Subproject commit 68ed748f84f14c2d4e62dcbd123816e5898eb04c +Subproject commit 008d13038f95e7c7d8ad553f14e408da5b94c360 From patchwork Tue Sep 15 12:13:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305378 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0A16C433E2 for ; Tue, 15 Sep 2020 12:54:19 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27D4520756 for ; Tue, 15 Sep 2020 12:54:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nwlFi4Cm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27D4520756 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIATR-00087T-Vj for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:54:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9ry-0002XU-7y; Tue, 15 Sep 2020 08:15:34 -0400 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:54356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9rr-0008Om-G0; Tue, 15 Sep 2020 08:15:33 -0400 Received: by mail-pj1-x1042.google.com with SMTP id mm21so1672349pjb.4; Tue, 15 Sep 2020 05:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MXs4ipB1qD/APQaGp4NB6LwTFDa75md5Tixi/bd+wws=; b=nwlFi4CmB5Yv1IMyFfl3JwKwhsfcYOAK0OYrOhytp0KCy3+F5pkV/RsNiuzYCJdvNy aWHwy3JGSb1PJY7YXJWyG4bSbu4EqTiGDFHGoLJbh4X/2jixgoSjFEuAMmaU1Ah1tlqP y7W3CJlRudntrfzG6QMSpCqEtMEhaBA1rOY3/kwoTbhJOcqJSkLg5CsoK8t7bZZruxjD g9M6+zBXcYFuUb8L2/h8PmoG7XYMSw5rBlAYhFOC2FqXGnS1Xwd0rzJCym4zLQcpH8QD BFEibcLqN3YAnshEVORGuztdMsmR4JrukaBFcJMC/+QzB8c2UxYV0Sat3ocv/blbKLZ9 3q3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MXs4ipB1qD/APQaGp4NB6LwTFDa75md5Tixi/bd+wws=; b=iUySGA3PT7w4rDf5B7srGLn9qnNPIPSemWryII/pcEDwN6TJscFory6pGDIBJQreyk THvHRLWhBfJM2XrJfKtPNbcfFTgk9femAvQlR1rNl2BLZ/jdkhrHndAhiNodYkHZ51Bu Y1gjudMe5h0xRljQLblEmWirEDsdtS0O54M7eH/RxsCdpnmdKQ555EjUavWNXA8mYmH9 nBGv5ptpAC8O5pOy14tJONFX9VhWq/yY+5PL/SchnvmSWFA9USDGbBXOmkz6q9qDyiyL 2YNwCWeqkdUJewjIks2JpAWkhiSsI915UVpJcb4VrLR5YhI4IfND0uutdxn5tsKvPltF khWw== X-Gm-Message-State: AOAM532MrRvCpikb7CcjKEQ+gNQwrzbaibyIFlX+q7ypMBEoOy74bjDA 3PClt9Z+tkFobarIFSiAC4RlDz8Jf5AzlatCUWc= X-Google-Smtp-Source: ABdhPJxd3BQykWPle45GVGpyNwux868NgnC7Uvnh1qJxkX6T5ezeAcpJEyJZ952QZVPBPrDgeMCEsw== X-Received: by 2002:a17:902:9f84:b029:d1:cc21:9a49 with SMTP id g4-20020a1709029f84b02900d1cc219a49mr7740070plq.9.1600172124975; Tue, 15 Sep 2020 05:15:24 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:15:24 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 24/26] ci: Enable msys2 ci in cirrus Date: Tue, 15 Sep 2020 20:13:16 +0800 Message-Id: <20200915121318.247-25-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1042; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1042.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Install msys2 in a proper way refer to https://github.com/cirruslabs/cirrus-ci-docs/issues/699 The https://wiki.qemu.org/Hosts/W32#Native_builds_with_MSYS2 need to be updated. There is no need of --cross-prefix, open mingw64.exe instead of msys2.exe then we don't need the --cross-prefix, besides we using environment variable settings: MSYS: winsymlinks:nativestrict MSYSTEM: MINGW64 CHERE_INVOKING: 1 to opening mingw64 native shell. We now running tests with make -i check to skip tests errors. Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrangé --- .cirrus.yml | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 690c6882e8..176ccba76c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -44,3 +44,64 @@ macos_xcode_task: --enable-werror --cc=clang || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake check + +windows_msys2_task: + windows_container: + image: cirrusci/windowsservercore:cmake + os_version: 2019 + cpu: 8 + memory: 8G + env: + MSYS: winsymlinks:nativestrict + MSYSTEM: MINGW64 + CHERE_INVOKING: 1 + printenv_script: + - C:\tools\msys64\usr\bin\bash.exe -lc 'printenv' + install_script: + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && + curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz" + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && + curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig" + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && + pacman -U --noconfirm msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Sy" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S --needed + bash pacman pacman-mirrors msys2-runtime" + - taskkill /F /IM gpg-agent.exe + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Su" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S --needed + base-devel + git + mingw-w64-x86_64-python + mingw-w64-x86_64-python-setuptools + mingw-w64-x86_64-toolchain + mingw-w64-x86_64-SDL2 + mingw-w64-x86_64-SDL2_image + mingw-w64-x86_64-gtk3 + mingw-w64-x86_64-glib2 + mingw-w64-x86_64-ninja + mingw-w64-x86_64-make + mingw-w64-x86_64-lzo2 + mingw-w64-x86_64-zstd + mingw-w64-x86_64-libjpeg-turbo + mingw-w64-x86_64-pixman + mingw-w64-x86_64-libgcrypt + mingw-w64-x86_64-libpng + mingw-w64-x86_64-libssh + mingw-w64-x86_64-libxml2 + mingw-w64-x86_64-snappy + mingw-w64-x86_64-libusb + mingw-w64-x86_64-usbredir + mingw-w64-x86_64-libtasn1 + mingw-w64-x86_64-nettle + mingw-w64-x86_64-cyrus-sasl + mingw-w64-x86_64-curl + mingw-w64-x86_64-gnutls + mingw-w64-x86_64-zstd" + script: + - C:\tools\msys64\usr\bin\bash.exe -lc "mkdir build" + - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && ../configure --python=python3" + - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make -j$NUMBER_OF_PROCESSORS" + test_script: + - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make V=1 check" + From patchwork Tue Sep 15 12:13:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 273713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D43ABC433E2 for ; Tue, 15 Sep 2020 12:44:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6285A2068D for ; Tue, 15 Sep 2020 12:44:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lVpK2ece" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6285A2068D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAKI-0006W9-H1 for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:44:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9s1-0002Yh-33; Tue, 15 Sep 2020 08:15:37 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:41765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9rv-0008T6-Bi; Tue, 15 Sep 2020 08:15:35 -0400 Received: by mail-pf1-x443.google.com with SMTP id z19so1811345pfn.8; Tue, 15 Sep 2020 05:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m9PX5Q8ZS6a20OpqPU9oI3b3o35S03HmsAzdWJJny0g=; b=lVpK2eceHIZ+66m4+qnyOKyjAma/U826GWVN+NZlzQ0YGpUqnd46B8A6j1lhQsp8vY F/nJBcuZ2a9zinIZt76DpLZme46UWS2ua06FPh3jEEqnibpPchB3Z6DMy4flL6trTWsk cSVygLv1pBoRpZZbBoLS3ACSwHgYiPggRc3MzF6a1kIUkG6Yhv6bylDqTs257/L7YPWe +fM0sHrSp2RxKr1HjCvV6iWp8NLOGzyU3uSRyPZ7PH2rdDSAGr39xOgudFJIfztD2bj7 43JJU7eeC20/aJIt1Ax/toZ9S2LVr4/rpd/PaynlKqmLVloI8znZSWQA8kiy8Bf1mRLV rsTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m9PX5Q8ZS6a20OpqPU9oI3b3o35S03HmsAzdWJJny0g=; b=JT57tfkbPb+l5OhSWa69wI6x8rRx1OqQ00pgAuN+aLI62haZWOoHChN0f9gzTyFgmG KJam1I+cBwc4V7q+d0BEp6ZM2Xbq2qo4DB/4LHz35AJPoldLGJTqLMDk17Pn/zWXvbdx cutGUxs0/tYjcNSDy8eil5AjijsYKDXjKEjQqupq0LYmD4TixwQ5QBaPvYVNGsvbPk3o bDe26Zl7CuQVFFYoe/K9O0sMnzumoyGqmS576HBZI6ZwSzSYkcG+b3aipQFpw6t8lvab WqlkQWWYqJMUTFZZ9L6X7BRBY4g9MuLvULYK3sXwXl7js5guUBYke1iDveK3UmU4qKgN KsVA== X-Gm-Message-State: AOAM533Kcx/YUxwXT4B7DRy8dcgxWUoXvFBTkdnoQqM7DHX9TWqhMe+D HEvRiUVRnRpaT3dLWhq2QZoEhfY2zluH/fN9/L8= X-Google-Smtp-Source: ABdhPJxMisDM/VKXdFNfeNhG5It1a7/1/IIPCgGsAtpssfOa3OJCfd4UDy3LcgzVAvjRz62Lv274Sg== X-Received: by 2002:a63:e504:: with SMTP id r4mr14768353pgh.431.1600172129215; Tue, 15 Sep 2020 05:15:29 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.15.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:15:28 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 25/26] block: Fixes nfs compiling error on msys2/mingw Date: Tue, 15 Sep 2020 20:13:17 +0800 Message-Id: <20200915121318.247-26-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::443; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" These compiling errors are fixed: ../block/nfs.c:27:10: fatal error: poll.h: No such file or directory 27 | #include | ^~~~~~~~ compilation terminated. ../block/nfs.c:63:5: error: unknown type name 'blkcnt_t' 63 | blkcnt_t st_blocks; | ^~~~~~~~ ../block/nfs.c: In function 'nfs_client_open': ../block/nfs.c:550:27: error: 'struct _stat64' has no member named 'st_blocks' 550 | client->st_blocks = st.st_blocks; | ^ ../block/nfs.c: In function 'nfs_get_allocated_file_size': ../block/nfs.c:751:41: error: 'struct _stat64' has no member named 'st_blocks' 751 | return (task.ret < 0 ? task.ret : st.st_blocks * 512); | ^ ../block/nfs.c: In function 'nfs_reopen_prepare': ../block/nfs.c:805:31: error: 'struct _stat64' has no member named 'st_blocks' 805 | client->st_blocks = st.st_blocks; | ^ ../block/nfs.c: In function 'nfs_get_allocated_file_size': ../block/nfs.c:752:1: error: control reaches end of non-void function [-Werror=return-type] 752 | } | ^ On msys2/mingw, there is no st_blocks in struct _stat64 yet, we disable the usage of it on msys2/mingw, and create a typedef long long blkcnt_t; for further implementation Signed-off-by: Yonggang Luo --- block/nfs.c | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/block/nfs.c b/block/nfs.c index 61a249a9fc..a8a8ef9e4f 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -24,7 +24,9 @@ #include "qemu/osdep.h" +#if !defined(_WIN32) #include +#endif #include "qemu/config-file.h" #include "qemu/error-report.h" #include "qapi/error.h" @@ -51,6 +53,13 @@ #define QEMU_NFS_MAX_PAGECACHE_SIZE (8388608 / NFS_BLKSIZE) #define QEMU_NFS_MAX_DEBUG_LEVEL 2 +#if defined (_WIN32) +#define nfs_stat __stat64 +typedef long long blkcnt_t; +#else +#define nfs_stat stat +#endif + typedef struct NFSClient { struct nfs_context *context; struct nfsfh *fh; @@ -70,7 +79,7 @@ typedef struct NFSRPC { int ret; int complete; QEMUIOVector *iov; - struct stat *st; + struct nfs_stat *st; Coroutine *co; NFSClient *client; } NFSRPC; @@ -415,11 +424,21 @@ static void nfs_file_close(BlockDriverState *bs) nfs_client_close(client); } +static blkcnt_t nfs_get_st_blocks(const struct nfs_stat *st) +{ +#if defined(_WIN32) + /* TODO: Not be possible implement on win32 yet, place here for futher implementation */ + return 0; +#else + return st->st_blocks; +#endif +} + static int64_t nfs_client_open(NFSClient *client, BlockdevOptionsNfs *opts, int flags, int open_flags, Error **errp) { int64_t ret = -EINVAL; - struct stat st; + struct nfs_stat st; char *file = NULL, *strp = NULL; qemu_mutex_init(&client->mutex); @@ -545,7 +564,7 @@ static int64_t nfs_client_open(NFSClient *client, BlockdevOptionsNfs *opts, } ret = DIV_ROUND_UP(st.st_size, BDRV_SECTOR_SIZE); - client->st_blocks = st.st_blocks; + client->st_blocks = nfs_get_st_blocks(&st); client->has_zero_init = S_ISREG(st.st_mode); *strp = '/'; goto out; @@ -706,6 +725,7 @@ static int nfs_has_zero_init(BlockDriverState *bs) return client->has_zero_init; } +#if !defined (_WIN32) /* Called (via nfs_service) with QemuMutex held. */ static void nfs_get_allocated_file_size_cb(int ret, struct nfs_context *nfs, void *data, @@ -729,7 +749,7 @@ static int64_t nfs_get_allocated_file_size(BlockDriverState *bs) { NFSClient *client = bs->opaque; NFSRPC task = {0}; - struct stat st; + struct nfs_stat st; if (bdrv_is_read_only(bs) && !(bs->open_flags & BDRV_O_NOCACHE)) { @@ -746,8 +766,9 @@ static int64_t nfs_get_allocated_file_size(BlockDriverState *bs) nfs_set_events(client); BDRV_POLL_WHILE(bs, !task.complete); - return (task.ret < 0 ? task.ret : st.st_blocks * 512); + return (task.ret < 0 ? task.ret : nfs_get_st_blocks(&st) * 512); } +#endif static int coroutine_fn nfs_file_co_truncate(BlockDriverState *bs, int64_t offset, bool exact, @@ -778,7 +799,7 @@ static int nfs_reopen_prepare(BDRVReopenState *state, BlockReopenQueue *queue, Error **errp) { NFSClient *client = state->bs->opaque; - struct stat st; + struct nfs_stat st; int ret = 0; if (state->flags & BDRV_O_RDWR && bdrv_is_read_only(state->bs)) { @@ -800,7 +821,7 @@ static int nfs_reopen_prepare(BDRVReopenState *state, nfs_get_error(client->context)); return ret; } - client->st_blocks = st.st_blocks; + client->st_blocks = nfs_get_st_blocks(&st); } return 0; @@ -869,7 +890,9 @@ static BlockDriver bdrv_nfs = { .create_opts = &nfs_create_opts, .bdrv_has_zero_init = nfs_has_zero_init, +#if !defined (_WIN32) .bdrv_get_allocated_file_size = nfs_get_allocated_file_size, +#endif .bdrv_co_truncate = nfs_file_co_truncate, .bdrv_file_open = nfs_file_open, From patchwork Tue Sep 15 12:13:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 305377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E7B1C433E2 for ; Tue, 15 Sep 2020 12:55:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBD8920872 for ; Tue, 15 Sep 2020 12:55:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OEerEEPu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBD8920872 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAUL-00014n-F2 for qemu-devel@archiver.kernel.org; Tue, 15 Sep 2020 08:55:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kI9s3-0002d0-1b; Tue, 15 Sep 2020 08:15:39 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:40497) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kI9s0-0008Uk-Tn; Tue, 15 Sep 2020 08:15:38 -0400 Received: by mail-pf1-x442.google.com with SMTP id x123so1821722pfc.7; Tue, 15 Sep 2020 05:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EwczR+sEF9hc4J2M80DE+JfDO1uP/AS3SpW7brF/43Q=; b=OEerEEPugLVy45XIZUZ6IA+XSo4X3Z7lWZ3CojKyEne2JjeARsTj3G4BVAv0+NeFKz 1xICFDj4OUVRiFtBEnsEx3P9SiU7W0GCSbmaQBhMxNGTGwjnV/G7EmwQo8GlfdaQEOFg eNbaYeH4Dxmsya3fs7NEwsVkaQaKpTpVZyZSoYKqBoKJDUEIcoz4EEcaEjp7WPPriHhd m7m2xJII+8N2yDCYJqEmHNbHIQ4QIKmlNNifk+ZbI/Q9RBzJ7CQQR/l4Yxznrh9UVwJ7 d+G2cuaqDB5NvXed9gS/2w7Ptnl/bxC9rEuAoFZ0B+xi1q0ESh54P4ITTzM+zhKnj4Yv l9jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EwczR+sEF9hc4J2M80DE+JfDO1uP/AS3SpW7brF/43Q=; b=khU8Y2SvJIONdorSfMEI6aotCjZULdRJm0KKA8DrnX7/mazWddAnSUKqSiWqq/s4v1 HbFPk+/SOalmM+mK75Q4n7vt4pLMEnLJnPP55HPyKxFS66+zvLTbGjAupwntc5oDq3Hb bCz84eq/TM/+8r+I94tpy77haL5SLIOC20dA+eZtPiTYdy2kwl0xHZ0tESM66YNM+LL1 tUuVqhfk4AjQ9dy4O64JRXV/MzuAm8/lSRxLp4B8CPnUCk1rb8ISVai9MmCMc1Q62A9Q W70JmCdsdXQzDLqmJ0vO2WjjU1gs67ImmWyUd2noZr2iG80zT4h33qjHITEdp1pHCHnC PJ+w== X-Gm-Message-State: AOAM531yj2bF42b19HjFdtiBX15QnLuydCA7v5VvC80orMS9eW2xb2nI BOS/s6RS870rSE/TCmhRBbaHRVmckLGNSOtGoGc= X-Google-Smtp-Source: ABdhPJy+qru9aD+hjdGyjnaodv1UI9xYzSt4j4XDlKcpH2FgjnVTnV9JqceXizlFt0h6XGi5fLRzzA== X-Received: by 2002:a63:485c:: with SMTP id x28mr14717568pgk.289.1600172133348; Tue, 15 Sep 2020 05:15:33 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id k28sm13683061pfh.196.2020.09.15.05.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 05:15:32 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v9 26/26] block: enable libnfs on msys2/mingw in cirrus.yml Date: Tue, 15 Sep 2020 20:13:18 +0800 Message-Id: <20200915121318.247-27-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200915121318.247-1-luoyonggang@gmail.com> References: <20200915121318.247-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::442; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Peter Lieven , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Richard Henderson , Li-Wen Hsu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" At the begging libnfs are not enabled because of compiling error, now it's fixed so enable it Signed-off-by: Yonggang Luo --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 176ccba76c..9566ec0439 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -93,6 +93,7 @@ windows_msys2_task: mingw-w64-x86_64-libusb mingw-w64-x86_64-usbredir mingw-w64-x86_64-libtasn1 + mingw-w64-x86_64-libnfs mingw-w64-x86_64-nettle mingw-w64-x86_64-cyrus-sasl mingw-w64-x86_64-curl