From patchwork Thu Sep 10 10:30:36 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: 274069 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 F3F64C433E2 for ; Thu, 10 Sep 2020 10:34: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 6D9F220BED for ; Thu, 10 Sep 2020 10:34: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="VtHyrs6W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D9F220BED 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]:42448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGJuG-0002rq-Hd for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:34:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJrZ-0006h4-Hd; Thu, 10 Sep 2020 06:31:33 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:42794) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJrX-00034v-UY; Thu, 10 Sep 2020 06:31:33 -0400 Received: by mail-pg1-x544.google.com with SMTP id m5so4001872pgj.9; Thu, 10 Sep 2020 03:31:31 -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=VtHyrs6W59+ZMPKsMatHUlP5LUz4ht3SgEbKjtYNX5I0OHoH6qmNChGGR4vcdAPT2b e3LUETCafApG4e0EUeuEFPx1uIDXC+CZsrLUIxeDANqGln/QEcT0sanfQrP8RGJ1E2bJ kn1GPUdME+0dX9tmLdETylGWWN5/WpAXUaYnGdrp1MtT6jFR721OVwRrjyJ6wogY0F9Q dfUs6guIP4rZmVPnywCv7VuEEy9ETYJW97B473C8Hlb3ecSMTRMvQIsaUNsn5EFIrqoS 6+K5UYTZHB+6W1NYiIz5tGFKyI+Jb+sIkY0IpTqISmvy5zE7hnRX6TYdKeNBHG2V3Mxs BmQg== 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=Z95zR27xdN/lUz5H1dRt8AqkFnYidtNFuVCN8owdpG3Za6OevgxXja7MoiMdHflydp S81fjerbz5C7uCQ7pznGsOAEAVvyGSYUrsydCQyxaPWJzUnqkeV2rpWcigjqNqQ2UGkh EQ7bfvNMAsZeOiq/1BdzlQZ64/V6hvvsRaZMZOEieArMPniZ0VtkaU0H2Sg9phtZHBti HOvEnZ0+UjZK5rcYgXXjY+q4IpMtsTy6GuMHka0GjpjYDS7rQw4fS1Fiutc1A+k8t8sS bDM9PwoIw5MX69QvHVqSVRVSa1VfOKYihyK46hSRlU1NrftuD9YbmPC7TucbAlDLRL8v W/Yw== X-Gm-Message-State: AOAM533Ts8tFQV4u0sI8kHsQm3V3ZQa+MXWWZMbqp9vhuAIcWHT6F2Wc LG19KAPKTEdhworB4WyRSG55X5uzSD26JsbNpXs= X-Google-Smtp-Source: ABdhPJwlDMV6t16kMXnhqrgL5W2pVpRNuK1hp9ODmj2VUBdU4RTrvvaR+Ae9IVjtr+KqnrMBv5dHIQ== X-Received: by 2002:a05:6a00:2b1:: with SMTP id q17mr4723301pfs.74.1599733889567; Thu, 10 Sep 2020 03:31:29 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id g21sm2000203pfh.30.2020.09.10.03.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:31:28 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 02/25] rcu: Implement drain_call_rcu Date: Thu, 10 Sep 2020 18:30:36 +0800 Message-Id: <20200910103059.987-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103059.987-1-luoyonggang@gmail.com> References: <20200910103059.987-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 , 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 Thu Sep 10 10:30:37 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: 274070 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, 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 B7C48C43461 for ; Thu, 10 Sep 2020 10:32: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 3CC3720BED for ; Thu, 10 Sep 2020 10:32: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="Eo5uIaVc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CC3720BED 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]:35482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGJso-0008Sk-8z for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:32:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJrf-0006qv-Sy; Thu, 10 Sep 2020 06:31:40 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:38368) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJrd-00035T-WC; Thu, 10 Sep 2020 06:31:39 -0400 Received: by mail-pj1-x102e.google.com with SMTP id u3so2824365pjr.3; Thu, 10 Sep 2020 03:31: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=/w7rMoPRyhKUVrpbUOdbHX/Pq1woWbXw5jpZlifmP6A=; b=Eo5uIaVc5wULvc31tEOFRRP79bdD60QOEN6l7pgqcNIDeOqJ2tUGGt/cYPWltX6Y4/ ZD78DvtHbz5KPKWgXWxh1l1ZogUmGwzw7bAJ5X9+V3I2f/CDhwpFv8txQpBKkhrQpdsr VqwK7lSoqBFD+aFHaPcwLgcWifLPWi8boNTJo2EybTkLOCMi1jHh3NMGK7SnAiM8nj5h TZJWqIRJQP6w+6094qBpJgB/nsYwnaraNX6+dR82dydlWFasu1EafGYys2VWVpJN56Yd CONnxcF5eqlJ7OCRLpE1PFOTJk3tXw04tMAXfZpOOoQ/zSTI8pVU5oPkCDRhKFyWGGGY E6BA== 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=/w7rMoPRyhKUVrpbUOdbHX/Pq1woWbXw5jpZlifmP6A=; b=HYY00x5agqE2rVE10vWJIHNAv310W+WStnGcBs6kqka8ZyHBiAsnv0BelA/ZduQ/bD KUO+oeVT+5E2P/ahS/qDrKOJ3GfPwtzQMNOOLr+oAPi77Ka8r5Ix7lJndoEU7fOdf8lB 0bLp+mMW/CPq3Dg5ZEXOl42PDmb3ronp0/ulJ2HJyWgydErGvNfDdkj/f8zWxo1dgNll H999bmV9RRTOjR87kPfGX/mpZAaeGsTaraplVUZtzXeR3O+P7comTtHtO1qBNDB521f8 tL6B/jvjakntejr79jZz9tZegXqerZGRamS4kujUc8t98kikdQ60T/kvI8OEPvKJmSFn oXJQ== X-Gm-Message-State: AOAM531uielh3FTECUaRdHVA0WepbOZoi4JKtICMLy38N9HkpYzJuoNT ZPSU5HVt74QQQvD8Lef+xCHRR+ltA84+lLpJAB8= X-Google-Smtp-Source: ABdhPJwDee9G7F6jL1wTNWSi64CepyYbA4UZFrw44YKeLjLTY38YrbM7oIpjii365c1qTNErz64y2w== X-Received: by 2002:a17:902:ff12:: with SMTP id f18mr4779227plj.118.1599733895722; Thu, 10 Sep 2020 03:31:35 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id g21sm2000203pfh.30.2020.09.10.03.31.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:31:34 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 03/25] block: Fixes nfs compiling error on msys2/mingw Date: Thu, 10 Sep 2020 18:30:37 +0800 Message-Id: <20200910103059.987-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103059.987-1-luoyonggang@gmail.com> References: <20200910103059.987-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x102e.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, so we use consistence st_size instead. Signed-off-by: Yonggang Luo --- block/nfs.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/block/nfs.c b/block/nfs.c index 61a249a9fc..db6d8c2d2b 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,20 @@ 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) + return (st->st_size + 511) / 512; +#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 +563,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; @@ -729,7 +747,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,7 +764,7 @@ 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); } static int coroutine_fn @@ -778,7 +796,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 +818,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; From patchwork Thu Sep 10 10:30:41 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: 274068 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 DBFDFC433E2 for ; Thu, 10 Sep 2020 10:34:40 +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 5BBEF20BED for ; Thu, 10 Sep 2020 10:34:40 +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="GImV80jL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BBEF20BED 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]:44578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGJuZ-0003ka-Fs for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:34:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJs2-0007LY-CG; Thu, 10 Sep 2020 06:32:02 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:34345) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJs0-00036w-IU; Thu, 10 Sep 2020 06:32:02 -0400 Received: by mail-pf1-x443.google.com with SMTP id v196so4509088pfc.1; Thu, 10 Sep 2020 03:31:59 -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=GImV80jLHW3+a4KRC5pHEAmErZVwpIUDFMGKdVIyIAlynBGa+DeRvRdQs3+cTYBQBF BUOPAM59jIV+4rkLFPQ4tQZRwgEQ4yVUASkbv6TNYrU6Icta1RC1Oaj+F7thZjrFhrCj UBVU1mJpURyVc/eo/W2jNZXAG5EiBWlkaj/7GY+1mf6kWa0PpkAfZDEKmJa3vsj6fLo5 e2l4W5SrVN4Tl/VqXUqboOPXVwtN1WSjkF5oagitGs5BF8Huf2OJyPi4nBqP3h47Z8Tc RXqN9wCsXjsS2a7N+V/7Z6w2c53TWowGpDSGhgeMySgBV33MSIAruMlG0Ly22LBO12s4 RfLQ== 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=oGGR+r6zOLGYWeHDFwuYNnmxrJ/8cbIiGAzbGeHcyCi5knBLU4ZY2ZlTYhycmk5v7b xodjG+EWKO80CPfwRyTChGKElONGgWjnfGWerG1U3UOzMP4xBv77pUfNB1EzEtxwfwh8 m68f1Kq5FVtt1gaRZuT1mIjkHeTelMgYk4DnAqjcEixH9aA+Ssr/zGmGnwDwodoacZBs RgKFfE8Coi8vyOJF32tLggZPjnA731C1AAn4+mUIMTBCPiiDoripimuSDpVzuPuJ8G55 /NAqqODf59Tc8lR+z9LH38iHFJGb7rmIGJcWVD8TH39e201Yar3Qf0DHzJ5/FaYmvhZw t56Q== X-Gm-Message-State: AOAM530CzDZZufA6QKtjNvS0vt6Irk5UVNsfuDkXjbFONpvVG3fLPyDX 9CuiHO9ldzXvhmLfv8OY1f3UXZcyerglTDyMiDY= X-Google-Smtp-Source: ABdhPJxEUJCb1e1P147oBfSxHAQDknFLO1M7FrbLTh+ivuZG/N1poxId6349BAOixxgRsTfdUJamWA== X-Received: by 2002:a63:e741:: with SMTP id j1mr3983590pgk.422.1599733918321; Thu, 10 Sep 2020 03:31:58 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id g21sm2000203pfh.30.2020.09.10.03.31.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:31:57 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 07/25] curses: Fixes curses compiling errors. Date: Thu, 10 Sep 2020 18:30:41 +0800 Message-Id: <20200910103059.987-8-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103059.987-1-luoyonggang@gmail.com> References: <20200910103059.987-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 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 Thu Sep 10 10:30:42 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: 274067 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 779B5C43461 for ; Thu, 10 Sep 2020 10:36:25 +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 E94C020BED for ; Thu, 10 Sep 2020 10:36:24 +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="bdNnBtFD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E94C020BED 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]:51502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGJwF-0006ex-Um for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:36:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJs8-0007Yt-Dk; Thu, 10 Sep 2020 06:32:08 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:45642) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJs5-00037D-TT; Thu, 10 Sep 2020 06:32:08 -0400 Received: by mail-pf1-x42e.google.com with SMTP id k15so4356076pfc.12; Thu, 10 Sep 2020 03:32: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=bdNnBtFDVWdjlRHENK6jjHaF+G+jcto5aAcuI4OlKC5ArI63bJUf32zTbXzonU8Ur5 2W6L3DhOPx2qq3IFOpHu+NfnhLWUmL9Bw6EgKzsIWb0LqcEcLn+q711ufjE1BlOdKEru k8rqkdvrEa7EECoiDrumJKnagGb4u7SN34xKO0Ykuh4CJ6RqwqzMtfNeYgb+IB6QFy/H c2nevmXqjlNzCMxnzrDh2IUY61nsF24qBEPvUnyZqJCEz7IAF3LB/YzwmSF8+aGndbVu 70Gd69Nyqks689u2NQrIa1y86R9pOQmNyQ5s7E+bgetTh8UaHKIxJ74siiEQA1ZXUCHq K9PQ== 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=C57u/DVd9msUE7ndqqNPd+BRtSKZq95RyrmyBVbdnPvSWefZXU5RLAeKzlMTKCQJew DkdCsXmCpf4vIqMNPzSyVtaMp2ASWtHYKfQspH57zJ3F7uT9NOGEvlFH5D6rP6sV8iEC QRG+GwzIdTPPP8TDqBoJluw9CtWFmtAtD+phC2Cn6WTSitPk4OKy6sITmdlo4V1V78G2 +Z2kq6WIjgl3oi7go93kI15Xl/w1m4yUQP49QqcWI4Aat9yzxM9DFysz94qx/2qu1/Tp Zjz/0aIXC+pkzBo4fJzdiW/vZnYO/qHFXNutzU6M8opPRVNWb6HgEBaCt8u5S1hpX+2K GBsQ== X-Gm-Message-State: AOAM532Lq/cY4NsHkgNZQidppEBCLn28iiZqPjh4h/phJhHFBQDSb+ZT u8ORy81YoqsvksKHoeDW4jHNQelgfvAo/gjF/As= X-Google-Smtp-Source: ABdhPJzEhF71BGUAwfT+XmIx8le4mOr9jVPAwtPPh/a3U85SsTjqDxAtz71oALHwNRFHoV5rQxZT1w== X-Received: by 2002:a63:6647:: with SMTP id a68mr4058910pgc.450.1599733923691; Thu, 10 Sep 2020 03:32:03 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id g21sm2000203pfh.30.2020.09.10.03.31.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:32:02 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 08/25] tests: disable /char/stdio/* tests in test-char.c on win32 Date: Thu, 10 Sep 2020 18:30:42 +0800 Message-Id: <20200910103059.987-9-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103059.987-1-luoyonggang@gmail.com> References: <20200910103059.987-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x42e.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 Thu Sep 10 10:30:43 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: 274065 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 6EE5EC43461 for ; Thu, 10 Sep 2020 10:38: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 01DC320BED for ; Thu, 10 Sep 2020 10:37:59 +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="dS5bQc7X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01DC320BED 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]:59886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGJxm-0001do-QU for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:37:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJsD-0007gt-Ns; Thu, 10 Sep 2020 06:32:14 -0400 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:54987) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJsC-000397-3N; Thu, 10 Sep 2020 06:32:13 -0400 Received: by mail-pj1-x1043.google.com with SMTP id mm21so2805965pjb.4; Thu, 10 Sep 2020 03:32:11 -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=dS5bQc7X5RByKsqQdDo5kni3rKaRgoV8t3QhcDZqDlBWtElMizDvQwxfc1uCArxO4S kbX3PrNTXP4U2eAPZbv/gS+l0IiZx5QdIRZbXOMl25WIfDdCO5dhr2sbUDL1PpiDuBDv zXkre9Ga1bpugETwZthNm2z0xbLmY5sdT8RcW5NGpFiQqCCzthPhi2VlpKTZVkKPho9j xTTBa0+8ca38D8rX4hzOkPZWfs3CuFPw9SkglO9FUNz3GB1Es8Wv6XBHBhZvguyvZQBg U7yFhZuOw2u0SuUFiFm30QZ7I+ADEL6b2qYlSU0IDW00aBUJUWOY/uI7+IQCXBHHHhMM vL/g== 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=HGFejR8A13n6gXeGHTYdMscA3AJKK6dSiy61B1aJHLDbQDkkR/C+7dxQW8R/0n7158 HmUYuosJ+Hb6yQS5PTxD5tFXXI+K/Zz2wofUnpenh1/dPCOBtdzGI9vTrEfe3G+s5cwJ RdKw05PftNxGw7cpNer6OebIfrCIQcJJ8/vCUcMiIQlR4oFmGfH88l+zDEN48c3eUwV0 pQzPe+q7ucxLfNpJyEPxUYACFZv4ipP2L3YiEk9/cHm0HKKZ3sZz3jqDKyBu1f5i6OGB FW2RsmO7BoGrKxPTJU1JBAF/t2ihzoGAOhZT5Wg8WCBpx3HtXzfnnVzvPwPAcsByXuD1 ydkA== X-Gm-Message-State: AOAM53187TYUqsVY6lFQpxw9urSMIAcfZaIWGomdYQBRqCf6IIrnlSHG J4LCqg7BLMiceQzM5muXD9xSjj4psmMI6Q2uT0I= X-Google-Smtp-Source: ABdhPJxjscedJ89HNy27BZZKAWcgrtV40RPxHT5W1A+nDLhxCC1uCdrcpHtajvAIt9eqe4FrSya10w== X-Received: by 2002:a17:902:8544:: with SMTP id d4mr4764711plo.142.1599733929922; Thu, 10 Sep 2020 03:32:09 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id g21sm2000203pfh.30.2020.09.10.03.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:32:09 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 09/25] tests: Fixes test-replication.c on msys2/mingw. Date: Thu, 10 Sep 2020 18:30:43 +0800 Message-Id: <20200910103059.987-10-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103059.987-1-luoyonggang@gmail.com> References: <20200910103059.987-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 , =?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 Thu Sep 10 10:30:46 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: 274063 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 E552DC43461 for ; Thu, 10 Sep 2020 10:39:47 +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 6105020BED for ; Thu, 10 Sep 2020 10:39:47 +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="TubEjypg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6105020BED 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]:39938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGJzW-00055c-Hh for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:39:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJsX-0008H1-5t; Thu, 10 Sep 2020 06:32:33 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:32841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJsV-0003Az-Dx; Thu, 10 Sep 2020 06:32:32 -0400 Received: by mail-pf1-x42a.google.com with SMTP id c196so4518884pfc.0; Thu, 10 Sep 2020 03:32: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=ehfAiCRVE/Ke9S0rgpD+Y+SHCRLAE8fhmhSay0lCAzA=; b=TubEjypgVP1ZpTreKUhpalje4hQUsoLBJ9kkliJ+EvkOT7CX3ddV71IlOrtN/Z3I8G 3KAued7/3Dlgt+P2ttc0kPUdD/GY/nr3xaCAT1LjYR+W8Ga4Si88K/o4YVIImfm56BzD W3mVWRrck/AS3x5HVP5tUv96tyJVs1aMI+B1R3hOzPXCpGLkFgUq9RdEXGupGoM7+Nev PSFCfpIuWLuV2W4yeF+63/TjN0HpmYmz3XfF2OXxG4ZyCQ2aNOSF/CWoooU1gIXsp+Ot FhAo2DhBgbemty/Ia5878LcvtT4VsvGD+7rN5KS5K+A4qVnjfM5Enrs5njEBglQXi13h YQZA== 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=ehfAiCRVE/Ke9S0rgpD+Y+SHCRLAE8fhmhSay0lCAzA=; b=GdH+hhKNXDY8BCHXMxbf4UxJD9BP1fjx7XDk4w593sLe7HZPyKRx+ymREQtEe3WVtf KiRVgJ4VHBKppoL1wDNvIubUY+LbjC2GnIkPrE9A9FvhDGqS3re2ZoD1YYErT9RlaGv4 ej5EamVx/fbjGZsMACkDsVGnLlNNosxP+RzEzaQpUJAbIjiG4AOv87WN027lnXLjSsXU 1cvWyvZHi8R4Tz6wzsBW2Bb7HTum8DVY1kr0ihO5NaCwASRKQoIsPNlNxtrLJnc5p5p7 b7XYofaC0iyrVKoid/DhGyJbDEHRotR42D07asq+AYn9JPKsgZokELwjOelUtnkfsfqV xJFg== X-Gm-Message-State: AOAM532J/qL7j9lyI+GUXeHwqCEWskorHdFULNydYLxLcCsqI/+/6KH8 ij6GIZedmnjDqqA8FrI2+TixwuF6KnZTzovAYzo= X-Google-Smtp-Source: ABdhPJx5EnGH67dEhXSe62JaZYn0YUecOGkZxwJo0ZEZjwXYMLEBGLygOC0bPnU+9JBLVQrpB2sjBQ== X-Received: by 2002:a63:3046:: with SMTP id w67mr3881909pgw.45.1599733949294; Thu, 10 Sep 2020 03:32:29 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id g21sm2000203pfh.30.2020.09.10.03.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:32:28 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 12/25] meson: Use -b to ignore CR vs. CR-LF issues on Windows Date: Thu, 10 Sep 2020 18:30:46 +0800 Message-Id: <20200910103059.987-13-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103059.987-1-luoyonggang@gmail.com> References: <20200910103059.987-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x42a.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, a difference in line endings causes testsuite failures complaining that every single line in files such as 'tests/qapi-schemadoc-good.texi' is wrong. Fix it by adding -b to diff. 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 Thu Sep 10 10:30:47 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: 274066 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 985C2C43461 for ; Thu, 10 Sep 2020 10:37: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 2FD6F20BED for ; Thu, 10 Sep 2020 10:37: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="LWb5Pe1p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FD6F20BED 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]:54936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGJwp-00083L-6Q for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:36:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJsc-0008Tt-P8; Thu, 10 Sep 2020 06:32:38 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:51709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJsb-0003BP-6J; Thu, 10 Sep 2020 06:32:38 -0400 Received: by mail-pj1-x1044.google.com with SMTP id a9so2815667pjg.1; Thu, 10 Sep 2020 03:32:36 -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=xhCi83owLgwjlb0w3wUGwCtyacoQCjPoxSEDHHZwCrw=; b=LWb5Pe1pJ+r0dUIxnWKIZhfwXFhqL44NKgwnanVqOynYH4jNWM24dr7t40PuAOo8LU u12pwmXLYyozrKwAEZiL/QO+sEjjpgRTNqtzQGgh44S4ZodQ0uBNQmhKBgqOnTVEhoFT 4IPFDphhaivhtDTTl7AEDA2uHfXW2u0vO/jCt14Ld8PUEJ+xVe8Wd+Ixiza3x+5aUS2i VYdu/g/VXapaEOeaFyuTlpjf9WXunGv0omuQM+9cdryYNsWWDVifedBZcMtf/JL7N2ps E3YE3E5QKBG1JvigY/zisrf7yvKj5eHEFzJG+ou3EAksEgZySYY/HQqfCGJMn8ij8XGX D9PA== 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=xhCi83owLgwjlb0w3wUGwCtyacoQCjPoxSEDHHZwCrw=; b=OmTCd4Hjz/EL1PkW9Hv1DmZxn2XxaHeLEoE8GCXuVVonqU+KXD+3eV3N57xSf1NCTn S1MsU/bEY6CtUhvxC9r+sV02M8cRZFUIyyBI35PbUMrmCghnw4YYRPqVtinzu0QoMvLM w9R9pM8aEs5kulORuJiSyaG/pfhpQoNN5qb0PAX232XU/7cwxa6bQ2AvJ9ypN2l5YDKu SS5ke607JyqjYr1k+rPbKGF7U7hcH3bTief5NquFHSJ+LUXEhHzZCClaaTTT4equ8fvl VuFMJuCpeGVVov5ltjfqNd2JA4AJrVK8K9/aDacwWSFhVsau9T2RxEWCo5kEHPE1T+aO o3aA== X-Gm-Message-State: AOAM531ZXD64JZegsVjUUO/pNjafm4lzWFZQTIEZwUB96fGlGeYi3cvj s0RCDdV5AZFvdnsmMN0Bp+i0C5KxziulnQnHDZ0= X-Google-Smtp-Source: ABdhPJwOT5vqvzc37BCOal3KGHZFnu8rhDrCvqoIP5xqIWE+gJy3e6jqos49qTiO/2mW/t97JyHJow== X-Received: by 2002:a17:90a:d315:: with SMTP id p21mr4855106pju.88.1599733955030; Thu, 10 Sep 2020 03:32:35 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id g21sm2000203pfh.30.2020.09.10.03.32.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:32:34 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 13/25] gcrypt: test_tls_psk_init should write binary file instead text file. Date: Thu, 10 Sep 2020 18:30:47 +0800 Message-Id: <20200910103059.987-14-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103059.987-1-luoyonggang@gmail.com> References: <20200910103059.987-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" On windows, if open file with "w", it's will automatically convert "\n" to "\r\n" when writing to file. Convert unlink to use g_remove. Signed-off-by: Yonggang Luo --- tests/crypto-tls-psk-helpers.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/crypto-tls-psk-helpers.c b/tests/crypto-tls-psk-helpers.c index a8395477c3..58888d5537 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(); @@ -44,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 */ From patchwork Thu Sep 10 10:30:48 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: 274064 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 6139FC433E2 for ; Thu, 10 Sep 2020 10: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 AE5E820BED for ; Thu, 10 Sep 2020 10:38:59 +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="PCK6X7w5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE5E820BED 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]:35234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGJyk-0003B5-Mn for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:38:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJsk-0000MP-6D; Thu, 10 Sep 2020 06:32:46 -0400 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:35808) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJsh-0003CH-Ag; Thu, 10 Sep 2020 06:32:45 -0400 Received: by mail-pj1-x1042.google.com with SMTP id jw11so2836595pjb.0; Thu, 10 Sep 2020 03:32: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=jN/FbRrOzKPxrZWP0GTvRNcOCaMjteo1NEBJt6Bz3hk=; b=PCK6X7w5xngQtJEncd0M8kn58dG75wT7P+ACc7/9MLMIoCZO1rjcgvHKzTlurU8SR+ SMX9o2SZlmLDPuUWL7ANYE/qDndtCjKOkoEJwjSa93uYlAp6esxnqtKPvo5qaXBQ4J++ +fkUhWF5LrOlKIZJ43XfJzoRmo5SQr4ge7NWLi2FaCeUb8rQ18RE0ccDBs3Bp0MMXarA 23K2r2BgYSXlwRo8TzJCXdgua2VzTfrEnBaW13+H0+5mo+GJFqxkRh+TqfhHwut8VGtC K3JtalAENEBn93ih76gcmp0hx50HEzuAJ55QpAlFl/WiXvX7PQB+F63QGZPWvvSpLRdX mKNg== 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=jN/FbRrOzKPxrZWP0GTvRNcOCaMjteo1NEBJt6Bz3hk=; b=Fk4+4v0CbZ62soM+pZpCx+pQsstoGhpOfLoUnk1jeEpQq3sOFe1oLXtLe1c6/n1j9i rAdi/fuzpPtcO0dkk61MTS54oG2n37Hw2X9YZnEi+5iE168Z4QfaZK6zq4ENxZ4cTmxa bpWPYnMukyqR96s6wJysTJCNdAVxMAcznng2trYVE3iwz9UvfjOa5AQCg6N8CiH//RGE OhYlz8XLlRsnqxbQBrdZ6FvlBarPzSN6P8v6x+SUNXeG4Xy/CoM81A7f5ordL3i9BIxc TCntqFMbsldUwnQAcPL26slS56C0P1DSwU8h1a4ItxY4bEzr83nNn6z9vhPoHmmd1IKC 2FEw== X-Gm-Message-State: AOAM533HYGjB0f3XeREq3KvqkiHi9zn9dDiq8GI2B6J4z8zpro+Ni8GF UBQIXnMg/oz1IetPSkrSQie5A0lKdfp3N54BmM0= X-Google-Smtp-Source: ABdhPJweis2mdc9ISfHbJTzLhGN3DJLu3vgHczuf4G9FLbAdnfmUsd8Mvu4wghXRH1SNhM+dPRjD8g== X-Received: by 2002:a17:902:bcc2:: with SMTP id o2mr4881106pls.87.1599733960843; Thu, 10 Sep 2020 03:32:40 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id g21sm2000203pfh.30.2020.09.10.03.32.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:32:40 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 14/25] tests: Enable crypto tests under msys2/mingw Date: Thu, 10 Sep 2020 18:30:48 +0800 Message-Id: <20200910103059.987-15-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103059.987-1-luoyonggang@gmail.com> References: <20200910103059.987-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" Fixes following tests on msys2/mingw 'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', tasn1, crypto], 'test-crypto-tlssession': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c', tasn1, crypto], 'test-io-channel-tls': ['io-channel-helpers.c', 'crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', tasn1, io, crypto]} 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. Signed-off-by: Yonggang Luo --- tests/crypto-tls-x509-helpers.c | 169 ++++++++++++++++++++++++++++++- 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 ++++++---- 5 files changed, 266 insertions(+), 78 deletions(-) diff --git a/tests/crypto-tls-x509-helpers.c b/tests/crypto-tls-x509-helpers.c index 01b3daf358..c624d8799b 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,171 @@ 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) +{ +#ifdef _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 +} + +#ifdef _WIN32 + +static int __stream_socketpair(struct addrinfo* addr_info, int sock[2]){ + SOCKET listener, client, server; + int opt = 1; + + listener = server = client = INVALID_SOCKET; + listener = socket(addr_info->ai_family, addr_info->ai_socktype, addr_info->ai_protocol); + if (INVALID_SOCKET == listener) + goto fail; + + setsockopt(listener, SOL_SOCKET, SO_REUSEADDR,(const char*)&opt, sizeof(opt)); + + if(SOCKET_ERROR == bind(listener, addr_info->ai_addr, addr_info->ai_addrlen)) + goto fail; + + if (SOCKET_ERROR == getsockname(listener, addr_info->ai_addr, (int*)&addr_info->ai_addrlen)) + goto fail; + + if(SOCKET_ERROR == listen(listener, 5)) + goto fail; + + client = socket(addr_info->ai_family, addr_info->ai_socktype, addr_info->ai_protocol); + + if (INVALID_SOCKET == client) + goto fail; + + if (SOCKET_ERROR == connect(client,addr_info->ai_addr,addr_info->ai_addrlen)) + goto fail; + + server = accept(listener, 0, 0); + + if (INVALID_SOCKET == server) + goto fail; + + closesocket(listener); + + sock[0] = client; + sock[1] = server; + + return 0; +fail: + if(INVALID_SOCKET!=listener) + closesocket(listener); + if (INVALID_SOCKET!=client) + closesocket(client); + return -1; +} + +static int __dgram_socketpair(struct addrinfo* addr_info, int sock[2]) +{ + SOCKET client, server; + struct addrinfo addr, *result = NULL; + const char* address; + int opt = 1; + + server = client = INVALID_SOCKET; + + server = socket(addr_info->ai_family, addr_info->ai_socktype, addr_info->ai_protocol); + if (INVALID_SOCKET == server) + goto fail; + + setsockopt(server, SOL_SOCKET,SO_REUSEADDR, (const char*)&opt, sizeof(opt)); + + if(SOCKET_ERROR == bind(server, addr_info->ai_addr, addr_info->ai_addrlen)) + goto fail; + + if (SOCKET_ERROR == getsockname(server, addr_info->ai_addr, (int*)&addr_info->ai_addrlen)) + goto fail; + + client = socket(addr_info->ai_family, addr_info->ai_socktype, addr_info->ai_protocol); + if (INVALID_SOCKET == client) + goto fail; + + memset(&addr,0,sizeof(addr)); + addr.ai_family = addr_info->ai_family; + addr.ai_socktype = addr_info->ai_socktype; + addr.ai_protocol = addr_info->ai_protocol; + + if (AF_INET6==addr.ai_family) + address = "0:0:0:0:0:0:0:1"; + else + address = "127.0.0.1"; + + if (getaddrinfo(address, "0", &addr, &result)) + goto fail; + + setsockopt(client,SOL_SOCKET,SO_REUSEADDR,(const char*)&opt, sizeof(opt)); + if(SOCKET_ERROR == bind(client, result->ai_addr, result->ai_addrlen)) + goto fail; + + if (SOCKET_ERROR == getsockname(client, result->ai_addr, (int*)&result->ai_addrlen)) + goto fail; + + if (SOCKET_ERROR == connect(server, result->ai_addr, result->ai_addrlen)) + goto fail; + + if (SOCKET_ERROR == connect(client, addr_info->ai_addr, addr_info->ai_addrlen)) + goto fail; + + freeaddrinfo(result); + sock[0] = client; + sock[1] = server; + return 0; + +fail: + if (INVALID_SOCKET!=client) + closesocket(client); + if (INVALID_SOCKET!=server) + closesocket(server); + if (result) + freeaddrinfo(result); + return -1; +} + +int qemu_socketpair(int family, int type, int protocol,int recv[2]){ + const char* address; + struct addrinfo addr_info,*p_addrinfo; + int result = -1; + + if (family == AF_UNIX) + { + family = AF_INET; + } + + memset(&addr_info, 0, sizeof(addr_info)); + addr_info.ai_family = family; + addr_info.ai_socktype = type; + addr_info.ai_protocol = protocol; + if (AF_INET6==family) + address = "0:0:0:0:0:0:0:1"; + else + address = "127.0.0.1"; + + if (0 == getaddrinfo(address, "0", &addr_info, &p_addrinfo)){ + if (SOCK_STREAM == type) + result = __stream_socketpair(p_addrinfo, recv); + else if(SOCK_DGRAM == type) + result = __dgram_socketpair(p_addrinfo, recv); + freeaddrinfo(p_addrinfo); + } + return result; +} + +#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..75a902278c 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 recv[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 Thu Sep 10 10:37:17 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: 274061 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 70B01C433E2 for ; Thu, 10 Sep 2020 10:42:10 +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 00F3B206B8 for ; Thu, 10 Sep 2020 10:42: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="Y+IhmG7D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00F3B206B8 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]:51724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGK1p-0001UV-45 for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:42:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJxd-0001hO-Gl; Thu, 10 Sep 2020 06:37:49 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:39312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJxZ-0003ib-QE; Thu, 10 Sep 2020 06:37:49 -0400 Received: by mail-pl1-x643.google.com with SMTP id x18so707201pll.6; Thu, 10 Sep 2020 03:37:45 -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:mime-version :content-transfer-encoding; bh=xS967nwniiPoKExhe31AY1Igl1jhGzMmH4nTv98GjJU=; b=Y+IhmG7DjtVxyR77ap8/AWFkOPkC6AVy1gPAxHG0nsMnAABK8TlZGg7NXW9ab2uJ8M WgdfYpPa0fTl3sFKQ+IlO7e5jMBqpfzbtxccRlTBdFi/zJUlDJ/09ja80oIZhZICGXxj z8hF0c63hKGX85/MO2NX8OXDO6kNOXCWqISth7ozpNm1bd1XFhsvNmrXBXKN2UuJjqu6 cv+jfnKQ7AOMYbOqNjqFf17D6xto0PreXV42YGhLXzoopT1WP0q5hx/yS3OGHPMFBGhr /41bRQzGn6r5mIPI47GEDn2Gf7fKetSNZuCBOOSg6LSZFXDKAVlRm3WxnAiQNlZChIad scwg== 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:mime-version :content-transfer-encoding; bh=xS967nwniiPoKExhe31AY1Igl1jhGzMmH4nTv98GjJU=; b=ba1U2gBe2+SeRdYU4ANGhLWk9zy5WcweOfDSXP4s7pxcotZW4IGbR6PnDglOSy4Eoe 4TMja2khvF/vxq+z72A61cJp3iSTGNVpiAencRZOXLbmyoQgI0TkOvgnV69nXJWHKsZ1 wFD3DbMHDSDtLlE/BJB5hnGmilewHyJ3JPnP4klo+QXCPH6U9FY05vY7ca5psf2EiUTs GSlPkRPJ7UiTVRZWylf04kuKf6go4u9K37FjHngLIwoXZSaAedPt7J7F04B+ZMtFp1qV 5hULi/naO2ei9l8+B9IfX0+z7KOHzmax72KCDXyubUZJH+MsHKyBNzqu+aH6MQARskw6 gBvw== X-Gm-Message-State: AOAM533yUxhcxUN5F+d2m7vEq9rm31fMHZNNvLZAxq+Yr/ozOMd+I31R PTydrY0K7IlYi5l82otxJxiOGGMCvutSSxP+8qw= X-Google-Smtp-Source: ABdhPJymFGfQQvyI+isSMpk3XKDvcKczORr/wbDO+vQ+8HigohpaK6O66SuoV47B0OseItxNiXGR7A== X-Received: by 2002:a17:90a:d702:: with SMTP id y2mr4787029pju.216.1599734263449; Thu, 10 Sep 2020 03:37:43 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 99sm1781191pjo.40.2020.09.10.03.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:37:42 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 17/25] cirrus: Building freebsd in a single short Date: Thu, 10 Sep 2020 18:37:17 +0800 Message-Id: <20200910103725.1439-1-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x643.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 , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Li-Wen Hsu , Peter Lieven 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 Thu Sep 10 10:37:18 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: 305726 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, 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 D5095C433E2 for ; Thu, 10 Sep 2020 10:43:53 +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 7EB2F206B8 for ; Thu, 10 Sep 2020 10:43:53 +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="T0S7ngHU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EB2F206B8 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]:59904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGK3U-0004pK-HG for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:43:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJxf-0001on-TU; Thu, 10 Sep 2020 06:37:51 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:37341) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJxe-0003iq-9X; Thu, 10 Sep 2020 06:37:51 -0400 Received: by mail-pl1-x643.google.com with SMTP id u9so709695plk.4; Thu, 10 Sep 2020 03:37:49 -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=T0S7ngHUKTEFimNYY5jeld2DsCu72+4qJK08GG9GI0+SE7o+8RhXC7V4UotuzeQUrb Iyq9t03U4SHV9BkffgRzNnJ30wZHW6dDC8/UFsFSI6d7MBl+49u+mCkZX5x90kqoKBxS pDYlFrml9sw+98ubrl9FqlYZdmP6VyziFcV1mLkOguRQQiClMELau017RAx20Djp44/p jur98X5W7ITwzkoXEumDA5xRlkuOEtsZgVOXPvDg/+otRoEaIHGknEDrIwtLv5p0VPsB cBozahc9+6kWmINER5xCnh6P8ADt02AXyghJjok0Ieqmp/UZLeJKzhMG8XGNHw636Qsv 76dQ== 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=t6HsumWv+k//74avEo647iS4FYo7uTjJJJ30inbIRRUrJeSAV8aDbnNOYgJCa0If9J qLf06wbBxhd6HEJPpv/yk8KbJF8evlAG+04j73WamIsbLx372B6WzgzQN+hDsUMOg23M 6fo1Cm0egxWefu66JkSm7//Uo8mRJ2NgoFg7Zb9Fyuapyth/LjvOX7HqWkW1lH6vOVhB TzrkN0ZOroz1xpCRKiuzHsiCnoQJKSMYMRxR0AhDIY1EUSSTjmaKHjKSKCswFuR0T8sv 2aad4rP9amQ3+zCBU7A6d/6Pmy6pNJImXwPhMmkDYVGcBqjRkjgdH53ww5NWaLZuK6ZQ YWow== X-Gm-Message-State: AOAM533tzR/nNe8k6Q3Nvl+aqTo1i57095egXZYiqUDu46O08q28B1Ii pA304OK24VdH8WAGxX0fjf3MrwSJ0gZsL165su0= X-Google-Smtp-Source: ABdhPJzgmKZSR+x1p1zY81cyrBseZ0ATZeiF6zK8pacKxk8AEw+8c5FmKDsttv509ssQBrmyaOYr8A== X-Received: by 2002:a17:90b:1050:: with SMTP id gq16mr4893169pjb.234.1599734268103; Thu, 10 Sep 2020 03:37:48 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 99sm1781191pjo.40.2020.09.10.03.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:37:47 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 18/25] tests: Convert g_free to g_autofree macro in test-logging.c Date: Thu, 10 Sep 2020 18:37:18 +0800 Message-Id: <20200910103725.1439-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103725.1439-1-luoyonggang@gmail.com> References: <20200910103725.1439-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x643.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 , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Li-Wen Hsu , Peter Lieven 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 Thu Sep 10 10:37:19 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: 274062 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 6ECCCC43461 for ; Thu, 10 Sep 2020 10:40: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 AEF57206A5 for ; Thu, 10 Sep 2020 10:40: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="LJPbOWQ0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AEF57206A5 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]:44252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGK0I-0006p0-MX for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:40:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJxk-00021d-4X; Thu, 10 Sep 2020 06:37:56 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:40559) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJxi-0003jI-Ci; Thu, 10 Sep 2020 06:37:55 -0400 Received: by mail-pl1-x642.google.com with SMTP id bd2so709322plb.7; Thu, 10 Sep 2020 03:37: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=ks2bOk3jYOHrXnI/Shz64S+t7ePZagOpQ3Ju/TypT6Y=; b=LJPbOWQ043DRYO4+6XyaJPyTFtk8trgg+ARlNxF4WtlnN359+uvOonmLeb+xgd28I6 gNzyMTyyGlPb9q7iL6ALqfaCfZ3fLYtAHIUwRjO+AJf7EuvO8KpdljyAf2vYVfPR9DPB DaHtp+jyOAgill0K5gginlX3eR2Qex78IBwot6T1a/wwJO/l/FZBnmTSmx9O8EOZybPr ZI+e7CcbSQRZkpcBarghxky05QWQOjLCiYHq0H/ZphHK5POTTR6Q/y9Tj1ScHbSdh2I0 1viUchcUzY/qu0nAUEZxigS6qfEkmNZin65NDL1YFEXw/pE122RRUSr20/a2UAk/842O psnA== 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=Iu7DpTUS/VnjovRfIoHLIUiPUhDqM4OcGNm7mQhod29Kj+nRVD3tc04wkWlQTsbw+1 jMo3XsWzTbN3pOVsNz85D3H6tDUXlPBeRTBrrP+ynmprDGU6fxbB6tLYk7f7sccNp+yF 2jsKJjzkCEuXS7TiGj5atYgGhVV7b6H3De29p+LVORA48iQk5+/NvHkeyr4Awr6Xxi8Y tKWALGZ3TzhaiBfufTHp7kpJ37srSyQXP963jawxvzQIEKZ2jbAfWDlaYXtEMJwhuPBX Cs38AiGPF2Ro+2kBz6t1dVkGvuvw+x9dfzO2pxEDlU27u2q8ThzlDbT059LfAi+i4gDy huTw== X-Gm-Message-State: AOAM531IFSCxNroaMcasfJGU/8ho7bF0uJfMgxZgTngwwWoGL7txVW1T DcrmPQ1qoqScxDmZ7tywo5XyO/KtdOPSizSFSJ8= X-Google-Smtp-Source: ABdhPJzQkjvSzf9QVwlJbM7jyclFjK7keCBkixm4txYCAugJmvfVMemRz7C1bh8LHbQtZO5kYlqsxQ== X-Received: by 2002:a17:90a:ead8:: with SMTP id ev24mr4752491pjb.89.1599734272490; Thu, 10 Sep 2020 03:37:52 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 99sm1781191pjo.40.2020.09.10.03.37.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:37:51 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 19/25] tests: Fixes test-io-channel-socket.c tests under msys2/mingw Date: Thu, 10 Sep 2020 18:37:19 +0800 Message-Id: <20200910103725.1439-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103725.1439-1-luoyonggang@gmail.com> References: <20200910103725.1439-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 , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Li-Wen Hsu , Peter Lieven 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 Thu Sep 10 10:37:20 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: 274059 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 B57B4C2D0E2 for ; Thu, 10 Sep 2020 10:44:01 +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 5516620BED for ; Thu, 10 Sep 2020 10:44:01 +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="b8wYN+Uy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5516620BED 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]:60216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGK3c-0004xJ-DE for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:44:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJxo-0002F8-Pr; Thu, 10 Sep 2020 06:38:00 -0400 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:34817) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJxm-0003jj-UU; Thu, 10 Sep 2020 06:38:00 -0400 Received: by mail-pj1-x1041.google.com with SMTP id jw11so2842326pjb.0; Thu, 10 Sep 2020 03:37: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=eTowCOmFGkug/aztHy6I04JZoGONhdCbvgRzQeqIV9w=; b=b8wYN+Uy1/ISNtZp4PlOONXSnOKaOrayA0cPut/cAHHGwRCrBXq8pTfhKRvRvhuwpd ArQsPM9NttruWo4Q1KKx2QEPL9nK40tPxDuKSJtrjoIOsSGzrW/Sp0e05UTK6+imOebR 6BuGeCXO/efEtk4MrK/yc8eJnoOiwD4H9OfnsH+ADPg4v5LKbg8ZFKfCeDIvQDzslbVo FslX7rCD1QJKY29QMWMJF+IxuIHDXBhuD65Px4bC2OcBFy/afw+UtRrCXAczCWcfEmm5 nIP0fakgtxTUy2fSyRvrMMENi9n2K3/nL8V2QRGHageGvCdRQ0yKo8G2UzaEngQovvnF O76Q== 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=Rc0TmGWpls7TQ5Pk3Sap+fHEvZAuvMIV8r+7vDI87rKuOieZBIjeA/XnOcUZjdrV63 Mb/OZF6wA1wic4jsCNONP4K28Cr5JBiBTIFJ3y8U52MIf1Khj/1yV+72GtzpyAQywtA/ +noVNUqTA3BZk677pgzNB1J5ZhT7hZVuw2wAr3lg9QM23J7pPdlJfCKciOMgjh7Hk13h vLi4KXcLs5Htl8fxeZqAuCyBvAfMBHFjVVzWufc0jDVsWEHONzaKxq/L1Ts/ZhDqpYgu f5Zc5/ZZcFf+KZ/aTHKHG40cS+umciDqHW7e+L0B/v3/WseNXP2g1rK1Pa/sK4xBXATO 7QLw== X-Gm-Message-State: AOAM531mczsQnslVsCxEXe4V1SmFB/lkCagfFOQ736WMaoPpCq1wyAon ScN0+gvQBcUJiNzSFG3GpxY5SnRfu42Aa9KX7ms= X-Google-Smtp-Source: ABdhPJxwgalAm7Bc5N2HNcSCtr5IB8LNU8UBbQoa4srlMBqi4BHBk570LvNv3Rj+sgCsAkoWLwCZlA== X-Received: by 2002:a17:902:7489:b029:d0:4c09:be with SMTP id h9-20020a1709027489b02900d04c0900bemr5234643pll.0.1599734276646; Thu, 10 Sep 2020 03:37:56 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 99sm1781191pjo.40.2020.09.10.03.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:37:55 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 20/25] tests: fixes aio-win32 about aio_remove_fd_handler, get it consistence with aio-posix.c Date: Thu, 10 Sep 2020 18:37:20 +0800 Message-Id: <20200910103725.1439-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103725.1439-1-luoyonggang@gmail.com> References: <20200910103725.1439-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 , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Li-Wen Hsu , Peter Lieven 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 Thu Sep 10 10:37:21 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: 305727 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 361B8C43461 for ; Thu, 10 Sep 2020 10:42: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 8A63420BED for ; Thu, 10 Sep 2020 10:42: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="kH3KdYQe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A63420BED 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]:53392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGK2B-0002B4-Ky for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:42:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJxw-0002Rh-PU; Thu, 10 Sep 2020 06:38:08 -0400 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:37372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJxr-0003jz-Du; Thu, 10 Sep 2020 06:38:08 -0400 Received: by mail-pj1-x1043.google.com with SMTP id kk9so2834576pjb.2; Thu, 10 Sep 2020 03:38: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=raGFyZs6MR9nEefX4kmRsgZPLq8a4zwcDe8/ve9JX8Y=; b=kH3KdYQeQgc8VQqxB45Fk0UqrKtgeZqQN4NOKKW/fq1hTpV87UFWr6kZxLBZkAjVGN RcHrfZMlWabzXfm1fxoFDK0XYsLIZFwA/y69VPjGoydslshb/vvkY9ilWGUWJ1Ti6j/0 GXLqQuf4xQZd3015Y1aQG1gQ+RHHpuwQjTxCdgqt3hUj+VsVNxnVREIJGd4nou0WyQ9E 3Dy4nTM7egEXA/2H2O+jy6O2wrZnAvtmj78Lpj05NYxz5Xj7+SGDgYgTXeE4s2lu3hZ/ eJetMuqfI+krId6eKdKxOV4Xc3E8mkYvlxCEOxmgVYTvMD0BdaPMbFSTIePq3EPHpwk0 XfgQ== 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=cKnSuDXVEa4UM3Czga1W0PDFWsYICCWJkvCVAUOi5XU2GVPAdBWWcLL94Vx9ftxqNS Z3KClHh5I03AJ23P1pDrsimhixUTBY0NvcoD7dyWRCNMKb7wYDPjMy1wpke5dRoQMBzC 3u9Gbgv1y92Pm+qt542I3+bIgS8lPEPOZuJm7EgGYMlrEH7zCN81uF6vWfgfLZURPN4J 0KPe/2AJWwhKR+jifEH+WhbNLJ/FWUiYsnTrDLtf5Xrqi5vaiaVSwUPtNBzOpb7s+hph nWKFfofwtH/tvTo/y46VnaMxOENSNRP4/NDZuHD0hzE3twfUA3mQhAFITMmYi3H6jo4o 6t3A== X-Gm-Message-State: AOAM533qhJRCZsjlem2JrhYd6CfRF1n/PU5hrXW5+RCuPLR7lZza17SY EGw5BKXPedKPstqJLFJDGkwamyue0L4D72yw2Pc= X-Google-Smtp-Source: ABdhPJxJFSdG4QYUPXJnmkatCgZe1naydWGR/qrJRH9EXbx1nY+mhjIdDzaV6ZLCShwD3TxMvvoj8Q== X-Received: by 2002:a17:902:9a06:b029:d0:cb2d:f276 with SMTP id v6-20020a1709029a06b02900d0cb2df276mr4850122plp.15.1599734280894; Thu, 10 Sep 2020 03:38:00 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 99sm1781191pjo.40.2020.09.10.03.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:38:00 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 21/25] tests: Fixes test-io-channel-file by mask only owner file state mask bits Date: Thu, 10 Sep 2020 18:37:21 +0800 Message-Id: <20200910103725.1439-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103725.1439-1-luoyonggang@gmail.com> References: <20200910103725.1439-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 , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Li-Wen Hsu , Peter Lieven 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 Thu Sep 10 10:37:22 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: 274058 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 9A5BBC433E2 for ; Thu, 10 Sep 2020 10:45:54 +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 33FA420708 for ; Thu, 10 Sep 2020 10:45:54 +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="K8ikx+co" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33FA420708 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]:38710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGK5R-0007nM-3h for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:45:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJxz-0002Ze-De; Thu, 10 Sep 2020 06:38:11 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:40561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJxw-0003kA-T0; Thu, 10 Sep 2020 06:38:11 -0400 Received: by mail-pl1-x643.google.com with SMTP id bd2so709550plb.7; Thu, 10 Sep 2020 03:38: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=BErOzaIvgNGZoOo8yO9vO+FZKR44ZCkaFrgaQmO82bU=; b=K8ikx+coiSbHYV1ZcqqhpM9vbYjQR/Cy5tXF2F/eNVG/2tmszb+K3TZbye9SOZgfCh YGNby6K12+osUGBo0zlf0rWYGzQw5jTrO+UM01EoIPz11LTIweU9nY45MS3V1F7JVwAU aE5/XOZgg0VLIp5eR12PYgrU7RSG61J+HBbxHT91/+zdz2lMGHP3Hf6JUOOKfy9CBUP6 B2xh5+BwNFp8Dloh2PnftWogGRlxXdUJlV0+67f0N8xS5Z7DiOuHzgxyTT08KH12O+z0 foK2XNFw0CvIMKF7tXPBy0URNwjPAry3uOmFw9nrwa703nMHieiuetynS6r2/U4HKY3f VeRA== 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=jFFkmUJdIofDM2bwl+Lg4h6kLso78JjRH46cxng0Z7SEwn+S5d0boLWTodtCkuASgQ fibCvZbeimumsryYsLdm0k8N/b66Fv/LWe13uYhtrAkTSYUMiiZcNUENUx1Lh6FaVtzO jvcb8s1dexzz8q//iIbdPm0PBSPrQayAzBEsx11TofPjoWlfoY+JVXE89yeFJIO/goUY NdYx3thgJ0ZGvcprIuOJn84Xqtoe9ks78+tYa7+NJitbVfIOXeZlRxNSw1Tcj8dxyJOV Zup+6LJSS2bJfZ+NV3alLPpWoaMGDVvLKItKvmU8N1W0APGelt2STtgu4hwlXqg1AhWC CnRg== X-Gm-Message-State: AOAM531JSxNIF9Kib5MavmEWHWZtSJ1MAh5eeJUmaWZ7hTI/Nhu9PrGX TzkrPBAbBtMmEIXuQGdO2Vx7K6HKp57eFRBEGvQ= X-Google-Smtp-Source: ABdhPJw+jhH+wIL1BRlnr7dVVvD33ZVdi6KYLtyk2C+h5e8dAHqujTiPO5Oo8Gh2khZp+1ySp/4vmw== X-Received: by 2002:a17:902:ea82:b029:d1:7ed9:5470 with SMTP id x2-20020a170902ea82b02900d17ed95470mr5161041plb.26.1599734285391; Thu, 10 Sep 2020 03:38:05 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 99sm1781191pjo.40.2020.09.10.03.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:38:04 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 22/25] tests: fix test-util-sockets.c Date: Thu, 10 Sep 2020 18:37:22 +0800 Message-Id: <20200910103725.1439-6-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103725.1439-1-luoyonggang@gmail.com> References: <20200910103725.1439-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x643.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 , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Li-Wen Hsu , Peter Lieven 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 Thu Sep 10 10:37:23 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: 274057 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 7B0C8C433E2 for ; Thu, 10 Sep 2020 10:47: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 2498920BED for ; Thu, 10 Sep 2020 10:47: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="Ke4nXKj3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2498920BED 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]:44662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGK6a-0001oD-Af for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:47:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJy1-0002fh-FE; Thu, 10 Sep 2020 06:38:13 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:45147) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJxz-0003lh-PD; Thu, 10 Sep 2020 06:38:13 -0400 Received: by mail-pl1-x643.google.com with SMTP id bh1so710946plb.12; Thu, 10 Sep 2020 03:38:11 -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=sqy+D6SedHdu7xWl6iOu7jkM8eZQH/mrLi9LGlLAHEU=; b=Ke4nXKj3ppscP03T+QY7nx73quvnUmKX8zcT2p6fPmEHD2J461mab1LH5Msg4NB36+ zCC8A9wiiwcjDDptbDAtlv9b+7Q8pIECFqunbR4Z7XSbqUZ/57oTGgSi/Ic3AX6YSUBE lY6lZ1l9geV+Y2pdmtCCqa8osY5s3fJH+Jn92KM7GtGo/MAd0Tryxb6WdvwZK4/4djiw QV4SbUZgmIci84ngcVGVk9CRh/3A/ZPotn7wA+opTzqltCF7x6alUKxTiprhu9oAs7kS jY3jhQYHxy1R3KfEeKa/GMeFP8zkFmMuXG+2CNo2DVz+5RFT5tQI8ukqmdAykg/Vlhe2 moAQ== 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=sqy+D6SedHdu7xWl6iOu7jkM8eZQH/mrLi9LGlLAHEU=; b=AEA7vjmryQ4mQTQKiS8aUK98GMUTc2UxLvsoNXW0yG/flKvvyzjP1wz0pga0/g4dr4 EiA1e+Qmm4F2mauU2R33Sk+t3RVEZPGMQ4/F/9NF6e5chbCKH0tdcHJ0TI1dOLmmQaxB zPXtv6kXnx+Jv06FHzkOxeRgNHnw8JFErK08OrWLU+z9OdOBfmUkmAkwd5RM1v7GpZhO 3lZ0un/6jQHfD0Dr8JT/uVrn4KIN3w48LdSSnwRH0HUAVnS9LX9qJhm6kYay76QSjrCm 0zrsJ2EyOh9Yfi8iaHI13jPkTrBwbjaHb33Wg2n/EFqduOpD7ViwYB+Y2EGsAo7b82s1 Z61w== X-Gm-Message-State: AOAM533Uz8C9AylkTAkO++hJOKrIe+dsEB1wzU3vbwZiUDZWyRzXfURW hTbkBJww6XOeYA/UWzl3YJXTnGaNsQutH16xaQw= X-Google-Smtp-Source: ABdhPJzSzIDlVVImBXQNpijHcA4hqj5ipH4ru3/N2ZZ68PWrVfjgQrp+Ll2/nWE18Os45x3Jd7Wrjg== X-Received: by 2002:a17:90a:db0f:: with SMTP id g15mr4699812pjv.145.1599734289711; Thu, 10 Sep 2020 03:38:09 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 99sm1781191pjo.40.2020.09.10.03.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:38:09 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 23/25] tests: Fixes test-qdev-global-props.c Date: Thu, 10 Sep 2020 18:37:23 +0800 Message-Id: <20200910103725.1439-7-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103725.1439-1-luoyonggang@gmail.com> References: <20200910103725.1439-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x643.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 , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Li-Wen Hsu , Peter Lieven 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 1e6b0f33ff..d8762a9756 100644 --- a/tests/test-qdev-global-props.c +++ b/tests/test-qdev-global-props.c @@ -250,10 +250,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 Thu Sep 10 10:37:24 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: 274060 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 A7467C433E2 for ; Thu, 10 Sep 2020 10:42:44 +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 277C2206B8 for ; Thu, 10 Sep 2020 10:42:44 +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="itRG7zEL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 277C2206B8 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]:54730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGK2N-0002i6-6H for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:42:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJy6-0002sv-7s; Thu, 10 Sep 2020 06:38:18 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:38487) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJy4-0003m6-I4; Thu, 10 Sep 2020 06:38:17 -0400 Received: by mail-pg1-x544.google.com with SMTP id l191so4023128pgd.5; Thu, 10 Sep 2020 03:38: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=K7y5ZJD/cG5cMFm0+/8rHEDw15+8VS3xMSK8qF/3N8U=; b=itRG7zELBtlvSk4lp/xapCo3jDgHecD7aaSCd9aSJ7j3FwEXd3nyeU8ExemihDPg45 6jiyrW6pIrM/m5Uic2MIWTCztzMThj1EexoRlZhhxf/H4vSXxCxwbHg3kZk4dGZrmBEH KrTp4YjsCHFjIAoGpwds1vd6bUh+hxyz9KyoYJ+7K12BtXDInIi9Ro/b0n+VrqaJgL1c LI1h2r6aS105aBoN9JZ9zdBHGHtqnb+48Ly/smx4vbWfb4OQGTwbho5NoYnEbLC3CI6I QzALFDpnLOkJRuqLXWLR7Ld4+yXi/HNQ5lIvw86FXrlze1hpwb/zQXLnPA2tx3H1goJ9 sbTg== 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=fAorhVdyZtZhVzHD4OiXxa7xVyaH++PBGG9xwVo9ZI4k4XSoY8ZPYJPFp4lrv+gtaM YP7OfmHfQd78vi75U0Yqd3ZotgykkgANyEzOv7/s7PWD7xFRPQm3isa7fOdOnudxKYHL 64qxvwq/nsDrodKRvmbpoiQFLLiEMbERkaL0p9J+a67UrAi6X+QEaHG7UWv35r/CcHNA D5CiaswfIWAK6Z/+JfGszytA9B2GtOAs6wLpMOK0AXSbyTlA1Iq6R/iRzQm+ZHYUa0nn vWJE9fYZAFZ2k57iOr4bDMMu5LyecF/4KRcEp9xZO0QS1wuy2f9QBTsTIhjwJqVQIFTd lqSw== X-Gm-Message-State: AOAM533fqa8je74ynVeYw7/2LCu9/v9st9EU44fO3KMBD05oL/cqU4Sd 3SZf2Ea+Ar7NL3G8KPk+cotgC23QlTcGVJ915BA= X-Google-Smtp-Source: ABdhPJzHqItAQkAbMm7aRHILlHp2LtTk4hmK7Oj+3JOZoJgKZ4ZYXFs7WqiZ0Xa4Ou04aoUXCEkh+Q== X-Received: by 2002:a62:52c8:0:b029:13e:d13d:a07c with SMTP id g191-20020a6252c80000b029013ed13da07cmr4926373pfb.19.1599734294019; Thu, 10 Sep 2020 03:38:14 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 99sm1781191pjo.40.2020.09.10.03.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:38:13 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 24/25] rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full Date: Thu, 10 Sep 2020 18:37:24 +0800 Message-Id: <20200910103725.1439-8-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103725.1439-1-luoyonggang@gmail.com> References: <20200910103725.1439-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 , Paolo Bonzini , Li-Wen Hsu , Peter Lieven 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 Thu Sep 10 10:37:25 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: 305725 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 3C82BC433E2 for ; Thu, 10 Sep 2020 10:45:49 +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 CA28220708 for ; Thu, 10 Sep 2020 10:45:48 +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="hhPZt7rT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA28220708 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]:38396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGK5L-0007fM-V8 for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 06:45:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGJyD-000325-3f; Thu, 10 Sep 2020 06:38:25 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:38486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGJy8-0003mg-Eq; Thu, 10 Sep 2020 06:38:24 -0400 Received: by mail-pg1-x542.google.com with SMTP id l191so4023202pgd.5; Thu, 10 Sep 2020 03:38:19 -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=/hY+yQHTuO6c65IcDhojIGm+XDaALdXHmil6ThkS0qk=; b=hhPZt7rTjodD4Lsudf4N/87a26tspSvD0m+lFCyb7Det22uMsIp6IVjo5SmXqS5uBj V5NrrKMF4q0RAXHZ4oWyuJdqot/O/AhLeZ5v5XVv8RCnakQgstgR/K5WIB9AAFk2FadY aWf7oP9gNxTTJgJSoW65qLVsS1L03wFbkY2Fzp4cee4GZPLR/5NsfUQFP5tmGni2W8u4 f8TjywOXqpkJ6E/7gHQ8FOI5UQoVmx5V0C9Deo7fuhmv86NcqCM/hb8Z/5wFCd15eBfW jkmql2c3yJDDEO4jN+cVhnQQB+0318cjDoJXVYcrJGrI3FGfyrCEl7sxiovJKXD/VP/o 7Yng== 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=/hY+yQHTuO6c65IcDhojIGm+XDaALdXHmil6ThkS0qk=; b=pzHJUmCPase2h09/BBPAEh+mQm6cCeIeow9s7dCCBUq9gEIseCnVs0pInyRk92GY6C bwNDGPG1SoI2Qsu5UvlSzczsZpQDl05J7m5si8DZTiENq6RTf9kWFSZ/6rwRu3U81H3h biwxz0g9W0C2wSedB+OJVBciVTJddYr9+kiHLOiRtNtGjHy1LAMBFZitrOX6QA/plyV5 a49OMs5jl9iYA15sP5VhNovKs5LbWIEeu0oV80TeQ6r5Aiu2KxooU42Yio6Mgl6NLUWS seoxn3ea7fU/Q7v9Nl//TX1eg88m1jrefQqApluucFIVFdu5JFthg0TELgdQn5XH0Vio S/Kw== X-Gm-Message-State: AOAM530QNPuACCIZBsMgxofSe4l6zMOCBMQQff+1u6u2biA0hlWfxDLy TPXseC+PHb+GmLEgm3rs+WuMlRgIwJ+yK0TaWHY= X-Google-Smtp-Source: ABdhPJxJkK1H4E/NTQbGIIUUr8QUvgXPjKyW+bR+25c536iA9RQIig4aKfMTzJa4ep6Ibj998t+ugQ== X-Received: by 2002:a63:4902:: with SMTP id w2mr4025870pga.311.1599734298413; Thu, 10 Sep 2020 03:38:18 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id 99sm1781191pjo.40.2020.09.10.03.38.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 03:38:17 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 25/25] ci: Enable msys2 ci in cirrus Date: Thu, 10 Sep 2020 18:37:25 +0800 Message-Id: <20200910103725.1439-9-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200910103725.1439-1-luoyonggang@gmail.com> References: <20200910103725.1439-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 , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Ed Maste , Michael Roth , qemu-block@nongnu.org, Stefan Weil , Xie Changlong , Richard Henderson , Markus Armbruster , Max Reitz , Yonggang Luo , Gerd Hoffmann , Wen Congyang , Paolo Bonzini , Li-Wen Hsu , Peter Lieven 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 | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 690c6882e8..1ff9f0a72f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -44,3 +44,63 @@ 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: + - C:\tools\msys64\usr\bin\bash.exe -lc "mkdir build" + - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && ../configure --python=python3 --ninja=ninja" + - 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" +