From nobody Sun Nov 2 11:45:23 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