From nobody Sat Nov 1 22:30:13 2025 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 1527312334736640.5386363150815; Fri, 25 May 2018 22:25:34 -0700 (PDT) Received: from localhost ([::1]:47798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRhu-0007BI-1B for importer@patchew.org; Sat, 26 May 2018 01:25:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgC-00063r-NL for qemu-devel@nongnu.org; Sat, 26 May 2018 01:23:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRg9-0004Bz-Jb for qemu-devel@nongnu.org; Sat, 26 May 2018 01:23:48 -0400 Received: from mail-qk0-x233.google.com ([2607:f8b0:400d:c09::233]:37908) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRg9-0004BU-Ed for qemu-devel@nongnu.org; Sat, 26 May 2018 01:23:45 -0400 Received: by mail-qk0-x233.google.com with SMTP id c23-v6so5675037qkb.5 for ; Fri, 25 May 2018 22:23:45 -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 n128-v6sm17675166qkf.42.2018.05.25.22.23.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:23:43 -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=jrWbaj1QCC+XxYEwVgOWm7kV0rCvKHF7wn8U2gaAfRo=; b=Tl7rznGA3owEI9wmuzmA3KW7PnUlYmxM0skZGlO/tuzDwWHDgmqJ21zoPdjAdSIMAN kBvodWko4stuQv04j5bcSZJLanYrXI53+KM5sJsGFSUAWHe8WN8RTfPJ96uoKoAyPkxn vD81Ek8lKLshaSPgxPdllc5bwZgE7IsceIS9NHFZ5mia+Dp466nW/yuP0h3eRdiaj6DT XhGb047C88FrqtKt1NmKDOyiP9VY8BDAG1eBm+WMPKQ5QflIS4We1XsCd5KKxx/N2dvk TBoZjFBSDCXdDqw9zl0Li8cf0+Op05WW+CViq3ydAzkCDAQ/bQfzhddERTqY002KKLEt 3Tkg== 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=jrWbaj1QCC+XxYEwVgOWm7kV0rCvKHF7wn8U2gaAfRo=; b=Ji0qXysxWNJ5hRnGCPawEu7kDucclOXwqI7R4jZ6kfgwQHf5/CnBUpdpF3TaJJWDip 6Gfcn1wtvkAcusdCkU2aNnC7yNjDB3gKXce0k2tU0M0fsuvSlJGGMCyNsSEG2xivA5/O JpDXZFofZHa4mat7ogEbjE4dpwN+Ed1XctkJD16oHqZpy4z9LtcFL2Glzezfi4IziFbC 6JuXsa7bt8gb3yHJAq2atD6A9CK+p9kxQZX1wWZYkWacrX0SnacyklfKFpX1kbwtoGUe tsPqaE7nRmj7ekJE9XmvpdFD7ENJqBbmVDW863CCoBhTs1Y+5sjj5SYhzhEYlZenX7Q3 6HWA== X-Gm-Message-State: ALKqPwdYMAAx8bfEeFGarpeg91aeedmYT+QjwSnyC04UV2h/rKgk4rDj VZAp4k4QW/Ye6qQ61ruuOp5txdM1bU4= X-Google-Smtp-Source: ADUXVKIs1aIs6ieBcB59GbEAZ2f411iFzSJgr2FTl2ShY/kbgwHbQUXsYNljFXYVxy9Tyc6rCKCDaQ== X-Received: by 2002:a37:295e:: with SMTP id p91-v6mr4499213qkh.415.1527312224492; Fri, 25 May 2018 22:23:44 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:03 -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:c09::233 Subject: [Qemu-devel] [PATCH 01/13] 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 , 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" From: Keno Fischer - Guard two Linux only headers. - Define `ENOATTR` only if not only defined (it's defined in system headers on Darwin). Signed-off-by: Keno Fischer --- fsdev/file-op-9p.h | 2 ++ hw/9pfs/9p-local.c | 2 ++ include/qemu/xattr.h | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index 3fa062b..a13e729 100644 --- a/fsdev/file-op-9p.h +++ b/fsdev/file-op-9p.h @@ -16,7 +16,9 @@ =20 #include #include +#ifdef CONFIG_LINUX #include +#endif #include "qemu-fsdev-throttle.h" =20 #define SM_LOCAL_MODE_BITS 0600 diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index b37b1db..f6c7526 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/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 From nobody Sat Nov 1 22:30:13 2025 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 1527312482470934.6901288954896; Fri, 25 May 2018 22:28:02 -0700 (PDT) Received: from localhost ([::1]:47816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRkH-0000wh-Mz for importer@patchew.org; Sat, 26 May 2018 01:28:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgQ-0006C9-Up for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgQ-0004TN-3f for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:02 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:38176) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgP-0004TF-Vl for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:02 -0400 Received: by mail-qt0-x244.google.com with SMTP id m9-v6so9187789qtb.5 for ; Fri, 25 May 2018 22:24:01 -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 n128-v6sm17675166qkf.42.2018.05.25.22.23.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:23:59 -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=T3gG517Zbros9TZYqTQ/DknosgHOQZ9TYnpPtCFkqOY=; b=OA1vX1e6Zf8hrlugFqgAKJMKGgUJBTfvzjVXnhJONOKJ5omWDlaB8yvxYmdzfZLOr8 xS+mFNalDhEBjuFKC3XNiOeedF44uzqktvCCBvF5NtKn2AGUfIWSf13jIYFV8ydnTi7b BOAYeLEyuhVFx+lWk1mII2RVhg71mPWLeDB44bDvT7gI77MO/EOvRFnT7lUrRNMaXBEh EXy4ohbN53022/BdytmHz7OtEi2SJ1JCERLEODAy0eLn/6RcWULgBrDcPiHvaa8MD5Lt mYud3cTIthuL6xKLTJ5Vt1sWd/9TNRjLWJbx0DwADPlkpMnczhfy4Ik2lBcs8BI2J2B+ 3TdA== 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=T3gG517Zbros9TZYqTQ/DknosgHOQZ9TYnpPtCFkqOY=; b=ECQZdvQkogb3ni4lHNcpSExfcbfvkGiFpYSM5o//udCfWdO+LZLdk9WwhJWohVdvpS 7v4wXhnRrRgyXW4HZHiwoSYlxHbALuFXo/LgmDCYblj9o2fSf0XXxcGBc6aDdMSlChR4 kZDDHMiF7tjOlBqpmmWHbpJVV9lsqToLVtCaGaZV5O62FA5l729S7P2o/rVajTdP+Mem 4n3cGenK12/ZYPe6T3ecBEEc6otKCRaxzslOYuYuTvFencv3yJ0Es0o2UtMST53LjZSD fIHB3JDjw/cYkBWwKGLOt23RimHuKru8+RNbCE048glsUYBqsCU0frkJR/JYWCWaw8Aj YY+g== X-Gm-Message-State: ALKqPwexizfkAgTayZ+Otbkww9c6ifdvn2vVGic7V6+Z5N6hCS9l4LAG LEmjDD+cDHD323kgDuid/A7ARFOO2O4= X-Google-Smtp-Source: ADUXVKIE/ZCOWX2Epa23/iFulAo1gz+eab8IyB/lGLPDLKypUWKpjxMPxMrhCmIDgQNCO2CwkzOyhg== X-Received: by 2002:a0c:e946:: with SMTP id n6-v6mr4850993qvo.216.1527312241069; Fri, 25 May 2018 22:24:01 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:04 -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::244 Subject: [Qemu-devel] [PATCH 02/13] 9p: Avoid warning if FS_IOC_GETVERSION is not defined 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 , 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" From: Keno Fischer Signed-off-by: Keno Fischer --- hw/9pfs/9p-local.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index f6c7526..7592f8d 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1375,10 +1375,10 @@ static int local_unlinkat(FsContext *ctx, V9fsPath = *dir, return ret; } =20 +#ifdef FS_IOC_GETVERSION static int local_ioc_getversion(FsContext *ctx, V9fsPath *path, mode_t st_mode, uint64_t *st_gen) { -#ifdef FS_IOC_GETVERSION int err; V9fsFidOpenState fid_open; =20 @@ -1397,15 +1397,11 @@ static int local_ioc_getversion(FsContext *ctx, V9f= sPath *path, err =3D ioctl(fid_open.fd, FS_IOC_GETVERSION, st_gen); local_close(ctx, &fid_open); return err; -#else - errno =3D ENOTTY; - return -1; -#endif } +#endif =20 static int local_init(FsContext *ctx, Error **errp) { - struct statfs stbuf; LocalData *data =3D g_malloc(sizeof(*data)); =20 data->mountfd =3D open(ctx->fs_root, O_DIRECTORY | O_RDONLY); @@ -1415,20 +1411,23 @@ static int local_init(FsContext *ctx, Error **errp) } =20 #ifdef FS_IOC_GETVERSION - /* - * use ioc_getversion only if the ioctl is definied - */ - if (fstatfs(data->mountfd, &stbuf) < 0) { - close_preserve_errno(data->mountfd); - goto err; - } - switch (stbuf.f_type) { - case EXT2_SUPER_MAGIC: - case BTRFS_SUPER_MAGIC: - case REISERFS_SUPER_MAGIC: - case XFS_SUPER_MAGIC: - ctx->exops.get_st_gen =3D local_ioc_getversion; - break; + { + struct statfs stbuf; + /* + * use ioc_getversion only if the ioctl is definied + */ + if (fstatfs(data->mountfd, &stbuf) < 0) { + close_preserve_errno(data->mountfd); + goto err; + } + switch (stbuf.f_type) { + case EXT2_SUPER_MAGIC: + case BTRFS_SUPER_MAGIC: + case REISERFS_SUPER_MAGIC: + case XFS_SUPER_MAGIC: + ctx->exops.get_st_gen =3D local_ioc_getversion; + break; + } } #endif =20 --=20 2.8.1 From nobody Sat Nov 1 22:30:13 2025 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 152731236602135.133270809526834; Fri, 25 May 2018 22:26:06 -0700 (PDT) Received: from localhost ([::1]:47804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRiN-0007eB-6u for importer@patchew.org; Sat, 26 May 2018 01:26:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgS-0006Db-Sg for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgR-0004UG-EL for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:04 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:40301) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgR-0004U2-9E for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:03 -0400 Received: by mail-qt0-x242.google.com with SMTP id h2-v6so9175894qtp.7 for ; Fri, 25 May 2018 22:24:03 -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 n128-v6sm17675166qkf.42.2018.05.25.22.24.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:01 -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=1Zn0ehjE2H4Zc1RnbhaPGGdekt0XYu8iGpIpleLYey0=; b=Ak3TlfNOhZJYnHS8lbrgs9w3btSo3i/8Fr7E2vIA2pdPcj6X6cst9vqcaul6TDbicV 3XdGuBHBr3kDVCidVNRgY0A7KBrfjpLjCgYXCK3S7EbWLcRJ4Yu9XcEo1hhqJ/EHNJMu lSYftvnvvHix7Njm7l0EPzn2V934l/7xlrbTqpNIwVI6HZ9C8ns7/sqol8+cFq0GH4dK 0CP+oKWchtX5LQ4HBak0CEjSGZIRoVBzwyFxfT5v4sd+wwusFvnRrU8F71IvlBwKYxVr aoMAiPdSe/Jiq5hewotfugtVfLb+MLLczzt4L5asFZVeu01DEJAAscHEPVTmF2041keZ w4Cw== 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=1Zn0ehjE2H4Zc1RnbhaPGGdekt0XYu8iGpIpleLYey0=; b=b8NIhC5VAdTgl413JbuSjkNJJoLAInsr5tf/1hRQrfL34bAdlo4X7wc1yLpkFumd8G grJ71BT7peAIGFcDiyplt+cG6Ba3lcBriSLeGKmH5wrOcuN95t6X8QkLWRWw99qefjwX YtTPSxdCqm/7/HWeUGPvUTrwPaImE8fhl/wpT4ZNLzmRabuHzuezPW2fGRjUiaFOmLw7 BL+zKLczr2pWKemICLFoppt7hIzQoOlgZRWMwLZjBLYahN1vRo70DgIEe4Mdb1H8FYJG 0Q1zPmJG+wnxsjB3RTXpt37cLerJQ/pWg2RToQY2aDaMRuf843iOhDon02I6IsKHAvXt Fv+Q== X-Gm-Message-State: ALKqPwc7m2uLXCdQ2AqvxSc9Y92mKudP0ciaiIAd/X2Ru1mU2s8udaL/ QJ4SUdmN33Mx+gbODGBlenQpM672qjQ= X-Google-Smtp-Source: ADUXVKKLGqr1eqdZaBh1L/kSUbmbV3A6olMD8cIkKJYMF0fQ4rdqFVUVETM+MMnWqQUN5Zj4tMuW9Q== X-Received: by 2002:ac8:2a2f:: with SMTP id k44-v6mr5137228qtk.180.1527312242341; Fri, 25 May 2018 22:24:02 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:05 -0400 Message-Id: <033ba6f2e3f0daccb31e1930a1c65cf7a18ae66c.1527310210.git.keno@alumni.harvard.edu> 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 03/13] 9p: Move a couple xattr functions to 9p-util 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 , 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" From: Keno Fischer These functions will need custom implementations on Darwin. Since the implementation is very similar among all of them, and 9p-util already has the _nofollow version of fgetxattrat, let's move them all there. Additionally, introduce a _follow version of fgetxattr and use it. On darwin, fgetxattr has a more general interface, so we'll need to factor it out anyway. Signed-off-by: Keno Fischer --- hw/9pfs/9p-local.c | 11 +++++++---- hw/9pfs/9p-util.c | 39 +++++++++++++++++++++++++++++++++++++++ hw/9pfs/9p-util.h | 6 ++++++ hw/9pfs/9p-xattr.c | 33 --------------------------------- 4 files changed, 52 insertions(+), 37 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 7592f8d..fd65d04 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -776,16 +776,19 @@ static int local_fstat(FsContext *fs_ctx, int fid_typ= e, mode_t tmp_mode; dev_t tmp_dev; =20 - if (fgetxattr(fd, "user.virtfs.uid", &tmp_uid, sizeof(uid_t)) > 0)= { + if (fgetxattr_follow(fd, "user.virtfs.uid", &tmp_uid, sizeof(uid_t= )) > 0) { stbuf->st_uid =3D le32_to_cpu(tmp_uid); } - if (fgetxattr(fd, "user.virtfs.gid", &tmp_gid, sizeof(gid_t)) > 0)= { + if (fgetxattr_follow(fd, "user.virtfs.gid", &tmp_gid, sizeof(gid_t= )) > 0) + { stbuf->st_gid =3D le32_to_cpu(tmp_gid); } - if (fgetxattr(fd, "user.virtfs.mode", &tmp_mode, sizeof(mode_t)) >= 0) { + if (fgetxattr_follow(fd, "user.virtfs.mode", &tmp_mode, sizeof(mod= e_t)) > 0) + { stbuf->st_mode =3D le32_to_cpu(tmp_mode); } - if (fgetxattr(fd, "user.virtfs.rdev", &tmp_dev, sizeof(dev_t)) > 0= ) { + if (fgetxattr_follow(fd, "user.virtfs.rdev", &tmp_dev, sizeof(dev_= t)) > 0) + { stbuf->st_rdev =3D le64_to_cpu(tmp_dev); } } else if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) { diff --git a/hw/9pfs/9p-util.c b/hw/9pfs/9p-util.c index f709c27..8cf5554 100644 --- a/hw/9pfs/9p-util.c +++ b/hw/9pfs/9p-util.c @@ -24,3 +24,42 @@ ssize_t fgetxattrat_nofollow(int dirfd, const char *file= name, const char *name, g_free(proc_path); return ret; } + +ssize_t fgetxattr_follow(int fd, const char *name, + void *value, size_t size) +{ + return fgetxattr(fd, name, value, size); +} + +ssize_t flistxattrat_nofollow(int dirfd, const char *filename, + char *list, size_t size) +{ + char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); + int ret; + + ret =3D llistxattr(proc_path, list, size); + g_free(proc_path); + return ret; +} + +ssize_t fremovexattrat_nofollow(int dirfd, const char *filename, + const char *name) +{ + char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); + int ret; + + ret =3D lremovexattr(proc_path, name); + g_free(proc_path); + return ret; +} + +int fsetxattrat_nofollow(int dirfd, const char *filename, const char *name, + void *value, size_t size, int flags) +{ + char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); + int ret; + + ret =3D lsetxattr(proc_path, name, value, size, flags); + g_free(proc_path); + return ret; +} diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index dc0d2e2..cb26343 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -58,7 +58,13 @@ static inline int openat_file(int dirfd, const char *nam= e, int flags, =20 ssize_t fgetxattrat_nofollow(int dirfd, const char *path, const char *name, void *value, size_t size); +ssize_t fgetxattr_follow(int fd, const char *name, + void *value, size_t size); int fsetxattrat_nofollow(int dirfd, const char *path, const char *name, void *value, size_t size, int flags); +ssize_t flistxattrat_nofollow(int dirfd, const char *filename, + char *list, size_t size); +ssize_t fremovexattrat_nofollow(int dirfd, const char *filename, + const char *name); =20 #endif diff --git a/hw/9pfs/9p-xattr.c b/hw/9pfs/9p-xattr.c index d05c1a1..c696d8f 100644 --- a/hw/9pfs/9p-xattr.c +++ b/hw/9pfs/9p-xattr.c @@ -60,17 +60,6 @@ ssize_t pt_listxattr(FsContext *ctx, const char *path, return name_size; } =20 -static ssize_t flistxattrat_nofollow(int dirfd, const char *filename, - char *list, size_t size) -{ - char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); - int ret; - - ret =3D llistxattr(proc_path, list, size); - g_free(proc_path); - return ret; -} - /* * Get the list and pass to each layer to find out whether * to send the data or not @@ -196,17 +185,6 @@ ssize_t pt_getxattr(FsContext *ctx, const char *path, = const char *name, return local_getxattr_nofollow(ctx, path, name, value, size); } =20 -int fsetxattrat_nofollow(int dirfd, const char *filename, const char *name, - void *value, size_t size, int flags) -{ - char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); - int ret; - - ret =3D lsetxattr(proc_path, name, value, size, flags); - g_free(proc_path); - return ret; -} - ssize_t local_setxattr_nofollow(FsContext *ctx, const char *path, const char *name, void *value, size_t size, int flags) @@ -235,17 +213,6 @@ int pt_setxattr(FsContext *ctx, const char *path, cons= t char *name, void *value, return local_setxattr_nofollow(ctx, path, name, value, size, flags); } =20 -static ssize_t fremovexattrat_nofollow(int dirfd, const char *filename, - const char *name) -{ - char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); - int ret; - - ret =3D lremovexattr(proc_path, name); - g_free(proc_path); - return ret; -} - ssize_t local_removexattr_nofollow(FsContext *ctx, const char *path, const char *name) { --=20 2.8.1 From nobody Sat Nov 1 22:30:13 2025 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 152731258561198.24705423217767; Fri, 25 May 2018 22:29:45 -0700 (PDT) Received: from localhost ([::1]:47824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRlw-0002Bc-S6 for importer@patchew.org; Sat, 26 May 2018 01:29:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgU-0006Ea-0G for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgS-0004Uy-Qe for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:05 -0400 Received: from mail-qt0-x230.google.com ([2607:f8b0:400d:c0d::230]:33908) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgS-0004Un-LU for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:04 -0400 Received: by mail-qt0-x230.google.com with SMTP id m5-v6so9196917qti.1 for ; Fri, 25 May 2018 22:24:04 -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 n128-v6sm17675166qkf.42.2018.05.25.22.24.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:02 -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=A4TQrWp3kDrJcgMcxZjv8LRUuTLW3pyHlIpxg9gCmpo=; b=T/5SHbgrhlle1AlsO97QFyxAmxxNBlQc52hbGYQ18JdruRMLxP1frrUdGGa4aG9KSj K+oxGuGWi4tuRyjLOfmVJmwbEZB3klUDnDfBgg8M33Wc9cVJAIcHSFeQvN56mpNsdfXg TBuOfeu7Km5TwGPwuawwUuy/zWwWUUlIy+2nO45eDHRwYgsY2ZvglRWWx7XcSUsCCFyD O51x0gjFl9KVWW3kAFurxKWw3kl3t4YWG2hkE1Oeziql8t2W8Rr3y4hPBTFd4kBkEqks DBtYUqx/pi1EkyRWPzWjhE9jlVOanGs6yjIrTOom7ND8w1wDXcUrd48XkBOm53Fx1v97 uT/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:in-reply-to:references; bh=A4TQrWp3kDrJcgMcxZjv8LRUuTLW3pyHlIpxg9gCmpo=; b=h7msbeaffLGL0LX1Wjy6F5KXJsgY0nJGG098FqGn4GwGL3RE3dkqVZb/H2SbOeyFqh txtAqZ26rsSquaOeu6wu+11yQC64EL57/wZ03j/OtrewHAurQAeFWU68SfSRxysb7n4f I6Xy8TMRH037tJtLvqXRD1Vdfd3hGYgS+Iq77FL6GJGr7Y6n2WAFZ54S08gTzbrbr53n BVZMiRyIFqfkJwjqJtW9YbuL0gDoNx8KGPrq5VVxTi+MCLqiZOekR118SPAw62KerR6a EapYMMpMQGA+Mvih9UA7jZaQ6dZ9uEONLmdVag2yJvLhjnEpQcWEZUoPUB5L0nsLFmFU J7PA== X-Gm-Message-State: ALKqPwd1GLxZgq/c08pD0/BXr09vP8O8suGmZUXoCv79y+iLL0t6nE4O 0zc67zPzhLalsVX3vuT/wyTzvjHQxeA= X-Google-Smtp-Source: ADUXVKLExPFtenjkN7tQu8BLbqeN9NaaoKotmyjCBG2BR9fiN9uAi7Rps4rXk9m0TrSXvRYu2v8RgA== X-Received: by 2002:ac8:41d5:: with SMTP id o21-v6mr4898156qtm.207.1527312243682; Fri, 25 May 2018 22:24:03 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:06 -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::230 Subject: [Qemu-devel] [PATCH 04/13] 9p: darwin: Handle struct stat(fs) differences 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 , 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" From: Keno Fischer Signed-off-by: Keno Fischer --- fsdev/file-op-9p.h | 4 ++++ hw/9pfs/9p-proxy.c | 17 ++++++++++++++--- hw/9pfs/9p-synth.c | 2 ++ hw/9pfs/9p.c | 16 ++++++++++++++-- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index a13e729..cf9d18d 100644 --- a/fsdev/file-op-9p.h +++ b/fsdev/file-op-9p.h @@ -19,6 +19,10 @@ #ifdef CONFIG_LINUX #include #endif +#ifdef CONFIG_DARWIN +# include +# include +#endif #include "qemu-fsdev-throttle.h" =20 #define SM_LOCAL_MODE_BITS 0600 diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index e2e0329..d4572fb 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -117,10 +117,15 @@ static void prstatfs_to_statfs(struct statfs *stfs, P= roxyStatFS *prstfs) stfs->f_bavail =3D prstfs->f_bavail; stfs->f_files =3D prstfs->f_files; stfs->f_ffree =3D prstfs->f_ffree; +#ifdef CONFIG_DARWIN + stfs->f_fsid.val[0] =3D prstfs->f_fsid[0] & 0xFFFFFFFFU; + stfs->f_fsid.val[1] =3D prstfs->f_fsid[1] >> 32 & 0xFFFFFFFFU; +#else stfs->f_fsid.__val[0] =3D prstfs->f_fsid[0] & 0xFFFFFFFFU; stfs->f_fsid.__val[1] =3D prstfs->f_fsid[1] >> 32 & 0xFFFFFFFFU; stfs->f_namelen =3D prstfs->f_namelen; stfs->f_frsize =3D prstfs->f_frsize; +#endif } =20 /* Converts proxy_stat structure to VFS stat structure */ @@ -137,12 +142,18 @@ static void prstat_to_stat(struct stat *stbuf, ProxyS= tat *prstat) stbuf->st_size =3D prstat->st_size; stbuf->st_blksize =3D prstat->st_blksize; stbuf->st_blocks =3D prstat->st_blocks; - stbuf->st_atim.tv_sec =3D prstat->st_atim_sec; - stbuf->st_atim.tv_nsec =3D prstat->st_atim_nsec; + stbuf->st_atime =3D prstat->st_atim_sec; stbuf->st_mtime =3D prstat->st_mtim_sec; - stbuf->st_mtim.tv_nsec =3D prstat->st_mtim_nsec; stbuf->st_ctime =3D prstat->st_ctim_sec; +#ifdef CONFIG_DARWIN + stbuf->st_atimespec.tv_nsec =3D prstat->st_atim_nsec; + stbuf->st_mtimespec.tv_nsec =3D prstat->st_mtim_nsec; + stbuf->st_ctimespec.tv_nsec =3D prstat->st_ctim_nsec; +#else + stbuf->st_atim.tv_nsec =3D prstat->st_atim_nsec; + stbuf->st_mtim.tv_nsec =3D prstat->st_mtim_nsec; stbuf->st_ctim.tv_nsec =3D prstat->st_ctim_nsec; +#endif } =20 /* diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c index 54239c9..eb68b42 100644 --- a/hw/9pfs/9p-synth.c +++ b/hw/9pfs/9p-synth.c @@ -426,7 +426,9 @@ static int synth_statfs(FsContext *s, V9fsPath *fs_path, stbuf->f_bsize =3D 512; stbuf->f_blocks =3D 0; stbuf->f_files =3D synth_node_count; +#ifndef CONFIG_DARWIN stbuf->f_namelen =3D NAME_MAX; +#endif return 0; } =20 diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index d74302d..1cfdf7d 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -905,11 +905,17 @@ static void stat_to_v9stat_dotl(V9fsState *s, const s= truct stat *stbuf, v9lstat->st_blksize =3D stbuf->st_blksize; v9lstat->st_blocks =3D stbuf->st_blocks; v9lstat->st_atime_sec =3D stbuf->st_atime; - v9lstat->st_atime_nsec =3D stbuf->st_atim.tv_nsec; v9lstat->st_mtime_sec =3D stbuf->st_mtime; - v9lstat->st_mtime_nsec =3D stbuf->st_mtim.tv_nsec; v9lstat->st_ctime_sec =3D stbuf->st_ctime; +#ifdef CONFIG_DARWIN + v9lstat->st_atime_nsec =3D stbuf->st_atimespec.tv_nsec; + v9lstat->st_mtime_nsec =3D stbuf->st_mtimespec.tv_nsec; + v9lstat->st_ctime_nsec =3D stbuf->st_ctimespec.tv_nsec; +#else + v9lstat->st_atime_nsec =3D stbuf->st_atim.tv_nsec; + v9lstat->st_mtime_nsec =3D stbuf->st_mtim.tv_nsec; v9lstat->st_ctime_nsec =3D stbuf->st_ctim.tv_nsec; +#endif /* Currently we only support BASIC fields in stat */ v9lstat->st_result_mask =3D P9_STATS_BASIC; =20 @@ -2950,9 +2956,15 @@ static int v9fs_fill_statfs(V9fsState *s, V9fsPDU *p= du, struct statfs *stbuf) f_bavail =3D stbuf->f_bavail/bsize_factor; f_files =3D stbuf->f_files; f_ffree =3D stbuf->f_ffree; +#ifdef CONFIG_DARWIN + fsid_val =3D (unsigned int)stbuf->f_fsid.val[0] | + (unsigned long long)stbuf->f_fsid.val[1] << 32; + f_namelen =3D MAXNAMLEN; +#else fsid_val =3D (unsigned int) stbuf->f_fsid.__val[0] | (unsigned long long)stbuf->f_fsid.__val[1] << 32; f_namelen =3D stbuf->f_namelen; +#endif =20 return pdu_marshal(pdu, offset, "ddqqqqqqd", f_type, f_bsize, f_blocks, f_bfree, --=20 2.8.1 From nobody Sat Nov 1 22:30:13 2025 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 1527312449843737.6503596873453; Fri, 25 May 2018 22:27:29 -0700 (PDT) Received: from localhost ([::1]:47815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRjl-0000TI-3A for importer@patchew.org; Sat, 26 May 2018 01:27:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgV-0006FX-92 for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgU-0004Vc-2s for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:07 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:42997) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgT-0004VL-Ut for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:06 -0400 Received: by mail-qt0-x241.google.com with SMTP id c2-v6so9177445qtn.9 for ; Fri, 25 May 2018 22:24:05 -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 n128-v6sm17675166qkf.42.2018.05.25.22.24.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:04 -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=x977hr+RdmnR+12WiHOXzE3IjJrpojHT9P2ugtsq2SM=; b=dJ3LAovSsWKlP6do3iCTbs8MTBD3/oFLkb/ef4/64QROEFhO1lKDpc882wNrRcrJsm niSsmI6B2jnOvDe/PPtK9LTLGumb/8F0nY9gbYJtP8XFdMLti7qgq0P2wtRiZmekjmhl vwPT/5iiVrvzH4NCXissZBeGqkqf+2OGwgjXCM9cZpNzkj1t0LtXWjFxtHjIiLljjbxe ddoETRFXy3S1l8NuywAMVl9sATQdP/z8RWPDsuEMugHLS5cnD8tdUo3kKZkbjExQogFu 5lRASUB5wKUQs6GZTvuvcNbA40EEssxIPUPL66ydH3EiOqKCO5uktNTEJ8GjZ/f2Zipx t6/A== 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=x977hr+RdmnR+12WiHOXzE3IjJrpojHT9P2ugtsq2SM=; b=Qa+U/L1OVXiCi8kEorEqeHS96dtGdGAzIO06P266g4crmONDKckgBAHOL2UbT5l1Us h2DW/wNBxDsAUBMmrryISxhbSAkSt0gz3zbZuK9120DQQbvgaPdny5p5qKFgfLNrmjIl DD3SkcJ7Y9xyE5gvnCwP6rDqQSkvOTEHf/SQg3k1xHSWQMmdPzK+FfDkvgnF454JFBaA Fzh8R8e4G5X58fHV/jalqgwIqxvAyDj5Y/UMACyymBZ3zTJ04Ph15bB3rvUGJpsCWwNM 2TDGocQNMKNZCVIeR1OfElMqw0pORKolBLY2KzvT8/80jDJkzKof8WLNRa9A0rSoZSwH Clyg== X-Gm-Message-State: ALKqPwfInt3+J/e2MClrcuGSvmn8ZjhZ1ZgvnY9/jPSemEoBTLdDYpxs 2daAwb7SkBlw4YzunqjXXY2mad5Sjto= X-Google-Smtp-Source: ADUXVKKHCemlhSl1Dv0Ek1ZY7JhmdprOoaBit4ICooyj+oIADwBuWng5xBA0lE8quo5cV/4GWoYZLg== X-Received: by 2002:ac8:1842:: with SMTP id n2-v6mr688476qtk.124.1527312245007; Fri, 25 May 2018 22:24:05 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:07 -0400 Message-Id: <6205f39b495ee7356478cc53faf5e32289f57182.1527310210.git.keno@alumni.harvard.edu> 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::241 Subject: [Qemu-devel] [PATCH 05/13] 9p: darwin: Handle struct dirent differences 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 , 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" From: Keno Fischer Signed-off-by: Keno Fischer --- hw/9pfs/9p-synth.c | 4 ++++ hw/9pfs/9p.c | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c index eb68b42..3c0a6d8 100644 --- a/hw/9pfs/9p-synth.c +++ b/hw/9pfs/9p-synth.c @@ -221,7 +221,11 @@ static void synth_direntry(V9fsSynthNode *node, { strcpy(entry->d_name, node->name); entry->d_ino =3D node->attr->inode; +#ifdef CONFIG_DARWIN + entry->d_seekoff =3D off + 1; +#else entry->d_off =3D off + 1; +#endif } =20 static struct dirent *synth_get_dentry(V9fsSynthNode *dir, diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 1cfdf7d..49654ae 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1801,7 +1801,11 @@ static int coroutine_fn v9fs_do_readdir_with_stat(V9= fsPDU *pdu, count +=3D len; v9fs_stat_free(&v9stat); v9fs_path_free(&path); +#ifdef CONFIG_DARWIN + saved_dir_pos =3D v9fs_co_telldir(pdu, fidp); +#else saved_dir_pos =3D dent->d_off; +#endif } =20 v9fs_readdir_unlock(&fidp->fs.dir); @@ -1952,9 +1956,19 @@ static int coroutine_fn v9fs_do_readdir(V9fsPDU *pdu= , V9fsFidState *fidp, qid.type =3D 0; qid.version =3D 0; =20 +#ifdef CONFIG_DARWIN + // Darwin has d_seekoff, which appears to function + // analogously to d_off. However, it does not appear + // to be supported on all file systems, so use + // telldir for correctness. + off_t off =3D v9fs_co_telldir(pdu, fidp); +#else + off_t off =3D dent->d_off; +#endif + /* 11 =3D 7 + 4 (7 =3D start offset, 4 =3D space for storing count= ) */ len =3D pdu_marshal(pdu, 11 + count, "Qqbs", - &qid, dent->d_off, + &qid, off, dent->d_type, &name); =20 v9fs_readdir_unlock(&fidp->fs.dir); @@ -1966,7 +1980,7 @@ static int coroutine_fn v9fs_do_readdir(V9fsPDU *pdu,= V9fsFidState *fidp, } count +=3D len; v9fs_string_free(&name); - saved_dir_pos =3D dent->d_off; + saved_dir_pos =3D off; } =20 v9fs_readdir_unlock(&fidp->fs.dir); --=20 2.8.1 From nobody Sat Nov 1 22:30:13 2025 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 1527312370387431.0924711134377; Fri, 25 May 2018 22:26:10 -0700 (PDT) Received: from localhost ([::1]:47805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRiT-0007hv-Iu for importer@patchew.org; Sat, 26 May 2018 01:26:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgW-0006GO-Fr for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgV-0004WZ-Hs for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:08 -0400 Received: from mail-qt0-x229.google.com ([2607:f8b0:400d:c0d::229]:33228) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgV-0004W1-Db for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:07 -0400 Received: by mail-qt0-x229.google.com with SMTP id e8-v6so9196376qth.0 for ; Fri, 25 May 2018 22:24:07 -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 n128-v6sm17675166qkf.42.2018.05.25.22.24.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:05 -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=y1Lh5P2tzH4me3dG7tsoOK6wEE0ySr1pMNA1qm6ppZc=; b=TM4yZrWgdu19XUjAzokiFIa+Efu0AH6ZZ1VR7waXsr8xzejtIve2DOR18MYsDZYbaI y40dyBvpdRodX8zi93AXgy1qguBa4ZQf+No5EvtYeLh4z2ClUnI81GroUBcTKQ4zPnLK k9/CHUqzUzNsrM38tJ8adJkwSi7e0LCsFEHPvt6EIPBXCjaYLKEcqwAJcldrrbbcigxf ZNW94KAfrsxzgXtqNLjWBM4xnHvCMBsBUhzDpP0T5cCWF1Sh30+KZgXixKQlGFOZVMjn nZrkukW51R82lb46akF72olL6UUAzMVSRukSF/ac26Xg3d60Hf2gobohJJA+f7OSxlXL DTNQ== 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=y1Lh5P2tzH4me3dG7tsoOK6wEE0ySr1pMNA1qm6ppZc=; b=di18BAK9c7uJrKJAMcRtm83LCbuvPUHdYPQJr6qfb3AkBtClS456eSwMu6Rx3oTb4k 81ViW7dPQ+T+SbPolXZpqzDXCGww4zDbp4pdJXf6H+dbQIAlreMgidUAkYdxGCrCQLW/ dR9G8NsV4SRtNlMPmNd6vvnN3a1HlKAbdzh0fyBGcEbiEqVbQUYRd4QyF4Ml9gyvzuOA JKi3y8E7MnEDcRuxqD2NJNqO6UAWAox85lxaeVhFvcTBJN49mJrY6CyRl5KS5lplOnBq Ew9HZXbofHMJx7cuz2W+Wzm1Bk2kTd8u+sEkcHvnDo+2E2kb188hMlJ/wHnIKwi/9uyu NPhw== X-Gm-Message-State: ALKqPweb5I21vAL6UzrK+sIu/ZnSl0E+q7s+9htr4jG0+TcM+0n/VGPp U/GF6oY4DDyx4wM/WhVFl5W1F0NepPQ= X-Google-Smtp-Source: ADUXVKJcBJwKWOrRf30mk5czzQ0Y+XuGmOq2jc7MqzxGALmvkPyNV/StsdVBZxB7Mo004gn4MaXOlw== X-Received: by 2002:aed:2501:: with SMTP id v1-v6mr5192952qtc.66.1527312246485; Fri, 25 May 2018 22:24:06 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:08 -0400 Message-Id: <17b8b06c00e359d1cb71b883371ad8c677a0e477.1527310210.git.keno@alumni.harvard.edu> 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::229 Subject: [Qemu-devel] [PATCH 06/13] 9p: darwin: Address minor differences 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 , 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" From: Keno Fischer - Darwin doesn't have strchrnul - Comparisons of mode_t with -1 require an explicit cast, since mode_t is unsigned on Darwin. Signed-off-by: Keno Fischer --- hw/9pfs/9p-local.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index fd65d04..6e0b2e8 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -67,7 +67,10 @@ int local_open_nofollow(FsContext *fs_ctx, const char *p= ath, int flags, assert(*path !=3D '/'); =20 head =3D g_strdup(path); - c =3D strchrnul(path, '/'); + /* equivalent to strchrnul(), but that is not available on Darwin = */ + c =3D strchr(path, '/'); + if (!c) + c =3D path + strlen(path); if (*c) { /* Intermediate path element */ head[c - path] =3D 0; @@ -310,7 +313,7 @@ update_map_file: if (credp->fc_gid !=3D -1) { gid =3D credp->fc_gid; } - if (credp->fc_mode !=3D -1) { + if (credp->fc_mode !=3D (mode_t)-1) { mode =3D credp->fc_mode; } if (credp->fc_rdev !=3D -1) { @@ -416,7 +419,7 @@ static int local_set_xattrat(int dirfd, const char *pat= h, FsCred *credp) return err; } } - if (credp->fc_mode !=3D -1) { + if (credp->fc_mode !=3D (mode_t)-1) { uint32_t tmp_mode =3D cpu_to_le32(credp->fc_mode); err =3D fsetxattrat_nofollow(dirfd, path, "user.virtfs.mode", &tmp= _mode, sizeof(mode_t), 0); --=20 2.8.1 From nobody Sat Nov 1 22:30:13 2025 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 1527312557803645.4005677684011; Fri, 25 May 2018 22:29:17 -0700 (PDT) Received: from localhost ([::1]:47823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRlU-0001o5-31 for importer@patchew.org; Sat, 26 May 2018 01:29:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgZ-0006JN-Nf for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgW-0004Xj-Oj for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:11 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:38175) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgW-0004XT-KG for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:08 -0400 Received: by mail-qt0-x241.google.com with SMTP id m9-v6so9187948qtb.5 for ; Fri, 25 May 2018 22:24:08 -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 n128-v6sm17675166qkf.42.2018.05.25.22.24.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:06 -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=e7r3yzMhtjcJ6xD6ewGNWlNtpd1fCg7F+3M56mnaSjU=; b=i9F9yoGWC3MUtixihmbJ9AgcVmH44Z/lOqI4/gxXSpLg9i1/sl/VOJL5OWjcuTB9hT B7XT2Bh8VndOCdfXuOMXdJEGXmnwSH0mA1VU2Tm2VnPY2koEMOBiXTQ5w+eLPfwI96ir JkJE/nAKiVOweZ7zPSZYrga/YgpYg5iEdZrHUir9Xky81Vw+l1orj+cYqhxUf0VOEWgH 5vaLb75RtCRooLplSiW5BnECXWxlwy+taE6Tk6wvWh1DEAw8HzGlOyl9e1PjfO4EwJRP AXZ2+TSNhGsvsj69ROC4xOXhi1bfOUqi54MJ1LPb87vmU4u5p6Jrci7l5W1t1l7SkWXt rs7g== 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=e7r3yzMhtjcJ6xD6ewGNWlNtpd1fCg7F+3M56mnaSjU=; b=mt0p8yItrlatMXJKiM4QEjD4bCOY/UZoJ4yrm8Ls4iZW3zpJfllhgP3UbJ1Nl7e8Bo 9baZxPAlMP0mL33hLMMqyCX2Ps2OlwwqOu7buJzeIBxQ4XeZDF3hmDLV2hXVEFJn1TOs ESbt2ruRhQ3NDutrB5tzCGZyazC3gfxv2t2LtuUWPj5bNV/sdhYvG5K/UeDPTphEcEKI S8RymHg+K9dzEoTUikrC4yb2KhbGehT63pUZnW3bVqJN2xpA55K4ZGpzv2W4dAF9KtoO OBlnE1FoNhq/0HR+DiD+Bf8O7OMfL4SHL6cH3BClC9h6jMN8yA+AJsJmdyeLpXFf1XBQ av7g== X-Gm-Message-State: ALKqPwed6tS4ZP+vyGBtQXNt64zBKla/jR3qgHQgUuhFis1A06c4Cxnh LBcWauPuzUIlDq4pWIWX4NJ4yQl0yMY= X-Google-Smtp-Source: ADUXVKJHsi9FlLOyaMPMrJGstMUUyDUzPbeHPuEQi9FKL2dfhWMh9agsXTnu7ppyf6tlFE4E6NJZDQ== X-Received: by 2002:aed:3a46:: with SMTP id n64-v6mr5091676qte.118.1527312247714; Fri, 25 May 2018 22:24:07 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:09 -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::241 Subject: [Qemu-devel] [PATCH 07/13] 9p: darwin: Properly translate AT_REMOVEDIR flag 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 , 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" From: Keno Fischer This code relied on P9_DOTL_AT_REMOVEDIR and AT_REMOVEDIR having the same numerical value, but on Darwin, they do not. Signed-off-by: Keno Fischer --- hw/9pfs/9p-local.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 6e0b2e8..c55ea25 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1376,7 +1376,17 @@ static int local_unlinkat(FsContext *ctx, V9fsPath *= dir, return -1; } =20 - ret =3D local_unlinkat_common(ctx, dirfd, name, flags); + if ((flags & ~P9_DOTL_AT_REMOVEDIR) !=3D 0) { + errno =3D EINVAL; + return -1; + } + + size_t rflags =3D 0; + if (flags & P9_DOTL_AT_REMOVEDIR) { + rflags |=3D AT_REMOVEDIR; + } + + ret =3D local_unlinkat_common(ctx, dirfd, name, rflags); close_preserve_errno(dirfd); return ret; } --=20 2.8.1 From nobody Sat Nov 1 22:30:13 2025 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 1527312698466352.9659917932173; Fri, 25 May 2018 22:31:38 -0700 (PDT) Received: from localhost ([::1]:47835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRnl-0003WJ-Ok for importer@patchew.org; Sat, 26 May 2018 01:31:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgZ-0006JM-NN for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgY-0004Yc-D9 for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:11 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:34353) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgY-0004YN-8B for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:10 -0400 Received: by mail-qt0-x243.google.com with SMTP id m5-v6so9197041qti.1 for ; Fri, 25 May 2018 22:24:10 -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 n128-v6sm17675166qkf.42.2018.05.25.22.24.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:08 -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=jKZ5lyBCnV4M1rADF9tpYxwiabOh0IQ8d9g0WAhpSks=; b=ScK6JBVKQwkVqCYAHuj/mmsEl3yJfleMYZxkhzCqFVVpj5BSROrQHBD8T/Pg6c0tm+ XiUNgPYRqYXQGwVJ8SzzWTygVj/pyOa9eGMR4cskaH0cMWnhnojv8bG/T+G7nEylFbTT AqI4tB1uPpZSFDAJGXXae23VRCmwsuXieVT/ZR+bsAO1z3od3CxHZ8++RBMygn/3zw9L C81n91f3f0N/BSoDQmxXdHZyC1LBUSElRLYL2ZzNMSWj53d/uXnUbG9H2t4S7aTXkZeM ZIEjxnl/ZW/3rhVuxfnZ6ex6VHUHiXextkBhETwNzVa3jmcavEeeZUFUtaH2rpD6T5x5 mNFg== 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=jKZ5lyBCnV4M1rADF9tpYxwiabOh0IQ8d9g0WAhpSks=; b=UTjQkquQcNP3FoxTCNra/PYCbYsoQaaycXty2xvo1086+MWsu6B7cpx4iWMHaVH/Mm JHdLaK3VbhtYLG4+trmhx25qY9I7jsFJ+O5AZBk8/seo3FF5invZcWG61OPIUn2357O4 LsvUpKZWgnLgbb74vzJiVFHwJ8w6ivI5EBtyiapZkaSQTdzbIkrbf4cjYMp4DzNHncEJ M69Q/jhpLz9gx7I0UI5dQnZo3kWE2TLNf/NzkGRXhWrwqyah2Qp2puiTlnSdx8gnU04f fSlliytsxeERbsB7vtKXG421Zn1r6TW2awapyXvgBL0uvmH5H0DnPL6EgSDUqCsUbj11 gZtw== X-Gm-Message-State: ALKqPwfNGeGm3A16GFVj4g5tDbruldJWe2zQaW3TvmJFovKApFb18pjz tvWy3mEG0u4GaIqbJM5eelXoeMlg/gM= X-Google-Smtp-Source: ADUXVKIij2igUD5Yo7eq1QdixnIQXWa07xNXNjafpvC1pjXxiPIuLf6ZjYaTIAvwnoxa1jP4D9cKZg== X-Received: by 2002:ac8:530d:: with SMTP id t13-v6mr4932487qtn.388.1527312249331; Fri, 25 May 2018 22:24:09 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:10 -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::243 Subject: [Qemu-devel] [PATCH 08/13] 9p: darwin: Ignore O_{NOATIME, DIRECT} 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 , 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" From: Keno Fischer Signed-off-by: Keno Fischer --- hw/9pfs/9p.c | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 49654ae..f5f00aa 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -115,20 +115,27 @@ static int dotl_to_open_flags(int flags) int oflags =3D flags & O_ACCMODE; =20 DotlOpenflagMap dotl_oflag_map[] =3D { - { P9_DOTL_CREATE, O_CREAT }, - { P9_DOTL_EXCL, O_EXCL }, - { P9_DOTL_NOCTTY , O_NOCTTY }, - { P9_DOTL_TRUNC, O_TRUNC }, - { P9_DOTL_APPEND, O_APPEND }, - { P9_DOTL_NONBLOCK, O_NONBLOCK } , - { P9_DOTL_DSYNC, O_DSYNC }, - { P9_DOTL_FASYNC, FASYNC }, - { P9_DOTL_DIRECT, O_DIRECT }, - { P9_DOTL_LARGEFILE, O_LARGEFILE }, - { P9_DOTL_DIRECTORY, O_DIRECTORY }, - { P9_DOTL_NOFOLLOW, O_NOFOLLOW }, - { P9_DOTL_NOATIME, O_NOATIME }, - { P9_DOTL_SYNC, O_SYNC }, + {P9_DOTL_CREATE, O_CREAT}, + {P9_DOTL_EXCL, O_EXCL}, + {P9_DOTL_NOCTTY, O_NOCTTY}, + {P9_DOTL_TRUNC, O_TRUNC}, + {P9_DOTL_APPEND, O_APPEND}, + {P9_DOTL_NONBLOCK, O_NONBLOCK}, + {P9_DOTL_DSYNC, O_DSYNC}, + {P9_DOTL_FASYNC, FASYNC}, +#ifndef CONFIG_DARWIN + {P9_DOTL_NOATIME, O_NOATIME}, + /* On Darwin, we could map to F_NOCACHE, which is + similar, but doesn't quite have the same + semantics. However, we don't support O_DIRECT + even on linux at the moment, so we just ignore + it here. */ + {P9_DOTL_DIRECT, O_DIRECT}, +#endif + {P9_DOTL_LARGEFILE, O_LARGEFILE}, + {P9_DOTL_DIRECTORY, O_DIRECTORY}, + {P9_DOTL_NOFOLLOW, O_NOFOLLOW}, + {P9_DOTL_SYNC, O_SYNC}, }; =20 for (i =3D 0; i < ARRAY_SIZE(dotl_oflag_map); i++) { @@ -156,10 +163,12 @@ static int get_dotl_openflags(V9fsState *s, int oflag= s) */ flags =3D dotl_to_open_flags(oflags); flags &=3D ~(O_NOCTTY | O_ASYNC | O_CREAT); +#ifndef CONFIG_DARWIN /* * Ignore direct disk access hint until the server supports it. */ flags &=3D ~O_DIRECT; +#endif return flags; } =20 --=20 2.8.1 From nobody Sat Nov 1 22:30:13 2025 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527312670348305.12353624789387; Fri, 25 May 2018 22:31:10 -0700 (PDT) Received: from localhost ([::1]:47834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRnC-0003CH-IE for importer@patchew.org; Sat, 26 May 2018 01:31:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRga-0006KC-IX for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgZ-0004ZI-Oy for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:12 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:39266) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgZ-0004Z0-LD for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:11 -0400 Received: by mail-qt0-x243.google.com with SMTP id f1-v6so9181665qtj.6 for ; Fri, 25 May 2018 22:24:11 -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 n128-v6sm17675166qkf.42.2018.05.25.22.24.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:10 -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=bMxnpvfgpWGcRCCNKLd+6a2eFViDboYL7SuVLurzTk4=; b=ajl5kBs9JwoJ03LA3HM/7vwaf1F+iepkNRPVxqnEnBnayGg+yddpy1Mj/FWL8qqjJq RJ4XG2Ktyg4vu5R0+2soBfArzh56P2liFSe7slpqu+8fxsgG1sSv/WVaLp9pSwxWQTU+ d9013WX7O5d/RsuzAn3rFVfeLgftm9lvgoVMV6S+DPDJ/mdiauFLTcSRktPN+OUyBeAJ tnhAZuNWeeL+tcLcP7IYKeoa150kinb0M2dBW9jx1Cwkgmaepi0727cZWgz/0e3RSRGh 3mWaRcN2tmS3kmg6yMLCPHWzk3i17TfDEJJo/J0uOGxU5495wSW0MU0CF82pVtGzKm9e tqqg== 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=bMxnpvfgpWGcRCCNKLd+6a2eFViDboYL7SuVLurzTk4=; b=VoWIjtvamnkjYPIcva7hfoHtuw3ru+7FcgRqDX0uSeUO78xUvwEbSbOfsaKp/gzGH7 CRihzr7tHKNjI0xiykFlasxGkJwJu9LHuYn7nTXafskmpPuLKHPraanUQ2xPQJEadCFl iXUNLV+mtbng3yku9bfW6SF523uBlBtestDve2X6zOwFEec6BodL0ctI4TAZx9vgEsE4 7goL5OyKDOch9iRzyCGV/UFwydu6gut4mpzAaR7D0k0uOc3VHBTMb8kjFhWxubz79+cT UCF9+r15/pxeLLkVtfMf5Jeh6XD+u5ABo7F0hc5oTFUaMqKIVWwQEENAEsytSRagBe5j /6WA== X-Gm-Message-State: ALKqPwdK6TcF8Id2SguD8UNM1qLUfEubUwijRTuHiO/ztlOEUS/zmpWb pY2id/tOpZGexO7hIBYE3aLAceSH+Xw= X-Google-Smtp-Source: ADUXVKJ2cerxvYaSqH6S86E5H6+u4QKzsTB/bYAPjC+i56NQMIuyW070FBZce1RvBbWGCcyCCv9FwA== X-Received: by 2002:ac8:12c1:: with SMTP id b1-v6mr4986496qtj.164.1527312250781; Fri, 25 May 2018 22:24:10 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:11 -0400 Message-Id: <305501d80a62cc12e0d82a2ffd656819badd0d4d.1527310210.git.keno@alumni.harvard.edu> 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::243 Subject: [Qemu-devel] [PATCH 09/13] 9p: darwin: Provide a compatibility definition for XATTR_SIZE_MAX 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 , 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" From: Keno Fischer Signed-off-by: Keno Fischer --- hw/9pfs/9p.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index f5f00aa..4ae4da6 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3351,6 +3351,13 @@ out_nofid: v9fs_string_free(&name); } =20 +#if defined(CONFIG_DARWIN) && !defined(XATTR_SIZE_MAX) +/* Darwin doesn't seem to define a maximum xattr size in its user + user space header, but looking at the kernel source, HFS supports + up to INT32_MAX, so use that as the maximum. +*/ +#define XATTR_SIZE_MAX INT32_MAX +#endif static void coroutine_fn v9fs_xattrcreate(void *opaque) { int flags; --=20 2.8.1 From nobody Sat Nov 1 22:30:13 2025 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 1527312784921140.82475197097733; Fri, 25 May 2018 22:33:04 -0700 (PDT) Received: from localhost ([::1]:47840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRpA-0004Mg-7A for importer@patchew.org; Sat, 26 May 2018 01:33:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgc-0006MG-DC for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgb-0004ar-Ec for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:14 -0400 Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]:45074) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgb-0004aD-AZ for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:13 -0400 Received: by mail-qk0-x232.google.com with SMTP id c198-v6so5676569qkg.12 for ; Fri, 25 May 2018 22:24:13 -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 n128-v6sm17675166qkf.42.2018.05.25.22.24.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:11 -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=iuAUA++ABcIYYB0QNoTZ4KtxjVeZlALxuFtCdhGutBU=; b=iRtdmAIJ4ZYJBivyftP318H1EOKFfM/IfQ1hVHiuO+WlRmGTk0uCyBy+5sr43HjUWA OOwPLs0zz0DL1iAgHB3HXqb7nqA/KVGLp1qW/qUD0Q9VMBgLz2U3Wp4eVTBDBRS3l1fx cuGr6nq73XEOzqvcXIHwpZ5sH+SGz2JqYPPjGyJSkg87myn6j6YGyytULeDOBxpqRg2G p2eC+cyS+zPnNioLMpoUeypylmQWg30b5OsetCrbwBeefpgPuca1JpsHVE9EfT0v9kmP akvwJHvahiOWN9NJ7gIQCjVVjOlecO7Xym68Yj+iLCO/nsApqmWhQ9E5ut/BZ5FyOomf HlIg== 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=iuAUA++ABcIYYB0QNoTZ4KtxjVeZlALxuFtCdhGutBU=; b=JC6rbpR9+2yvhZ3ZuTDgIHpm6yPojnMsrmsreD8NhKuZpF0n7mZzgCySW80yBuRFoR PLrJjislmMsmau3qkEMwgBxUM3hsWaWPIY+NqlBMfVQ0/CW1xRTqwikmqdcMqQLeHNBk fHSL4kHygR1ZzQTYxvtz6jBpxAYtdqyb34Di15KipP3ZCXCajYZT6lpHzRPBbzXfXl+C FkwP8+81Gp7OmnOQY7wwvhVh9gtSxg5b0emX1Zg0ZkFVb9gGwHcRwS/9CPriTU/7KbCS yQz4H6FTcyvJPjMmiBgmnduaWdvI59+1ZlbIMz0HmYpCIVYYKXeYLyC9MF/Nmqlpr16v snow== X-Gm-Message-State: ALKqPwc3pbRi7/OtUboQLAyHDLft/yPJHMnX5LoxbNq8PpvXHwzudck3 4t3ApyIAjG6xplgUqKYiHHzmQnQ5uiA= X-Google-Smtp-Source: ADUXVKIwl658Dbw2GqOE6GS/lplONjyC0/IjojFE/r3vtwcniCI73W11WrvPWPxO5zg2i+VR9Bekmg== X-Received: by 2002:a37:cf82:: with SMTP id v2-v6mr4664796qkl.67.1527312252387; Fri, 25 May 2018 22:24:12 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:12 -0400 Message-Id: <981de427dbb657d58d08f216b40255b132cb1596.1527310210.git.keno@alumni.harvard.edu> 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:c09::232 Subject: [Qemu-devel] [PATCH 10/13] 9p: darwin: *xattr_nofollow implementations 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 , 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" From: Keno Fischer Signed-off-by: Keno Fischer --- hw/9pfs/9p-util.c | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/hw/9pfs/9p-util.c b/hw/9pfs/9p-util.c index 8cf5554..98004ac 100644 --- a/hw/9pfs/9p-util.c +++ b/hw/9pfs/9p-util.c @@ -17,49 +17,90 @@ ssize_t fgetxattrat_nofollow(int dirfd, const char *filename, const char *= name, void *value, size_t size) { - char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); int ret; +#ifdef CONFIG_DARWIN + int fd =3D openat_file(dirfd, filename, O_RDONLY | O_PATH_9P_UTIL | O_= NOFOLLOW, 0); + if (fd =3D=3D -1) + return -1; + + ret =3D fgetxattr(fd, name, value, size, 0, XATTR_NOFOLLOW); + close_preserve_errno(fd); +#else + char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); =20 ret =3D lgetxattr(proc_path, name, value, size); g_free(proc_path); +#endif return ret; } =20 ssize_t fgetxattr_follow(int fd, const char *name, void *value, size_t size) { +#ifdef CONFIG_DARWIN + return fgetxattr(fd, name, value, size, 0, 0); +#else return fgetxattr(fd, name, value, size); +#endif } =20 ssize_t flistxattrat_nofollow(int dirfd, const char *filename, char *list, size_t size) { - char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); int ret; +#ifdef CONFIG_DARWIN + int fd =3D openat_file(dirfd, filename, O_RDONLY | O_PATH_9P_UTIL | O_= NOFOLLOW, 0); + if (fd =3D=3D -1) + return -1; + + ret =3D flistxattr(fd, list, size, XATTR_NOFOLLOW); + close_preserve_errno(fd); +#else + char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); =20 ret =3D llistxattr(proc_path, list, size); g_free(proc_path); +#endif return ret; } =20 ssize_t fremovexattrat_nofollow(int dirfd, const char *filename, const char *name) { - char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); int ret; +#ifdef CONFIG_DARWIN + int fd =3D openat_file(dirfd, filename, O_PATH_9P_UTIL | O_NOFOLLOW, 0= ); + if (fd =3D=3D -1) + return -1; + + ret =3D fremovexattr(fd, name, XATTR_NOFOLLOW); + close_preserve_errno(fd); + return ret; +#else + char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); =20 ret =3D lremovexattr(proc_path, name); g_free(proc_path); return ret; +#endif } =20 int fsetxattrat_nofollow(int dirfd, const char *filename, const char *name, void *value, size_t size, int flags) { - char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); int ret; +#ifdef CONFIG_DARWIN + int fd =3D openat_file(dirfd, filename, O_PATH_9P_UTIL | O_NOFOLLOW, 0= ); + if (fd =3D=3D -1) + return -1; + + ret =3D fsetxattr(fd, name, value, size, 0, XATTR_NOFOLLOW); + close_preserve_errno(fd); +#else + char *proc_path =3D g_strdup_printf("/proc/self/fd/%d/%s", dirfd, file= name); =20 ret =3D lsetxattr(proc_path, name, value, size, flags); g_free(proc_path); +#endif return ret; } --=20 2.8.1 From nobody Sat Nov 1 22:30:13 2025 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 1527312885057312.9662607590418; Fri, 25 May 2018 22:34:45 -0700 (PDT) Received: from localhost ([::1]:47845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRqm-0005bI-Bb for importer@patchew.org; Sat, 26 May 2018 01:34:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgd-0006Nh-U0 for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgd-0004bv-2c for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:15 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:41946) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgc-0004bl-To for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:14 -0400 Received: by mail-qk0-x243.google.com with SMTP id d125-v6so5668761qkb.8 for ; Fri, 25 May 2018 22:24:14 -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 n128-v6sm17675166qkf.42.2018.05.25.22.24.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:12 -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=QlUkPPb+CEDM2SF+CnNO/3lhtf1+mTNzPfw4mY7dXdU=; b=Y5cBhwGafwUjHNoCByUHCmuU+L3rdLMumooMuAQ13EANikmsfT8Axs/wBUBgS5BIm7 zNUrMIBkUDgs3iu1sTP4zpCtL082OwnLZdUsqvBcYWOCQg3fCdm/gS4/qlGcrqENKl6r DPLVQRFSsDIXrhwRItWWwdbSuZS/sm9K4PYsJlQt3R57J8FvMNWF2bwZAsUIiCkewgb0 ELhGYITVXixY2NpVxfTi/TboQyjZhmueqBgVwAKkWLayZvLJ/R3eg5mNAL4iR6a6iPvt F+Wjl1WvSgBXf9ekOQwQZ/RWDjMXiYDp5qDItN1buQHDV1r1567943urevMZ3z/wr323 wl/A== 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=QlUkPPb+CEDM2SF+CnNO/3lhtf1+mTNzPfw4mY7dXdU=; b=uYgiBc00qq7qD201WOjngvauE7rqzB0fbpvNUIIYo/k/wubJtRSKsrdyKpRbqXhnXQ aSnTvd5SHm96W+JnAeOGWRJRW3fSv5pSQucikr5yHrWY2iVzlX1uzuKt0Y6DTuv03r6L 5ZYYot6N4cytQBj8Df8tDYAqgvDNAC2i2UZ8yEuArfdo+Abt90EUK9xLWADYAi6ttOJo q+N5kiTVEcvZ1GalhAKA0GgwX95r8oBwcXlbT1HLhDNm1rG3F6CaJfIktTMb+AcKUAR6 QOdIAPic3XY0u49WapdGP/V5BpyQzMb/x++E5dWNr5eAt+6Rrdgb4MoNRdueptNZBh+F aEGA== X-Gm-Message-State: ALKqPwdapm+bQomUYh5oNgtEZq4SR7+D4hU9C5FscnpBgeWbDIrn1pg4 zb78Kh7xLYGY6AriBNFgl5slaMUeWJ8= X-Google-Smtp-Source: ADUXVKJSSU3vY4dc6uVdWF4keF7OsnC/i4iMSvWXXwIG7a3q1EZjMW4QLLEYY0/5mLdojO5vCkw3aA== X-Received: by 2002:a37:1f08:: with SMTP id f8-v6mr4600028qkf.304.1527312254002; Fri, 25 May 2018 22:24:14 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:13 -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:c09::243 Subject: [Qemu-devel] [PATCH 11/13] 9p: darwin: Mark mknod as unsupported 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 , 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" From: Keno Fischer Signed-off-by: Keno Fischer --- hw/9pfs/9p-local.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index c55ea25..3e358b7 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -669,6 +669,13 @@ static int local_mknod(FsContext *fs_ctx, V9fsPath *di= r_path, return -1; } =20 +#ifdef CONFIG_DARWIN + /* Darwin doesn't have mknodat and it's unlikely to work anyway, + so let's just mark it as unsupported */ + err =3D -1; + errno =3D EOPNOTSUPP; + goto out; +#else if (fs_ctx->export_flags & V9FS_SM_MAPPED || fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) { err =3D mknodat(dirfd, name, fs_ctx->fmode | S_IFREG, 0); @@ -699,6 +706,8 @@ static int local_mknod(FsContext *fs_ctx, V9fsPath *dir= _path, =20 err_end: unlinkat_preserve_errno(dirfd, name, 0); +#endif + out: close_preserve_errno(dirfd); return err; --=20 2.8.1 From nobody Sat Nov 1 22:30:13 2025 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 1527312820674124.65806127976259; Fri, 25 May 2018 22:33:40 -0700 (PDT) Received: from localhost ([::1]:47841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRpj-0004gl-VF for importer@patchew.org; Sat, 26 May 2018 01:33:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgf-0006PR-Md for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRge-0004dq-K5 for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:17 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:37439) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRge-0004d2-FD for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:16 -0400 Received: by mail-qk0-x244.google.com with SMTP id j12-v6so2334173qkk.4 for ; Fri, 25 May 2018 22:24:16 -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 n128-v6sm17675166qkf.42.2018.05.25.22.24.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:14 -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=+MHBuP7PRgoMyV40CRRVPL3AGLCyBQOL1uG7ZqRanfo=; b=bBBDWdvEcOdWHN96nWOH5bYlSftpvEPt8VQEGhIg+NHVc+oYNlyzwQE5kCa2VKlzFX Y4gdKEmy0P6mcUYHAfwsxpZvqkP+EncDAW5H6OgTz3VxB6XR+RMidvFA4VpprcAnSa9h vLwTChCUb2o0vNwBcaW/X4ain1YJuQPZlFQo0z1f80jsQzoCADrroM8rdEgo/slGkP/u lIqDUl2gQV7yEr5qhU+J0BsnMi0Oog/EoQeBO0iZHhuDxhw4efDWA8hlUP5+uvqLe/18 M0JYVJ1fguumcRHLFTZhyCf3X1O6M7T80kkriWNoAjnUhLiNpHyyRFAaVwNsM24XyRHc f3GQ== 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=+MHBuP7PRgoMyV40CRRVPL3AGLCyBQOL1uG7ZqRanfo=; b=AO1pnhRCJ2XV6aQQ6XNkatn1PF7W1Opv7jvOSUuHiAKueYWumwCuTqZSsU37xQQyLi BJH+6l0A5nebVnfDnxOlojVK4Y2AZCZc8ethUSHn/ggaUq8prGqiOqv9oSopIl/f5oPX IAuYYjbyERTFZ9pvHvhL+9PXs+KDR4kul7eZUCGBhjDzty5KboJmwGXQCUzbG5JAFS02 6C5Kvx3PcGzcxP5DxSRlgO2SXYz/pkSN0sjIq3zPwusroQu/8HcT14k4caM2qm0ZvM8P NNm3YnaUWChO+QdTF07MIxmND7TpKkav9JlkyNvBMTzCsJ9w4TxhGyabcB1MtFdyivo+ HVjw== X-Gm-Message-State: ALKqPwcq/Gdwb3Ki7pZ4DhfCny6gsKVBdrBl+5pZqz9l8skA1PIZ5dR0 8/jwLbk1bK0KqbHRgUOEUzXTWpExTPs= X-Google-Smtp-Source: ADUXVKI/BKJipOwBqOjK2f/zcC0S33I2wZZpmcHRwKHLSN8hiSfVCZlAxUJwIDE/z93TFU64Tg0FXg== X-Received: by 2002:a37:c602:: with SMTP id b2-v6mr4496722qkj.413.1527312255543; Fri, 25 May 2018 22:24:15 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:14 -0400 Message-Id: <4e5e163637c9c696eb43d46a08a0aad5cd818d8a.1527310210.git.keno@alumni.harvard.edu> 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:c09::244 Subject: [Qemu-devel] [PATCH 12/13] 9p: darwin: Provide a fallback implementation for utimensat 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 , 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" From: Keno Fischer This function is new in Mac OS 10.13. Provide a fallback implementation when building against older SDKs. Signed-off-by: Keno Fischer --- hw/9pfs/9p-local.c | 2 +- hw/9pfs/9p-util.c | 38 ++++++++++++++++++++++++++++++++++++++ hw/9pfs/9p-util.h | 7 +++++++ hw/9pfs/9p.c | 1 + 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 3e358b7..70ab541 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1082,7 +1082,7 @@ static int local_utimensat(FsContext *s, V9fsPath *fs= _path, goto out; } =20 - ret =3D utimensat(dirfd, name, buf, AT_SYMLINK_NOFOLLOW); + ret =3D utimensat_nofollow(dirfd, name, buf); close_preserve_errno(dirfd); out: g_free(dirpath); diff --git a/hw/9pfs/9p-util.c b/hw/9pfs/9p-util.c index 98004ac..8403f5f 100644 --- a/hw/9pfs/9p-util.c +++ b/hw/9pfs/9p-util.c @@ -104,3 +104,41 @@ int fsetxattrat_nofollow(int dirfd, const char *filena= me, const char *name, #endif return ret; } + +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + +int utimensat_nofollow(int dirfd, const char *filename, const struct times= pec times[2]) +{ +#ifdef CONFIG_DARWIN +#if defined(__MAC_10_13) /* Check whether we have an SDK version that defi= nes utimensat */ +#if __MAC_OS_X_VERSION_MIN_REQUIRED >=3D __MAC_10_13 +#define UTIMENSAT_AVAILABLE 1 +#elif __has_builtin(__builtin_available) +#define UTIMENSAT_AVAILABLE __builtin_available(macos 10.13, *) +#else +#define UTIMENSAT_AVAILABLE 0 +#endif + if (UTIMENSAT_AVAILABLE) + { + return utimensat(dirfd, filename, times, AT_SYMLINK_NOFOLLOW); + } +#endif + // utimensat not available. Use futimes. + int fd =3D openat_file(dirfd, filename, O_PATH_9P_UTIL | O_NOFOLLOW, 0= ); + if (fd =3D=3D -1) + return -1; + + struct timeval futimes_buf[2]; + futimes_buf[0].tv_sec =3D times[0].tv_sec; + futimes_buf[0].tv_usec =3D times[0].tv_nsec * 1000; + futimes_buf[1].tv_sec =3D times[1].tv_sec; + futimes_buf[1].tv_usec =3D times[1].tv_nsec * 1000; + int ret =3D futimes(fd, futimes_buf); + close_preserve_errno(fd); + return ret; +#else + return utimensat(dirfd, filename, times, AT_SYMLINK_NOFOLLOW); +#endif +} diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index cb26343..2329c82 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -19,6 +19,12 @@ #define O_PATH_9P_UTIL 0 #endif =20 +/* Compatibility with OLD SDK Versions for Darwin */ +#if defined(CONFIG_DARWIN) && !defined(UTIME_NOW) +#define UTIME_NOW -1 +#define UTIME_OMIT -2 +#endif + static inline void close_preserve_errno(int fd) { int serrno =3D errno; @@ -66,5 +72,6 @@ ssize_t flistxattrat_nofollow(int dirfd, const char *file= name, char *list, size_t size); ssize_t fremovexattrat_nofollow(int dirfd, const char *filename, const char *name); +int utimensat_nofollow(int dirfd, const char *filename, const struct times= pec times[2]); =20 #endif diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 4ae4da6..8e0594a 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -21,6 +21,7 @@ #include "virtio-9p.h" #include "fsdev/qemu-fsdev.h" #include "9p-xattr.h" +#include "9p-util.h" #include "coth.h" #include "trace.h" #include "migration/blocker.h" --=20 2.8.1 From nobody Sat Nov 1 22:30:13 2025 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 1527312967269828.9679977232203; Fri, 25 May 2018 22:36:07 -0700 (PDT) Received: from localhost ([::1]:47853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRs6-0006G7-Je for importer@patchew.org; Sat, 26 May 2018 01:36:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRgi-0006Tz-T2 for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRgf-0004ez-Rr for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:20 -0400 Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:45077) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRgf-0004ed-Nk for qemu-devel@nongnu.org; Sat, 26 May 2018 01:24:17 -0400 Received: by mail-qk0-x235.google.com with SMTP id c198-v6so5676628qkg.12 for ; Fri, 25 May 2018 22:24:17 -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 n128-v6sm17675166qkf.42.2018.05.25.22.24.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 22:24:15 -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=GutYW4LtZqtkmjvXsjRhCXMo0BsB3pQEV0Cu6QiK67g=; b=pxb/PKJfzgVF+gxnhhnkgt+UbcYmpG6T21krAayb/06O48KszuT87D4yjBi1ubV5pY j13uAE9uG1X/J+v8iNSYZZtMVE+yuOJS9nQmJTfj+rD8Lu4RyctCiOeA3r4y3jQB+jfJ 6/JH1Pr5K1pPFwGLW7tXadpaQmEanZFabei1Tj/8fwkX7qxE2bmbzvR2LduaFD/mW0Gc ll4fhO+8lxBvt+/Somo1rPjWTSXjAfdnz4TFafAWiftoPwBA69IAJjY7d6apOwiZybrP HVkkL0KFYnP7KOCBCEyI7Fp3ssUeI9OTKg5ifCl3ovB6BrxUAWbliV35OzfXFvkwwNZi tlvw== 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=GutYW4LtZqtkmjvXsjRhCXMo0BsB3pQEV0Cu6QiK67g=; b=o9B08foHUD9lro21itXcwRUkY7VNwnb4OsbOGj51mpzKZSJ39mofGoY9C2dsJf4jav jPMfhGMO1mmEzRgF55HVOUDrLlG61GUac/IS63evgBaOR42NOrfYEDrwRb7bubC7Mfkk cBB2KCfGnorsrmco2C4KNPT++U5dQ3srS8B2GO/kgI7o9x1i5f2awMec+TmPBlPzG7nB UUgIJrr1e+FDUz7H50TbqNbK2KK4JUwc1bNiX+GAVzvbQZAtEFJrVZ1/gtBCX+z27quN BZBYJWpLBuOzI108jYkAE3TyWHfQzPnKarBia/wCEyoTMROoqyD5Xs7Gc/Hng73+KM+s T3FQ== X-Gm-Message-State: ALKqPwcB3o1Je1wPLJVgoObbx/pyWf7xtywnyNBr9v+a5qP8rru3hnsF wqBTcFWT09vkjlDnulyzwA5944JcYk4= X-Google-Smtp-Source: ADUXVKImWp8BdDIPQM8uwuTRxIPRzSxwGKPy8BHByKFVN4r5p2LjUdJg3+JnDZ9LsMPsnZxwPKcZ/Q== X-Received: by 2002:a37:ddd1:: with SMTP id u78-v6mr4804350qku.363.1527312256808; Fri, 25 May 2018 22:24:16 -0700 (PDT) From: keno@juliacomputing.com To: qemu-devel@nongnu.org Date: Sat, 26 May 2018 01:23:15 -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:c09::235 Subject: [Qemu-devel] [PATCH 13/13] 9p: darwin: configure: Allow VirtFS on Darwin 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 , 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" From: Keno Fischer Signed-off-by: Keno Fischer --- Makefile.objs | 1 + configure | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index c6c3554..a2245c9 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -104,6 +104,7 @@ common-obj-$(CONFIG_WIN32) +=3D os-win32.o common-obj-$(CONFIG_POSIX) +=3D os-posix.o =20 common-obj-$(CONFIG_LINUX) +=3D fsdev/ +common-obj-$(CONFIG_DARWIN) +=3D fsdev/ =20 common-obj-y +=3D migration/ =20 diff --git a/configure b/configure index a8498ab..eb7328c 100755 --- a/configure +++ b/configure @@ -5535,16 +5535,27 @@ if test "$want_tools" =3D "yes" ; then fi fi if test "$softmmu" =3D yes ; then - if test "$linux" =3D yes; then - if test "$virtfs" !=3D no && test "$cap" =3D yes && test "$attr" =3D y= es ; then + if test "$virtfs" !=3D no; then + if test "$linux" =3D yes; then + if test "$cap" =3D yes && test "$attr" =3D yes ; then + virtfs=3Dyes + tools=3D"$tools fsdev/virtfs-proxy-helper\$(EXESUF)" + else + if test "$virtfs" =3D yes; then + error_exit "VirtFS requires libcap devel and libattr devel under= Linux" + fi + virtfs=3Dno + fi + elif test "$darwin" =3D yes; then virtfs=3Dyes - tools=3D"$tools fsdev/virtfs-proxy-helper\$(EXESUF)" else if test "$virtfs" =3D yes; then - error_exit "VirtFS requires libcap devel and libattr devel" + error_exit "VirtFS is supported only on Linux and Darwin" fi virtfs=3Dno fi + fi + if test "$linux" =3D yes; then if test "$mpath" !=3D no && test "$mpathpersist" =3D yes ; then mpath=3Dyes else @@ -5555,10 +5566,6 @@ if test "$softmmu" =3D yes ; then fi tools=3D"$tools scsi/qemu-pr-helper\$(EXESUF)" else - if test "$virtfs" =3D yes; then - error_exit "VirtFS is supported only on Linux" - fi - virtfs=3Dno if test "$mpath" =3D yes; then error_exit "Multipath is supported only on Linux" fi --=20 2.8.1