From nobody Mon Feb 9 06:33:57 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 1527816978475349.749797968808; Thu, 31 May 2018 18:36:18 -0700 (PDT) Received: from localhost ([::1]:46928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOYzJ-0000e9-JN for importer@patchew.org; Thu, 31 May 2018 21:36:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOYr2-00032l-El for qemu-devel@nongnu.org; Thu, 31 May 2018 21:27:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOYqy-00031O-2l for qemu-devel@nongnu.org; Thu, 31 May 2018 21:27:44 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:33781) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fOYqx-00030m-Th for qemu-devel@nongnu.org; Thu, 31 May 2018 21:27:39 -0400 Received: by mail-qt0-x242.google.com with SMTP id e8-v6so30315164qth.0 for ; Thu, 31 May 2018 18:27:39 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 May 2018 18:27:38 -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=0kfBeqSC6bMbymBCvOqHOirFVLO38eL6EEW5yH7t0VA=; b=TZvZmG2vydwPWfcqtAhsRNf7hYUERPSfqWwAMzrVw0jnKWNmrBFL6UXKrICeMl/p83 UCsDNgPmruj5UI9D13tNYl6k81YUaw4eZjtc4GiVBl2FCRfOZDl86chnlJ+zDRPOszY/ afZ08Rkbp02L1wGvCk9Oco4dwKL2DPfAr7yGMyKy8Y5FciI2q/irKVmPzrd8YrIY2JkN axE++FOveNZOuiVAqw39T8ujfk31KMY69c/qrGFdPIPn7S4o2kdMRT6ifMoMOLSiUxIb OxFgOEndGHMoAe4mCDyq3PArBQsIAg5X5a/FvDbyrEWqE+YqaqX1WfGx323kAW8UC4uk 7PGQ== 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=0kfBeqSC6bMbymBCvOqHOirFVLO38eL6EEW5yH7t0VA=; b=NUynbrekva5rUFYKqL3Np9AgcZB8j0OfKKZlBf01HMt4aNtp5RXzI2Ler26reYK23R 5h+3R0mHg9FiJN6ScMpSXPEnXCgM3dPVrZeDFyqOfF7AphfeQwC88pCMxyXiwT6arCoZ bI7WVBS/ZFGEdlyWr0ZlSD3gwuIY7DDwGdOV6YsBHMU8OPC3SK9csI/Fg/HbGvR2DgJk JsarjqOdYGaj1ponHWxnoR4FfGLjaTpzCu+YbqaDF3aoR/K8c7q4EXfZO/7NLGoc7dUs sT+kcY1Txy0pcTl6Uv3NK5IKXPeVpQBrXf322BIcUpb8Ngr6j5aEC2gxZykScKscKc7M 6U+A== X-Gm-Message-State: APt69E2DeiQYKDeAO40uZfBHX12qEDNxbyDDa4uIqSK8blfTCV0Q/+5O qwuCZvHlvkdElaaiipwlFKIvGgjbH1M= X-Google-Smtp-Source: ADUXVKIJTJGcPEuI7uTsuKeMpJbnJ+yb4zy3RU6cCN0O8cs0PQNT8ycXERkTmFeM1bfhUaqtI95WRQ== X-Received: by 2002:a0c:9805:: with SMTP id c5-v6mr8765516qvd.9.1527816459034; Thu, 31 May 2018 18:27:39 -0700 (PDT) From: Keno Fischer To: qemu-devel@nongnu.org Date: Thu, 31 May 2018 21:26:03 -0400 Message-Id: <667649d1ce2e1a948a5be1103a21cb495eff2c13.1527814874.git.keno@juliacomputing.com> 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 08/20] 9p: Rename 9p-util -> 9p-util-linux 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" The current file only has the Linux versions of these functions. Rename the file accordingly and update the Makefile to only build it on Linux. A Darwin version of these will follow later in the series. Signed-off-by: Keno Fischer Reviewed-by: Greg Kurz --- Changes since v1: New patch hw/9pfs/9p-util-linux.c | 59 +++++++++++++++++++++++++++++++++++++++++++++= ++++ hw/9pfs/9p-util.c | 59 ---------------------------------------------= ---- hw/9pfs/Makefile.objs | 3 ++- 3 files changed, 61 insertions(+), 60 deletions(-) create mode 100644 hw/9pfs/9p-util-linux.c delete mode 100644 hw/9pfs/9p-util.c diff --git a/hw/9pfs/9p-util-linux.c b/hw/9pfs/9p-util-linux.c new file mode 100644 index 0000000..defa3a4 --- /dev/null +++ b/hw/9pfs/9p-util-linux.c @@ -0,0 +1,59 @@ +/* + * 9p utilities (Linux Implementation) + * + * Copyright IBM, Corp. 2017 + * + * Authors: + * Greg Kurz + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu/xattr.h" +#include "9p-util.h" + +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; + + ret =3D lgetxattr(proc_path, name, value, size); + g_free(proc_path); + return ret; +} + +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.c b/hw/9pfs/9p-util.c deleted file mode 100644 index 614b7fc..0000000 --- a/hw/9pfs/9p-util.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 9p utilities - * - * Copyright IBM, Corp. 2017 - * - * Authors: - * Greg Kurz - * - * This work is licensed under the terms of the GNU GPL, version 2 or late= r. - * See the COPYING file in the top-level directory. - */ - -#include "qemu/osdep.h" -#include "qemu/xattr.h" -#include "9p-util.h" - -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; - - ret =3D lgetxattr(proc_path, name, value, size); - g_free(proc_path); - return ret; -} - -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/Makefile.objs b/hw/9pfs/Makefile.objs index fd90b62..083508f 100644 --- a/hw/9pfs/Makefile.objs +++ b/hw/9pfs/Makefile.objs @@ -1,4 +1,5 @@ -common-obj-y =3D 9p.o 9p-util.o +common-obj-y =3D 9p.o +common-obj-$(CONFIG_LINUX) +=3D 9p-util-linux.o common-obj-y +=3D 9p-local.o 9p-xattr.o common-obj-y +=3D 9p-xattr-user.o 9p-posix-acl.o common-obj-y +=3D coth.o cofs.o codir.o cofile.o --=20 2.8.1