From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLlwa-0006Js-Fb for qemu-devel@nongnu.org; Thu, 12 Feb 2015 00:04:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLlwU-0004CZ-PF for qemu-devel@nongnu.org; Thu, 12 Feb 2015 00:04:04 -0500 Received: from mx2.parallels.com ([199.115.105.18]:45899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLlwU-0003yZ-JC for qemu-devel@nongnu.org; Thu, 12 Feb 2015 00:03:58 -0500 Message-ID: <54DC2FB4.2000208@openvz.org> Date: Thu, 12 Feb 2015 07:44:36 +0300 From: "Denis V. Lunev" MIME-Version: 1.0 References: <1423240849-15499-1-git-send-email-kwolf@redhat.com> <1423240849-15499-6-git-send-email-kwolf@redhat.com> In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 05/42] block/raw-posix: refactor handle_aiocb_write_zeroes a bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Kevin Wolf Cc: QEMU Developers On 12/02/15 05:29, Peter Maydell wrote: > On 6 February 2015 at 16:40, Kevin Wolf wrote: >> From: "Denis V. Lunev" >> >> move code dealing with a block device to a separate function. This will >> allow to implement additional processing for ordinary files. >> +static ssize_t handle_aiocb_write_zeroes(RawPosixAIOData *aiocb) >> +{ >> + BDRVRawState *s = aiocb->bs->opaque; >> + >> + if (aiocb->aio_type & QEMU_AIO_BLKDEV) { >> + return handle_aiocb_write_zeroes_block(aiocb); >> + } >> + >> +#ifdef CONFIG_XFS >> + if (s->is_xfs) { >> + return xfs_write_zeroes(s, aiocb->aio_offset, aiocb->aio_nbytes); >> + } >> +#endif >> + >> + return -ENOTSUP; >> +} > Hi. This patch has introduced a new compiler warning on OSX: > block/raw-posix.c:947:19: warning: unused variable 's' [-Wunused-variable] > BDRVRawState *s = aiocb->bs->opaque; > ^ > > and indeed on any host which doesn't define any of CONFIG_XFS, > CONFIG_FALLOCATE, CONFIG_FALLOCATE_PUNCH_HOLE or > CONFIG_FALLOCATE_ZERO_RANGE. > > What's your preferred fix? Surrounding the variable declaration > with #if defined(CONFIG_XFS) || defined(CONFIG_FALLOCATE) > would work but I dunno if some less ugly approach is possible. > > [I don't yet build OSX with -Werror because we haven't fixed > some of the deprecation warnings about the audio APIs, but > I would like to eventually...] > > thanks > -- PMM we can just add (void)s; immediately after the declaration. On the other hand, CONFIG_FALLOCATE_PUNCH_HOLE and CONFIG_FALLOCATE_ZERO_RANGE are completely impossible without CONFIG_FALLOCATE thus #if defined(CONFIG_FALLOCATE) or defined(CONFIG_XFS) would be enough. Regards, Den