From nobody Mon Feb 9 01:50:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527816592317164.84727100220323; Thu, 31 May 2018 18:29:52 -0700 (PDT) Received: from localhost ([::1]:46893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOYt5-0004Ew-GO for importer@patchew.org; Thu, 31 May 2018 21:29:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOYqs-0002wv-Vc for qemu-devel@nongnu.org; Thu, 31 May 2018 21:27:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOYqs-0002ty-0G for qemu-devel@nongnu.org; Thu, 31 May 2018 21:27:35 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:34561) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fOYqr-0002ta-Ql for qemu-devel@nongnu.org; Thu, 31 May 2018 21:27:33 -0400 Received: by mail-qt0-x242.google.com with SMTP id m5-v6so30317112qti.1 for ; Thu, 31 May 2018 18:27:33 -0700 (PDT) Received: from localhost.localdomain (96-86-104-61-static.hfc.comcastbusiness.net. [96.86.104.61]) by smtp.gmail.com with ESMTPSA id o68-v6sm2003842qkc.19.2018.05.31.18.27.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 May 2018 18:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juliacomputing-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=2M5h9h/yt61QfyXREUavr1tG2L6rBnfGbsX86iOEfhA=; b=jOdbU6Mt1S8ccMYCF938Tw4k9wNBCsH6/h4v2RyvM3LsDsFJQYXsSaLw9gKB1Xax97 U6xtCc2FLt8uNoiZt4lKtjcenE0KrWz5o+OHlXwVvY+iWWzlPNG48IemQ85a2PyQwdSt r/naEKO1Bv44FZPmsUWIwBA0mXxv5BAm+SFxvrky7S8AvojJZmOTihnuQ8wjO+zVUPTN X4nkWufhj+wIauQJAtB12FqHNIpmT18mAnaPKUfW+WozC5GULERggNU/2roJNtVT67TD +6HI7pVeL7LrjPH36EWddnOKXCOPem7Vrwx2bL5GHx9pT2KJarQY7irib/H3xlKB52xJ n9CA== 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:in-reply-to:references; bh=2M5h9h/yt61QfyXREUavr1tG2L6rBnfGbsX86iOEfhA=; b=L4IM8KbsBMSbc2VfZ0Bwz0w+WL/XgXUTRbmDtYcI17xP9kQ6259V6h2qrKF34zlzVX ni9EAmfvXyuO+N7kERRoEn8iNOtGjlP2CB+BLOPkKbRv23SldsuXC2FOWv/29/grO7yH k29DtoFoJIMLZ8VvqvAonIywKbj/L9O5mvcer5kyMZ5J7wUY/I2hrdSMb4BvXdYUvHlF Fic+NgIi7fp3E1NWorPZa/gF5aUe9phZQ/nk+XfYrRrCOgCi8iGdEBn3C3Sh3zwNgEFP d5+lCvnxljJoP29P/IC68DULOrinsdPWiJinDx/hQoM6+HN0Jbtk0eNL1LBrSxKnfFr6 lL3g== X-Gm-Message-State: APt69E0MW43DgB78KEuIxmNTXOxGiWy/JaQ2CpS7t+zG53khqjtz9ARb sN1Hx94G8Mtd2wbD/H3BUOuW72Ev7Xs= X-Google-Smtp-Source: ADUXVKLixNyaL4Azq6dZwyvXVzOj/MtECFki/0GCPHpxjIHZjsiEne6q4FzPP7Tq/eIBZBHcUt+z8w== X-Received: by 2002:ac8:2bd7:: with SMTP id n23-v6mr8765205qtn.304.1527816452926; Thu, 31 May 2018 18:27:32 -0700 (PDT) From: Keno Fischer To: qemu-devel@nongnu.org Date: Thu, 31 May 2018 21:25:59 -0400 Message-Id: X-Mailer: git-send-email 2.8.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH v2 04/20] 9p: linux: Fix a couple Linux assumptions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Keno Fischer , groug@kaod.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" - Guard Linux only headers. - Add qemu/statfs.h header to abstract over the which headers are needed for struct statfs - Define `ENOATTR` only if not only defined (it's defined in system headers on Darwin). Signed-off-by: Keno Fischer --- Changes since v1: * New qemu/statfs.h header to factor out the header selection to a common place. I did not write a configure check, since the rest of 9p only supports linux/darwin anyway, so there didn't seem to be much point, but I can write one if requested. * Now also covers fsdev/virtfs-proxy-helper.c fsdev/file-op-9p.h | 2 +- fsdev/virtfs-proxy-helper.c | 4 +++- hw/9pfs/9p-local.c | 2 ++ include/qemu/statfs.h | 19 +++++++++++++++++++ include/qemu/xattr.h | 4 +++- 5 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 include/qemu/statfs.h diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index 3fa062b..111f804 100644 --- a/fsdev/file-op-9p.h +++ b/fsdev/file-op-9p.h @@ -16,7 +16,7 @@ =20 #include #include -#include +#include "qemu/statfs.h" #include "qemu-fsdev-throttle.h" =20 #define SM_LOCAL_MODE_BITS 0600 diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index 6f132c5..94fb069 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -13,17 +13,19 @@ #include #include #include +#ifdef CONFIG_LINUX #include #include -#include #include #include #ifdef CONFIG_LINUX_MAGIC_H #include #endif +#endif #include "qemu-common.h" #include "qemu/sockets.h" #include "qemu/xattr.h" +#include "qemu/statfs.h" #include "9p-iov-marshal.h" #include "hw/9pfs/9p-proxy.h" #include "fsdev/9p-iov-marshal.h" diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index bcf2798..adc169a 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -27,10 +27,12 @@ #include "qemu/error-report.h" #include "qemu/option.h" #include +#ifdef CONFIG_LINUX #include #ifdef CONFIG_LINUX_MAGIC_H #include #endif +#endif #include =20 #ifndef XFS_SUPER_MAGIC diff --git a/include/qemu/statfs.h b/include/qemu/statfs.h new file mode 100644 index 0000000..dde289f --- /dev/null +++ b/include/qemu/statfs.h @@ -0,0 +1,19 @@ +/* + * Host statfs header abstraction + * + * This work is licensed under the terms of the GNU GPL, version 2, or any + * later version. See the COPYING file in the top-level directory. + * + */ +#ifndef QEMU_STATFS_H +#define QEMU_STATFS_H + +#ifdef CONFIG_LINUX +# include +#endif +#ifdef CONFIG_DARWIN +# include +# include +#endif + +#endif diff --git a/include/qemu/xattr.h b/include/qemu/xattr.h index a83fe8e..f1d0f7b 100644 --- a/include/qemu/xattr.h +++ b/include/qemu/xattr.h @@ -22,7 +22,9 @@ #ifdef CONFIG_LIBATTR # include #else -# define ENOATTR ENODATA +# if !defined(ENOATTR) +# define ENOATTR ENODATA +# endif # include #endif =20 --=20 2.8.1