From nobody Sat May 11 14:11:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1604580035; cv=none; d=zohomail.com; s=zohoarc; b=OyoPR3EI9YSgt7b0si/dMgkx51qkUXhvmAc0FY/+fWr2zBTIUmPUNgY5NZfK8xWamf40HuiB7tF/2oIfKKiVjtgjrczbOEVRCIXrNYnOJngn7JviYzuULFufqazLA+Hd4I37Ie92XsunSqhd8pK8jiLvDdmTho4uutBZnkkO1U8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604580035; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VWn79h0iDOJAfDYC4SZNlTPWm6c9gDOOKAAB4nJHU8E=; b=F2QTGRko5kzWqG9oiSl5+ppKbN/Iok8/q6XuRtFdxkUPN9dwMZRivW9mD/imyY1DdSLCd5NVWOmnWnbwjLhUwMx2II9WAqTKRTJGXsEJNKlVLfZBSk6DXcSlgYNeUmB403JjmpyzPNma1b8ZnHjRv7PvT5dV/88E35wmXjGCitA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1604580035500508.41664400497905; Thu, 5 Nov 2020 04:40:35 -0800 (PST) Received: from localhost ([::1]:52836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaeZ8-0006kj-77 for importer@patchew.org; Thu, 05 Nov 2020 07:40:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaeQY-00052d-UH; Thu, 05 Nov 2020 07:31:43 -0500 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:40116) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kaeQW-0005WO-7o; Thu, 05 Nov 2020 07:31:42 -0500 Received: by mail-pg1-x542.google.com with SMTP id x13so1354161pgp.7; Thu, 05 Nov 2020 04:31:39 -0800 (PST) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id hi10sm2987008pjb.0.2020.11.05.04.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 04:31:36 -0800 (PST) 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=VWn79h0iDOJAfDYC4SZNlTPWm6c9gDOOKAAB4nJHU8E=; b=aSCgMjqlVQ5RzqzXx1KVV5hq0J1wnloMZW09FGyewCYLl5WmOV7KEGLueVskyaSQX5 NoPZTgWdskWCEmt47lidOPdl4yFnbwWqhbRe3McImsET8BM3M21TTv8RpKnDPUMln5Xf U+f4zMOGi5wLG0FdtvhP+Q6O4FKe51gDn0nFQcqmmHaaDGx4zCOnoijMlXcoPeSw4Gjv FzARsjMKA2ZN4Y0+YeBoPSNngCV7mkrIwXlX5CfuFaQ0u2LiD2Rrvzz5TNGu2/PzX6Fi DLMWVtpvr3lWcUrbALeT4MzrtVL40p0js5GeDmQT5DpLAUaeyz1hhChHdH4h8D9UQjWf Z3bg== 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=VWn79h0iDOJAfDYC4SZNlTPWm6c9gDOOKAAB4nJHU8E=; b=gXb0Z0un6WzZ+K+jCAA8RjcSNfKOwZ96mpUXwyfsVyM4cOv2aJzjGnd3jz9SFxGmdo 9cvICCzBMd0+uTS/8kqq7Gw4daUi2Yz89uW3kAeJHvdRJwK5/ccDwtNk+TPASXuemHgB fKo4X88GVusbbXh/730HzJIhodHiorc1S07EDdZaEc7+wydgvr+m8GJzVA4VVvOBqNSM 2inOQ2yfogbaqjjd1JiRPN57QzoitGkD6gQwpvZkoDhZMBJXIenpEhkuyLbpsBp0EIoj RxcOvjb2rPtLozrEY3lrH639Gtm0/xjHKnZ/99bulU7+/ngcL6rvXA2JkqSMF7dj+6Nt kLGQ== X-Gm-Message-State: AOAM533duCGle4hmqizg9fNAb7GqpBjIJbY3jKyquiXgUPk7OSjFGJfQ jF7uN4cnh/xx9h91kMQp2BQtepOJnATM8U2T X-Google-Smtp-Source: ABdhPJz5DWOCWKeYIZvNxECCjlswkEPmZ60z0saezoCcJo8Tw0MSHfWuSGBoZZwcHHZfSdF9Upk3Cw== X-Received: by 2002:aa7:9e5b:0:b029:18a:8d88:12cb with SMTP id z27-20020aa79e5b0000b029018a8d8812cbmr2508465pfq.42.1604579497636; Thu, 05 Nov 2020 04:31:37 -0800 (PST) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 1/2] block: Fixes nfs compiling error on msys2/mingw Date: Thu, 5 Nov 2020 20:31:15 +0800 Message-Id: <20201105123116.674-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201105123116.674-1-luoyonggang@gmail.com> References: <20201105123116.674-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=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 , qemu-block@nongnu.org, QEMU Trivial , Peter Lieven , Max Reitz , Yonggang Luo Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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_bloc= ks' 550 | client->st_blocks =3D 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_bloc= ks' 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_bloc= ks' 805 | client->st_blocks =3D 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 [-Wer= ror=3Dreturn-type] 752 | } | ^ On msys2/mingw, there is no st_blocks in struct _stat64 yet, we disable the= usage of it on msys2/mingw, and create a typedef long long blkcnt_t; for further implem= entation Signed-off-by: Yonggang Luo --- block/nfs.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/block/nfs.c b/block/nfs.c index f86e660374..77905f516d 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -24,7 +24,9 @@ =20 #include "qemu/osdep.h" =20 +#if !defined(_WIN32) #include +#endif #include "qemu/config-file.h" #include "qemu/error-report.h" #include "qapi/error.h" @@ -58,7 +60,7 @@ typedef struct NFSClient { bool has_zero_init; AioContext *aio_context; QemuMutex mutex; - blkcnt_t st_blocks; + uint64_t st_blocks; bool cache_used; NFSServer *server; char *path; @@ -545,7 +547,9 @@ static int64_t nfs_client_open(NFSClient *client, Block= devOptionsNfs *opts, } =20 ret =3D DIV_ROUND_UP(st.st_size, BDRV_SECTOR_SIZE); +#if !defined(_WIN32) client->st_blocks =3D st.st_blocks; +#endif client->has_zero_init =3D S_ISREG(st.st_mode); *strp =3D '/'; goto out; @@ -706,6 +710,7 @@ static int nfs_has_zero_init(BlockDriverState *bs) return client->has_zero_init; } =20 +#if !defined(_WIN32) /* Called (via nfs_service) with QemuMutex held. */ static void nfs_get_allocated_file_size_cb(int ret, struct nfs_context *nfs, void *dat= a, @@ -748,6 +753,7 @@ static int64_t nfs_get_allocated_file_size(BlockDriverS= tate *bs) =20 return (task.ret < 0 ? task.ret : st.st_blocks * 512); } +#endif =20 static int coroutine_fn nfs_file_co_truncate(BlockDriverState *bs, int64_t offset, bool exact, @@ -800,7 +806,9 @@ static int nfs_reopen_prepare(BDRVReopenState *state, nfs_get_error(client->context)); return ret; } +#if !defined(_WIN32) client->st_blocks =3D st.st_blocks; +#endif } =20 return 0; @@ -869,7 +877,10 @@ static BlockDriver bdrv_nfs =3D { .create_opts =3D &nfs_create_opts, =20 .bdrv_has_zero_init =3D nfs_has_zero_init, +/* libnfs does not provide the allocated filesize of a file on win32. */ +#if !defined(_WIN32) .bdrv_get_allocated_file_size =3D nfs_get_allocated_file_size, +#endif .bdrv_co_truncate =3D nfs_file_co_truncate, =20 .bdrv_file_open =3D nfs_file_open, --=20 2.28.0.windows.1 From nobody Sat May 11 14:11:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1604579877; cv=none; d=zohomail.com; s=zohoarc; b=c17BOieU96jMjQbsPDe3EQeVnF/fHNjwd8j+IpB9ez+3YJEzoDnoxUq0aMliJTr6ysEJdGyB0NVgr0slD+kzjFkXSD/5XJ8ejLNikWjpKj/1k7xaDzJssIeaKmSTMpY+WnMJ+oSyGmhhT7cEeAltTkSUXe6w2j5EacXgIJHGX3o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604579877; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PJS7oGCcqz7pb4dQLFQlOPOs9s6TE2XwP4RwUlSKWNg=; b=O2fW3heT1qjGgSwp/bnKhPokIQXO016LVVuTwHNMz6pFhD5HHrbUCB0FVnAoQO4N0oijo2oshr6bbiBu97M2WcpQ3Z9kAjTMZqzNTk5CImOaKkNmn9ySDzhS7I7htdm5UrdCoWDRXoGKSMj3cQzRiGFckbSAyox6Ni3fdPv57Sw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1604579877050834.2209941024712; Thu, 5 Nov 2020 04:37:57 -0800 (PST) Received: from localhost ([::1]:47872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaeWZ-0004eH-SW for importer@patchew.org; Thu, 05 Nov 2020 07:37:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaeQf-00056e-MB; Thu, 05 Nov 2020 07:31:49 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:33523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kaeQZ-0005XA-4w; Thu, 05 Nov 2020 07:31:49 -0500 Received: by mail-pf1-x433.google.com with SMTP id q10so785900pfn.0; Thu, 05 Nov 2020 04:31:41 -0800 (PST) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id hi10sm2987008pjb.0.2020.11.05.04.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 04:31:39 -0800 (PST) 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=PJS7oGCcqz7pb4dQLFQlOPOs9s6TE2XwP4RwUlSKWNg=; b=boXTXj6CbbMyCekKPLjd8r+95PdoEkk4Wijo3edr5w/gK5LpDPxp5MQgMB/IIdD2NY rbIQU5eThiCve9vxEMSK1SLJaKMWXCuxrIg1UFXrfRP0DlZGZpxLrVnTK71ox6X3g9mj uA+Wo4tmnHRW8rG4Rlq9IflfqSJEJ8XIGI0e0QQhQM59z6dJOifvxqgtWGc2GZceMvE8 pTKza5kZ1EohoRGPZdI/jB8mZZfFfFoDbNriDJljp8eWbY+UBbeDbTT9b+QH3YxkS6Kd Y+ys5XUxjfMPzWivUfLlmEKzhEC4LoSB082ED4sThEO4fy2V9XLYuT4TP7PDCOS5GAnk 4yWA== 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=PJS7oGCcqz7pb4dQLFQlOPOs9s6TE2XwP4RwUlSKWNg=; b=jCR9EQhgpL25u+CXP2Z4AkBB18jM1PFJ/JXMaFSmvPAIzz3W8VZDAzw+OYmQZbsE6u 0CqpPM/32pQiawh/bG7NdWXJH03X1MbUa6y2GBtxjB6tWBcwDsfd3/zk+81Sq1p1S3rK CurCS563TKImjmPRVQ+x/ZO7uA0p3Cd74ZUb9cv6N4JaiwilAWtMO5rhcp5XxHUlN1EU 04UEEwa0OYdo3pYODVjkyU6ZhQQOBNG3XswPRf19QGUgKtBGjjkbI2BBjUtfEVJtINK6 AYfWDFUU4Hpsaez78tDp7OBq/50OHc1TwA8N/jFm9aJI3L0Vg1TTedQOQlXrXSy8kyj6 9tYA== X-Gm-Message-State: AOAM533U2/0vzIxGRSrOtU9yWifDUtbjCI3yoI4ZlPZRD5myd4B/wzVw tmPBOL+vJJcTFuGjtL7MiFRe3UfYu6B81Lju X-Google-Smtp-Source: ABdhPJz042gWPuIUbJXgYjWnGNmioYA+us0tEm+WcYC8r2dbVyD1duQ/D+ZN66G+O6I8XL8qTna0rg== X-Received: by 2002:a63:1748:: with SMTP id 8mr2309229pgx.168.1604579500537; Thu, 05 Nov 2020 04:31:40 -0800 (PST) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 2/2] block: enable libnfs on msys2/mingw in cirrus.yml Date: Thu, 5 Nov 2020 20:31:16 +0800 Message-Id: <20201105123116.674-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201105123116.674-1-luoyonggang@gmail.com> References: <20201105123116.674-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x433.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 , qemu-block@nongnu.org, QEMU Trivial , Peter Lieven , Max Reitz , Yonggang Luo Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Initially, libnfs has not been enabled, and now it's fixed, so enable it on cirrus. Signed-off-by: Yonggang Luo --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 900437dd2a..f0209b7a3e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -109,6 +109,7 @@ windows_msys2_task: mingw-w64-x86_64-cyrus-sasl \ mingw-w64-x86_64-curl \ mingw-w64-x86_64-gnutls \ + mingw-w64-x86_64-libnfs \ " bitsadmin /transfer msys_download /dynamic /download /priority FOR= EGROUND ` https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-python-sphi= nx-2.3.1-1-any.pkg.tar.xz ` --=20 2.28.0.windows.1