From patchwork Wed Sep 9 16:14:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11765745 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 83080618 for ; Wed, 9 Sep 2020 16:17:05 +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 383B5206A2 for ; Wed, 9 Sep 2020 16:17: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="Rdz3hZ7A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 383B5206A2 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:44082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG2mO-0003sY-9H for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Sep 2020 12:17:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG2kK-0008VN-AP; Wed, 09 Sep 2020 12:14:56 -0400 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:36380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG2kI-0006UZ-Cs; Wed, 09 Sep 2020 12:14:56 -0400 Received: by mail-pj1-x1043.google.com with SMTP id b17so1596728pji.1; Wed, 09 Sep 2020 09:14:53 -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=CNPvacxKIPvNAAT6pnf6ItFkwT6w9lX5etFkypi0MqU=; b=Rdz3hZ7AGJZQJQLjS5LuO/wRySzfTjesStvxehhK2KefuRQP1eUW4lHOczrOw0u1ZM vGOV/lzWJ95DYEgM5c048MQa+evpTgQ+3nm/rYINoSL+zN93LxZNPc49asvgpL9xNf/b l5kUTWMT3ypWTE/aNqXEHkoHfVeaU0M3WbJyO1GYBFpRYAjPQ8pyFjpZ3kjSptNk/r4v /yucd/Ue9EgeqjFwtBt5JpNw+DLc2tvWVuZQwFq1qd0V9T5sXi0jXEnDOQq5djKUbUWD Wd45OXt5oGJDkOx5KuGUPYCl023BuOLeeEOcxRpSeDHkRUoTl6dNXeNKqyiui4vtkqQ9 Oyyw== 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=CNPvacxKIPvNAAT6pnf6ItFkwT6w9lX5etFkypi0MqU=; b=Qp3pCFVkufkiIQ00wlPqdVZxy3i+OzMB2dmqVJWOVzOFhplHQYDsN/2n3+3L7tQJBn W6YHdmyIFYq7bWFGReQrVKd79JuI/yDpafV8KHZZ8qj3WC5WJ4QG8u0EhERzPs/SYnOL akMxNaMufdu/mE5hFuLYFIGO5Zu+BrU4hXpclobKdsC5Q+IMTEO6Cz5cUhcgYh27oweY dE+A5Z/zGRoWkgMYijWVUBo5MJ4cxB3Oz4SZBOZ76Xf4r3EdMqyDOVAoW2Sx4MnJCNnc QYygZsErQxn9ZJk1/j+UTvp+nWwGzpcnn/7qFh2yag7fgpjM2uZ8MndIwm857MKvgTi7 f2Rw== X-Gm-Message-State: AOAM533fbZEaROXjGaWqFvgeZlYBaXDZMGNlQ+McmB6E4I4e3HXilvVf MY13DjAvRjPpGl08g7ntESDkem+HGXHM3Db9 X-Google-Smtp-Source: ABdhPJz8QzwVmDU94RXHXuL0tr5ZoCElosvvYfRJJm1MsK3Uaxe+ZYWeF7EyouqFDJ6ucwKA7Z/14g== X-Received: by 2002:a17:90a:f309:: with SMTP id ca9mr1500742pjb.0.1599668091814; Wed, 09 Sep 2020 09:14:51 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id l123sm2506987pgl.24.2020.09.09.09.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 09:14:51 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 01/24] file-win32: Fix "locking" option Date: Thu, 10 Sep 2020 00:14:21 +0800 Message-Id: <20200909161430.1789-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200909161430.1789-1-luoyonggang@gmail.com> References: <20200909161430.1789-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 , Richard Henderson , Markus Armbruster , Max Reitz , Gerd Hoffmann , Wen Congyang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Li-Wen Hsu , Peter Lieven Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Kevin Wolf The intended behaviour was that locking=off/auto work and have no effect (to remain compatible with file-posix), whereas locking=on would return an error. Unfortunately, the code forgot to remove "locking" from the options QDict, so any attempt to use the option would fail. Replace the option parsing code for "locking" with something that is part of the raw_runtime_opts QemuOptsList (so it is properly removed from the QDict) and looks more like file-posix. Signed-off-by: Kevin Wolf Message-Id: <20200907092739.9988-1-kwolf@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/file-win32.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/block/file-win32.c b/block/file-win32.c index ab69bd811a..e2900c3a51 100644 --- a/block/file-win32.c +++ b/block/file-win32.c @@ -299,6 +299,11 @@ static QemuOptsList raw_runtime_opts = { .type = QEMU_OPT_STRING, .help = "host AIO implementation (threads, native)", }, + { + .name = "locking", + .type = QEMU_OPT_STRING, + .help = "file locking mode (on/off/auto, default: auto)", + }, { /* end of list */ } }, }; @@ -333,6 +338,7 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags, Error *local_err = NULL; const char *filename; bool use_aio; + OnOffAuto locking; int ret; s->type = FTYPE_FILE; @@ -343,10 +349,24 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags, goto fail; } - if (qdict_get_try_bool(options, "locking", false)) { + locking = qapi_enum_parse(&OnOffAuto_lookup, + qemu_opt_get(opts, "locking"), + ON_OFF_AUTO_AUTO, &local_err); + if (local_err) { + error_propagate(errp, local_err); + ret = -EINVAL; + goto fail; + } + switch (locking) { + case ON_OFF_AUTO_ON: error_setg(errp, "locking=on is not supported on Windows"); ret = -EINVAL; goto fail; + case ON_OFF_AUTO_OFF: + case ON_OFF_AUTO_AUTO: + break; + default: + g_assert_not_reached(); } filename = qemu_opt_get(opts, "filename"); From patchwork Wed Sep 9 16:14:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11765749 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B0511138E for ; Wed, 9 Sep 2020 16:19:07 +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 79994207DE for ; Wed, 9 Sep 2020 16:19:07 +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="aGXhSXdy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79994207DE 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:50764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG2oM-0006eF-6L for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Sep 2020 12:19:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG2kO-00008v-NI; Wed, 09 Sep 2020 12:15:00 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:45992) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG2kN-0006Uo-0S; Wed, 09 Sep 2020 12:15:00 -0400 Received: by mail-pg1-x544.google.com with SMTP id 67so2395260pgd.12; Wed, 09 Sep 2020 09:14:58 -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=aGXhSXdyUpsGF1CGQcxlUq5WdzHX26mUdzXTKieMrOOdRDloppsvwv81FmbcijWp/c iIGQs2jVbYitSafSCgU6kmnbmQzMVYIiv2/GWMzpjdfb6UjqT1Ge8TlwsCwoXpw6IHRR rXo5qDYqT6tJ+KLzE7uPwqEXwgjfp6w8sSOtccS+j3nbgk5vFpm5LMV9sQ0R9fBoTaB3 IQ/Srjzz1abdsoNcLqRlqPaXLuR6ERKKsTNpg9CUkbQayLkp4fO4xaSOa+nFoms4E8+/ hcPK2nBkKZePSBVzGFsdbhmNO/S+gCESaOiL76C2KTD5L8FtQ8IuS/3MszVI11ce8cr0 9yOQ== 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=Apru4JnfNnpsLOWIgmpDh/dbi5jzOI7X1LK2odAmzlB+5fcd+FuF0EbYn8B5Zk/QxT PFdy+f08j2zi9pPQdAICB7n333gZqL3T8WkQO+Tfe0Bg7mHpE9JYTqSQppcoHIhDRUS3 3DbZDLyrnb29u2ie2un1Dl5VUsNcGtsVtU5Zs7w3gObFFI7FoZwM48kwNV/VFEaG8Vsb SeF1cDWfWi/vB+3HW2pZPzATWnV7jofhTYYxn93SNR9aa4sJPh/EQ+rVYwXxCs7vKsIk OVUASu6/A9ORF93sWX3KlPmn9ZpJuc8XN2W+/9XqBMTLiknBELlsDq0QIxwPQ0y43hof O7Tw== X-Gm-Message-State: AOAM532005gKBBEJzF/NSJ0fJnnb6jjAqqkXz0XNdtDgHc0d3BofOJuA NSFa00xwo9kGFxuVV8AOGTcMyPGG8qij7/K9 X-Google-Smtp-Source: ABdhPJxggBi6puK1NUi7JuZMpNwm/zINgRzMPKjtAvWBAkuj/1dMLMtw4MD5ZQzL4OyUt2qYBvbuxg== X-Received: by 2002:a17:902:c392:: with SMTP id g18mr1523227plg.41.1599668096852; Wed, 09 Sep 2020 09:14:56 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id l123sm2506987pgl.24.2020.09.09.09.14.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 09:14:55 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 02/24] rcu: Implement drain_call_rcu Date: Thu, 10 Sep 2020 00:14:22 +0800 Message-Id: <20200909161430.1789-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200909161430.1789-1-luoyonggang@gmail.com> References: <20200909161430.1789-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 , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Hajnoczi , Stefan Weil , Xie Changlong , Richard Henderson , Markus Armbruster , Max Reitz , Gerd Hoffmann , Stefan Hajnoczi , Wen Congyang , Maxim Levitsky , Li-Wen Hsu , Peter Lieven Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.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 Wed Sep 9 16:14:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11765747 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E998E618 for ; Wed, 9 Sep 2020 16:18:04 +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 AF224206A2 for ; Wed, 9 Sep 2020 16:18:04 +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="vE/bfbdj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF224206A2 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:47524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG2nL-0005IT-N0 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Sep 2020 12:18:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG2kT-0000GQ-1g; Wed, 09 Sep 2020 12:15:05 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:40572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG2kR-0006Vd-8c; Wed, 09 Sep 2020 12:15:04 -0400 Received: by mail-pj1-x1044.google.com with SMTP id gf14so1585430pjb.5; Wed, 09 Sep 2020 09:15:02 -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=/Q/d/vfX2r5ok5sWGBwNZjHxKJu0oUaT5gHBOiJ10fI=; b=vE/bfbdjP5SHyibm8NcSNfCaIfqKFJf7SLaN57JH9LLIW1r+R3vtjsITuqQIRflcwe g/+fVQeaRJPiOBPMYeYAP0d0shU7HxM7D+jmCjA98LGpe3HU4YT/p8M0Xe3cvhYwW8FO TcXLuergIDKmI5YkneYYelIIuoAg+DDlXTUrYdT2EZNOMhdpIO6JUilPV4juI9EwBcWI Vba5n7P8GdI+sWGsbKfIFeI8HbnlP93CPtdXe8i6NBNpr3fX0mCXoycWDBsmV4FH6qds 2FnyAoojT3ciwwfLLPOKHJRTIXECuZZT1vk6Vx2RUIJgK3KmtldJ5Z89R0x8GQ4c/Ywk M5DQ== 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=/Q/d/vfX2r5ok5sWGBwNZjHxKJu0oUaT5gHBOiJ10fI=; b=Gejlod+gt4IFB617ctDrTtTVWzqkxnRm0veCPb45AheFXrxpN/8sFQ2IJSwZCJoPEi qyyk8bxXQsu0E42XMrHTyVWX0C9tBxkUcx96Z4KtKXva7ZxecKqIk7OWx5YQlQ3u6oqo 6UoUbjKz1ZvnF/JW3uZ1Aa5KmYB1e0+eGqpVwbhnDnohn2VrHsADHWY9fsW/MrXAGoHz qYuAxQztRAhHmDFUOiB/Oup0zsjwNipvXYBIzrYCKvu3NjCZBJ610gOlvGP9Cl12yD++ 17PKYxOc85Sg5aqIk7v+IofixoIWIfJAln7ryMmWbaQ7p2SYMNuA+U3goS8FcgWi1V3l 6dig== X-Gm-Message-State: AOAM5331o/OSnAQACUwZSLdGZyvdKwUAWAK0jV5XCtUt35WFQUKYT/eH 5qounVzVOBjkavqsNxC/STIcCbs57Vr+sNWE X-Google-Smtp-Source: ABdhPJy9FKq24HXe4r1sRYjjSovItWKr55VhO0tGrgXqzIETisEUW67sNTY90G8psD0+qeTvbWWY6A== X-Received: by 2002:a17:90a:120f:: with SMTP id f15mr1469763pja.120.1599668101027; Wed, 09 Sep 2020 09:15:01 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id l123sm2506987pgl.24.2020.09.09.09.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 09:15:00 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 04/24] ci: fixes msys2 build by upgrading capstone to 4.0.2 Date: Thu, 10 Sep 2020 00:14:23 +0800 Message-Id: <20200909161430.1789-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200909161430.1789-1-luoyonggang@gmail.com> References: <20200909161430.1789-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 , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Li-Wen Hsu , Peter Lieven Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.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 4231d56bcc..f4f8bc3756 100755 --- a/configure +++ b/configure @@ -5156,7 +5156,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 Wed Sep 9 16:14:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11765751 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BDD1138E for ; Wed, 9 Sep 2020 16:20:04 +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 85BE9207DE for ; Wed, 9 Sep 2020 16:20:03 +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="mEc05Jas" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85BE9207DE 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:53438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG2pG-0007qN-KA for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Sep 2020 12:20:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG2kY-0000Qn-D2; Wed, 09 Sep 2020 12:15:10 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:35297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG2kV-0006Xg-F1; Wed, 09 Sep 2020 12:15:10 -0400 Received: by mail-pg1-x543.google.com with SMTP id g29so2435001pgl.2; Wed, 09 Sep 2020 09:15:06 -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=TsNOy56cT/aZuPzlGfi9G8/JBTKitoxne2lgskAEKvc=; b=mEc05JasyK7ebruCxoDW6cCOc1ZSB+FYd9tmP0TXruyXBot/3/5BHbOyYoosymhu3n o4vQ/n7F/fxgKDtQBy3cquTLtU8HjnF/27PQOzf9s79I3arHCxP4YPLhafwtgGcoe2TE Z+Qpw59mxLGA9FSIvP+UXGdDjI6T/n8QzKEeKwq9Y9b3ToQyQIkjJmVifxEdIA3CqOL6 V6tn0/6ZyX6MW72lRf9ppyL6xZ1hTGl1qWugXxGqwg5GT+PJRngnP9mF1EkXQ1TkmXhb IemSN8nk0f34Na2kAXlaOUVmjU/r4vzQqd7YZ8ndidMva6cj2o0z+KaoZTnO727J8G+w FweQ== 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=TsNOy56cT/aZuPzlGfi9G8/JBTKitoxne2lgskAEKvc=; b=CmSA3DyLYCSD0shtNfIrBTnEF9LxNZqknKpXurDSLnJqtFjNshVpX+pznnEWbqStXN U+kp8CekWeYGiC+U1clqO8X/KQ7bCKFidobz5yrW+Yza+MxQc4q5D3kiI8zNVA+HTNvW P8Z2ro+FYluiNcSJC2pQtbK0FYCaXGN0+78tJ5N5s6bWHWGYQZ0bRG+mkAazDoGz7cj3 fW2q/1noSglQa9wysODuOjHwUOrXW/i4LKgluWS6+bhcUVNSeo9lIN1NPlXlyPHOaFYq BgG2kKNxUhcU0632BRNrRa27Yu67V9tFB2JUBZmTb/6SYX5qGFXdaTwsJWKuWJfGdVwa WOYQ== X-Gm-Message-State: AOAM530HOGIb01tJrcgi5/2Q3aAmPahTIFHxijRuDGDOUhfJEF3pmHUH /ZlnJT3gUpXUdWPFZWGqnRjJKH+v/qMTVAj6 X-Google-Smtp-Source: ABdhPJyvSC92Nsvmi9eRnPmhWohK/EVt6KrVNqFTvVkNsRpOLzoqsmOPwZF+5cKfgW+whCsRga8YnQ== X-Received: by 2002:a62:878f:: with SMTP id i137mr1379096pfe.24.1599668105248; Wed, 09 Sep 2020 09:15:05 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id l123sm2506987pgl.24.2020.09.09.09.15.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 09:15:04 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 05/24] configure: Fixes ncursesw detection under msys2/mingw and enable curses Date: Thu, 10 Sep 2020 00:14:24 +0800 Message-Id: <20200909161430.1789-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200909161430.1789-1-luoyonggang@gmail.com> References: <20200909161430.1789-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::543; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x543.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 , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Li-Wen Hsu , Peter Lieven Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.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 f4f8bc3756..b21843fdb9 100755 --- a/configure +++ b/configure @@ -3653,35 +3653,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 Wed Sep 9 16:14:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11765753 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8687C138E for ; Wed, 9 Sep 2020 16:21:33 +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 307AE206B8 for ; Wed, 9 Sep 2020 16:21: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="piSh5Kbp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 307AE206B8 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:57190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG2qi-00017Q-6u for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Sep 2020 12:21:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG2kc-0000Tn-9c; Wed, 09 Sep 2020 12:15:14 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:43112) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG2kZ-0006Xv-Eq; Wed, 09 Sep 2020 12:15:14 -0400 Received: by mail-pg1-x544.google.com with SMTP id t14so2397178pgl.10; Wed, 09 Sep 2020 09:15:10 -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=54KjmFONhFVNbISF0ZvZ1gRQPHqntcxYT0Rta8IUzTM=; b=piSh5KbpD1x2J1DkSczYFo4OMWi56M4GcQDTUrDNSo9O0A5t3ga4ca+LhMGJw8nTQJ Ke+hvwy8f2EiakyOVsj1QeIdVYVYtJBWF61Yv59KS79k2svWbZPgDP+0Q88crw13rlOD ZfTSY1IHbyI08JKzvGc0+r2bx/iyVtx11d88TBqNw09SWyu4JNJh9vy+hBxLzIahzH1r vIVA4UmLf1fGyrxhSOzy8PbRII5qmSgwe6sRcghgV2LO8PTylRDNC9QzJSKL+9Uf4hrJ tn9ozOom4xoq1CeCmFl1XNqCl8NRSM7hYBRgCpjs7SE0rTdz7Ausj53nnJPuGeec4s7u IuGg== 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=54KjmFONhFVNbISF0ZvZ1gRQPHqntcxYT0Rta8IUzTM=; b=nG0t0eG9kE6z6/ckItW6v1rZl3b3jv/p7bvoqJl9h3ecl+8T8lScjOjneURcAUEbOr CTQgWS/m57NViTgCOHYABnKxi+HGkCvZ7XNWqV8+88ERG4FJKLgVUGBOLWkcwEpR0mNC hYZkBw3/18WzOUQvagLuqdF7kyGfS0Cb2T/Om/vIUA42aawI8NEkDqphjClRAZQiwTm2 QKonVZFORrYr8vOWGOUSFp/ybpVWI+rk2lSP+X5Ve8gVO9Ck6aT/uqD6bRVuOw/6W97r OvzQ3Bv5Rr0LKWi6F4GDybi3vk+LMuNFWkcsb0aQFWARnnbwa60v4McLBLC4PuFkVqhp fc7Q== X-Gm-Message-State: AOAM5321ZVnBlBEJbJoYNuCTXqpLjSYzQ8K12oxDsFvLpiJzR3b/Y+Lw z06nwX7WOlHU3dyfcqYhZ1LGSf/gJ3/G/Qtk X-Google-Smtp-Source: ABdhPJwC0CVLbnsJ5Hz5iWcbUBnnJKeLskm+xwuc9Xv0BTTZscty7FlfP0a6PqCHlbrwfdC9U7k4Zw== X-Received: by 2002:a62:7ad0:0:b029:13e:d13d:a08f with SMTP id v199-20020a627ad00000b029013ed13da08fmr1521357pfc.38.1599668109376; Wed, 09 Sep 2020 09:15:09 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id l123sm2506987pgl.24.2020.09.09.09.15.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 09:15:08 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 06/24] win32: Simplify gmtime_r detection direct base on _POSIX_THREAD_SAFE_FUNCTIONS. Date: Thu, 10 Sep 2020 00:14:25 +0800 Message-Id: <20200909161430.1789-6-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200909161430.1789-1-luoyonggang@gmail.com> References: <20200909161430.1789-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 , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Li-Wen Hsu , Peter Lieven Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.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 b21843fdb9..af86ba1db3 100755 --- a/configure +++ b/configure @@ -2495,37 +2495,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 @@ -7087,9 +7056,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 Wed Sep 9 16:14:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11765743 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33834138E for ; Wed, 9 Sep 2020 16:16:33 +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 C58C1207DE for ; Wed, 9 Sep 2020 16:16:32 +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="dHDrZhyc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C58C1207DE 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:41248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG2lr-0002jX-P1 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Sep 2020 12:16:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG2kh-0000eV-Hw; Wed, 09 Sep 2020 12:15:19 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:33358) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG2kg-0006YP-11; Wed, 09 Sep 2020 12:15:19 -0400 Received: by mail-pf1-x443.google.com with SMTP id c196so2717700pfc.0; Wed, 09 Sep 2020 09:15:15 -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=d4V5+f7th16w4eXVSrbBNtRXwx9t+794yZg73jLRtbY=; b=dHDrZhyc2nSb+EmbIXGGyf2KKRrhM7W/UvO8vF/vrmRb4BXULz8ooGOh3yRIhYAMLQ d5zy4U2QfhrOvPmfqLehiXtXTJ9d7HIFAYzGIJ/1iLdAmaP91M8bkvcfbHnJkgc5KcLr AhjXaCDe0cGh+MsIAdXOjrJBozSgi5z5VovjVCCwq263yRAE18dXRCmiDo/SMGkjEH/D UuxiRmhbmXnZR8SFyoVVJFDeWPjgij0N6QjS5GTiTLSEhu72YZA2A5IxJV1fP/vQkoUX jZRgdSTxYw+TUbUlhVV0SzsdDTA82TfCgv8NSBm/Z3/6Rwi0cLc0TliCvjnJVOageZRH 9rlA== 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=d4V5+f7th16w4eXVSrbBNtRXwx9t+794yZg73jLRtbY=; b=cYPLpRF09PZuK2F0usIN7sKPwnXpgCwsXWONGq/RhjkyVvchpEFIMitmqEYCnJVckS xlejgOfBhvZZRAQUnI5s5EdxN6WOpMZgH/sHi3G9ufE0BOViyENoz1JPK5zzXjJIbJwY bneuxvWnoWV7h4JXc2dhcxom8ZATI8TkTNCJgWu5e+UccY+5C/kgd+xbnI0oJRH53c8o O+gIG254ivyq/4N/gAzUxnjRa8rkgj0bRvUmN2azcIZR7qpOeDmVH5q9w5b3+ve5s9wJ 8ZiNXZUc/pP04+m3x26lyxUx6LluLhOdX+16GcvsT+PierXEwXuWjMyb0/JrbaWQJLQg LBlA== X-Gm-Message-State: AOAM533x47/p1OIn6d+dd3v4VeeaSHP+okkCs9IYrhvCYvNVPyjFqszJ Y5Vr8VOvVoT9TvDb/qmyU7ZJVbvPgYX0JHjE X-Google-Smtp-Source: ABdhPJxu88nvOjsGhrj7bsD3z1oRFWIPGVY7sRDk94a/jFfeJ+eFmKgYezLrYJQYKI8AHhNOtc6fCw== X-Received: by 2002:a17:902:ed13:b029:d0:89f1:9e32 with SMTP id b19-20020a170902ed13b02900d089f19e32mr1665723pld.14.1599668114380; Wed, 09 Sep 2020 09:15:14 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id l123sm2506987pgl.24.2020.09.09.09.15.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 09:15:13 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 15/24] vmstate: Fixes test-vmstate.c on msys2/mingw Date: Thu, 10 Sep 2020 00:14:26 +0800 Message-Id: <20200909161430.1789-7-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200909161430.1789-1-luoyonggang@gmail.com> References: <20200909161430.1789-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 , Thomas Huth , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , =?utf-8?q?Daniel_P_=2E_Berrang?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Li-Wen Hsu , Peter Lieven Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.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 f8de709a0b..fc38e93d29 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; @@ -1487,6 +1486,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 Wed Sep 9 16:14:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11765763 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67A2E618 for ; Wed, 9 Sep 2020 16:25:31 +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 F3258206B8 for ; Wed, 9 Sep 2020 16:25:30 +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="gzDKsv96" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3258206B8 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:41524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG2uX-000718-QV for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Sep 2020 12:25:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG2kn-0000ts-5h; Wed, 09 Sep 2020 12:15:25 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:36273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG2ki-0006Z3-TP; Wed, 09 Sep 2020 12:15:24 -0400 Received: by mail-pg1-x543.google.com with SMTP id f2so391579pgd.3; Wed, 09 Sep 2020 09:15: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=70Ma0bsMS+N8kUAgscN+dsueAkfzxvTL6r3jLhB2wcc=; b=gzDKsv96W98DCLHiTa8wexBvyAf5dt8uIgT51iunKVNjFjhF0iN9tYEgEMe1WBwS6r Wrw7OqIW2cmL6miMqmOgC+I3Xo6Tqjo99J6CTw/PzBiAAtaN3yS1KkoquLXOGEbXKWtT xpu9wAoH3no+xQPQrE20PdSj32dogp1Q3VDN7knHiYVM5FsM5F58Ld5BKUTK1zo6ldgl zKzvxBn28KSsx9KVo8Yo6ZUn0L5ez5uVHP9GeA4ZLhuImTjI5RG8uawY45ZRPW8WIVbX YNvq5EkbH8x4lRrH5Z807n2fePs6juozBUsrw2HwjHTfVYnKvCQ8Jaby+ntIDxUMPtVN D/1A== 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=70Ma0bsMS+N8kUAgscN+dsueAkfzxvTL6r3jLhB2wcc=; b=BaoJbHnHhUa/jM0qqwFcPffVmKEiGqpYapEUt70sg8yqqNWBBmMbNotevfuSwO+2eI aufdmpdYFihwmKMribkWm90jBC64+3JlknXs7sxvYIq8fuK2mFgfaiI4jKnSdByG2Zgi GoYiIchHbab+10yZ9UwDlZdkEygvP8O2qsQdVMUWa9ANrFSsXBnIc94qDf2pe6F55oSC 9KgjOjM9UfFuVSrTJvAsj+0JJRqnzwEr5JWS9xYR2B3OfZPodQ+Rf8u1wmZM88AxlXTb MnYdxXGCCaOv8H6lc7Ek6qKMqiFGoUddfCudfKg9+rJV8xlXDlbNTV4dvr89p1lRaojM FdRg== X-Gm-Message-State: AOAM532LXvMOA+VZaYYa3FHQlyjKNDtXEeuDVJO9N/EqkDuJBU4kvAT4 QcmQQeX2d2WJ9n384L/5v7+iFkCBlwkVtKre X-Google-Smtp-Source: ABdhPJznUgOE0uOHj1YLR9RiZSgjzZnZfdG3Jcr2+ZdRoALr5r2xd0uLsP6C7aQCEWd1ZFEUWsTYGQ== X-Received: by 2002:a62:1ec1:0:b029:13e:d13d:a102 with SMTP id e184-20020a621ec10000b029013ed13da102mr1546854pfe.30.1599668118699; Wed, 09 Sep 2020 09:15:18 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id l123sm2506987pgl.24.2020.09.09.09.15.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 09:15:17 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 16/24] cirrus: Building freebsd in a single short Date: Thu, 10 Sep 2020 00:14:27 +0800 Message-Id: <20200909161430.1789-8-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200909161430.1789-1-luoyonggang@gmail.com> References: <20200909161430.1789-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::543; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x543.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 , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , =?utf-8?q?Daniel_P_=2E_Berrang?= =?utf-8?q?=C3=A9?= , Li-Wen Hsu , Peter Lieven Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.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é --- .cirrus.yml | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 3dd9fcff7f..a18971aac4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,40 +1,21 @@ 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; } + - ../configure --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; } - - gmake -j$(sysctl -n hw.ncpu) - - gmake -j$(sysctl -n hw.ncpu) check + - gmake check macos_task: osx_instance: From patchwork Wed Sep 9 16:14:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11765765 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10C78138E for ; Wed, 9 Sep 2020 16:26: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 A33DD206B8 for ; Wed, 9 Sep 2020 16:26:50 +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="sbRbtlaC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A33DD206B8 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:47610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG2vp-00017g-FT for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Sep 2020 12:26:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG2ko-0000x9-Kk; Wed, 09 Sep 2020 12:15:26 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:45998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG2km-0006Zh-W1; Wed, 09 Sep 2020 12:15:26 -0400 Received: by mail-pg1-x542.google.com with SMTP id 67so2396115pgd.12; Wed, 09 Sep 2020 09:15: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=raGFyZs6MR9nEefX4kmRsgZPLq8a4zwcDe8/ve9JX8Y=; b=sbRbtlaC8V+J7gkP7RD1yBChXlM3bVCRP4BKOOluninVSoO+cU4/samT5d+oNdkNZ4 Ul3t8S4ZQn7gKdXKZiaIasaafH2LWziicdD6qx+nDSSfj9RyTak5T8HLCIMujL6IM/G1 /TAqLLeylIQJ06Qklt38B7w8em8U4sp6q5LGkYZftqCov0hVz/SjXo82kQQ9gmNv+0Nc R2WhykrC353sAADOAawL8PBhqiXvBUHDJVrO7PkJ3DEiET1t54L1HJ63WFWzdtBPff7B Ix5X783fPo2iiqL5zewlYVsjxL7AZdXelS6OF+SZTY8hMkCjsVVgiAYBYhWzeBd2vFcS J6Tw== 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=axDolAPB4DGKWBWTUpZrQhE7nVAv9IBQbbX0p1s+dFtrnZ8VnxAv0IsjFfADPmGfB8 zxR6bZy/yss6KwudcEu0goz9PObFDeVkkjsSdY1DB2S8lbCB3B5wMTyaJTEp8dRKnZ5k UpxW+pQ+tXQ+SUg4y012o3hcTtv2DGeI0kwigWuTJORGlnVnkoCv+xCHF33AfW74PPw2 bhcOExuguqw0NPzs4KkFZBmZBu7lhpMoVSU/SWBcTzzKY2VAyoUhyMmQCZaLVzO5VQtV ihirithZEh66v7tvZDUPR+0kLXtFRMnftT09mwYEcr4IjcCd85yL+z89ykwlGaezgZtI hD6A== X-Gm-Message-State: AOAM530gRE7qeBuTmXmv4l/Bb8zPskFNmBhJwmKHJKDNs45qmybXvaE1 2GMcWW68MKCrUom2LNb/Ba2gbdbPuXimFMt9 X-Google-Smtp-Source: ABdhPJwNlnJLY1KwcVC1MfOp5lnoLVVC+0oYUlZVJkHxCELpSwAc1w/RtTvL7m9Va6zZHsAESiJGHw== X-Received: by 2002:a17:902:fe08:: with SMTP id g8mr1540271plj.122.1599668122859; Wed, 09 Sep 2020 09:15:22 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id l123sm2506987pgl.24.2020.09.09.09.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 09:15:22 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 20/24] tests: Fixes test-io-channel-file by mask only owner file state mask bits Date: Thu, 10 Sep 2020 00:14:28 +0800 Message-Id: <20200909161430.1789-9-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200909161430.1789-1-luoyonggang@gmail.com> References: <20200909161430.1789-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::542; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x542.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 , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Li-Wen Hsu , Peter Lieven Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.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 Wed Sep 9 16:14:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11765769 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B851618 for ; Wed, 9 Sep 2020 16:28:16 +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 3A752206B8 for ; Wed, 9 Sep 2020 16:28:16 +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="pOQfpnUa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A752206B8 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:53534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG2xD-0003lQ-83 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Sep 2020 12:28:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG2ku-00014h-A7; Wed, 09 Sep 2020 12:15:33 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:40982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG2ks-0006b7-Eh; Wed, 09 Sep 2020 12:15:31 -0400 Received: by mail-pg1-x544.google.com with SMTP id w186so2409562pgb.8; Wed, 09 Sep 2020 09:15:28 -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=pOQfpnUaT0JUADrVOuZkK6LqiZKxqNLzQuRPrGVIbXB+q4V0VBnC22pQKUqmEqO5vC l5EqhDYvCdh1irGlC6l+kpm94Ap104vt0/ZNDnJXdMLQbKuEh5lRhfCer0avfWF871Qb l6bgbDzLPVSy7NgLyYA9qfLFzB0j8YILGvRmEKpy2T+6NZ8j4wr4JtJdc3tMtqQElWGk DjdTUPMI44WK0AwJ+7I8zj0UcsiRN/fM04rRBjy9Xs6a4isDIh4ra2CDNGjuXh0tjAIu mDwxMwZpgyLyMIBtiTP9qfksGdhH9jOmnaox/vyB5+Fj21xaBtrUxMs71lil1UORlLZU 6PYQ== 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=bDHwBDi/gr4qDDqgb+F5Io9d8E5TbVmfkdP5dwnBB6X54hXB1FVi2XZcjEqaJqEnga wJT/sNetaiSGWNEA68LvFb7Cu5lBTQNsTJmhKDvorGLG1Uq2yui4wF25LOAovhalW1aO bnW5rEm7mE2XjIT2M9CXyy0zcj/kPGwzkf8QO6/Wq5tX45MjygA6PLQUPexPC3Tqh395 QZqbUT/J3jOPJ5NMAwQ1RZfLNv5vlgSJQLFkZ4g0Snq/piWT3AHnMwyUg1447D9Ad+Pr VyB88bHH9aKO+FXAB26PCPeOyL4m+rzqaGpFqz015iSbJjZlNgaWvP0AtGNA3pUdR2NO ERrQ== X-Gm-Message-State: AOAM5327dcWX16o8SGR4LcchhAR1vFajW8OxNFMYxmKFa8UKaShpmmkX loDs5RXzwL8kzApzoeb/gytrRIh+xf/zEHb1 X-Google-Smtp-Source: ABdhPJyqNUf+PAfP+iMfYK413WTlPUign2NjCC1ICIn39tCtnhWsztOFn8EqohwhsgSIGiZEMFBqwg== X-Received: by 2002:aa7:9115:: with SMTP id 21mr1443026pfh.158.1599668127025; Wed, 09 Sep 2020 09:15:27 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id l123sm2506987pgl.24.2020.09.09.09.15.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 09:15:26 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 23/24] rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full Date: Thu, 10 Sep 2020 00:14:29 +0800 Message-Id: <20200909161430.1789-10-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200909161430.1789-1-luoyonggang@gmail.com> References: <20200909161430.1789-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 , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Li-Wen Hsu , Peter Lieven Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.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 Wed Sep 9 16:14:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11765771 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1499C618 for ; Wed, 9 Sep 2020 16:29:31 +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 AC1EF206B8 for ; Wed, 9 Sep 2020 16:29:30 +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="tBFzAM1M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC1EF206B8 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:57888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG2yP-000635-OV for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Sep 2020 12:29:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG2ky-00015b-3T; Wed, 09 Sep 2020 12:15:37 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:40352) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG2kv-0006dg-HC; Wed, 09 Sep 2020 12:15:35 -0400 Received: by mail-pf1-x441.google.com with SMTP id x123so2580226pfc.7; Wed, 09 Sep 2020 09:15:32 -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=3P5Y7jpFx1Yl0p+ItkTNk+NDL4lE8BqiE6M7PKk1GHM=; b=tBFzAM1MBZ2zieyL6Pq4KVjfEHw0ABnBsqxcPftcePmlgyMwkvL6VnL9uhZjKmaXdX /UoWb93Xu7GP23jYGLOOShCOFUtEShwBr9yGPXvgMSEEYRlrMUUdLk3dPH2kIeUakFpZ TiipBp+iOhsXeFgUIlvOUmzciq3VzI+cY2kCoi2FSBIfdudyoWrnxenQnDQAmgl9Effz KFAyKZ4ypjHsPxDSFFQM4FnRXU3l9ihD8o8r9LyaIULQhyXScA7ULZjKF9JMIZUsrFBd Dk+S4I00zk5aZ1z0hKfvezJGxY9YT4b0q6xC4NabBmG6muFUE9uAGvaMDCknitWq7tMd ZRiw== 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=3P5Y7jpFx1Yl0p+ItkTNk+NDL4lE8BqiE6M7PKk1GHM=; b=DsvSKAG6enFETwgHEpSVhuedmwiQUSSuBpTnpxyNe3LRde8y6Ns5MpeRw9+LNX4Wuz yLdeWOXMdbS1IqJR9edCNkwyH4nsqyGcOljVpSMQ4uyEnnVJPBFjbquqAfYW0ptc15gh aVV8Dij2R2mk+hi3zEu3ioWvMMB7zOIyQARaHfzEPcN61wsVe1hn2uSdAlAVhyfmQ1nw H2LUnXDAPVe/iOriwErcUVtBBiILdMgfglUoTBlpIMYKbUU9vJxn79mlPemj4lORtZ/x 1NxtNllDuzTyF2wek9AbypqHwPNF7l9ljKglgffSbiHPznk/e3KK6s4oWUkg9Hdv3l9X 1ZsA== X-Gm-Message-State: AOAM532ve2KO8NUgK37tDLKOBpRPwo9KB/j+vjAFoTmJu8L0rmhibDXp hdFdiQ3jE0QCEy6WQmcTaZ9uScuvG1VuKdYq X-Google-Smtp-Source: ABdhPJyyFHkoi41RmHqiqV9T9Zdro/cP4B2X4ReoZYMD5+WpUhWVGBntD5z9OIHvW7v3I+u/+wj0bQ== X-Received: by 2002:a62:8607:0:b029:13c:1611:6593 with SMTP id x7-20020a6286070000b029013c16116593mr1501547pfd.16.1599668131197; Wed, 09 Sep 2020 09:15:31 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id l123sm2506987pgl.24.2020.09.09.09.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 09:15:30 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 24/24] ci: Enable msys2 ci in cirrus Date: Thu, 10 Sep 2020 00:14:30 +0800 Message-Id: <20200909161430.1789-11-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200909161430.1789-1-luoyonggang@gmail.com> References: <20200909161430.1789-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 , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Li-Wen Hsu , Peter Lieven Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.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 --- .cirrus.yml | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index a18971aac4..f819d202db 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -44,3 +44,62 @@ 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 -Sy --noconfirm" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --needed --noconfirm -S 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-jemalloc + 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-capstone + 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-libnfs + 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: + - mkdir build + - cd build + - ../configure --python=python3 --enable-werror --ninja=ninja --disable-pie + - make -j$NUMBER_OF_PROCESSORS + - make check