qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] block/raw-posix: fix compilation warning on OSX
@ 2015-02-12  5:35 Denis V. Lunev
  2015-02-12  9:52 ` Kevin Wolf
  2015-02-16 10:23 ` Kevin Wolf
  0 siblings, 2 replies; 3+ messages in thread
From: Denis V. Lunev @ 2015-02-12  5:35 UTC (permalink / raw)
  Cc: Kevin Wolf, Denis V. Lunev, qemu-devel, Peter Maydell

block/raw-posix.c:947:19: warning: unused variable 's' [-Wunused-variable]
    BDRVRawState *s = aiocb->bs->opaque;

This variable is used only when on of the following macros are defined
CONFIG_XFS, CONFIG_FALLOCATE, CONFIG_FALLOCATE_PUNCH_HOLE or
CONFIG_FALLOCATE_ZERO_RANGE. Fortunately, CONFIG_FALLOCATE_PUNCH_HOLE
and CONFIG_FALLOCATE_ZERO_RANGE could be defined only along with
CONFIG_FALLOCATE. Therefore checking for CONFIG_XFS or CONFIG_FALLOCATE
would be enough.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Kevin Wolf <kwolf@redhat.com>
---
 block/raw-posix.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index e474c17..bf7d6f7 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -944,7 +944,9 @@ static ssize_t handle_aiocb_write_zeroes_block(RawPosixAIOData *aiocb)
 
 static ssize_t handle_aiocb_write_zeroes(RawPosixAIOData *aiocb)
 {
+#if defined(CONFIG_FALLOCATE) || defined(CONFIG_XFS)
     BDRVRawState *s = aiocb->bs->opaque;
+#endif
 
     if (aiocb->aio_type & QEMU_AIO_BLKDEV) {
         return handle_aiocb_write_zeroes_block(aiocb);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] block/raw-posix: fix compilation warning on OSX
  2015-02-12  5:35 [Qemu-devel] [PATCH 1/1] block/raw-posix: fix compilation warning on OSX Denis V. Lunev
@ 2015-02-12  9:52 ` Kevin Wolf
  2015-02-16 10:23 ` Kevin Wolf
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2015-02-12  9:52 UTC (permalink / raw)
  To: Denis V. Lunev; +Cc: Peter Maydell, qemu-devel

Am 12.02.2015 um 06:35 hat Denis V. Lunev geschrieben:
> block/raw-posix.c:947:19: warning: unused variable 's' [-Wunused-variable]
>     BDRVRawState *s = aiocb->bs->opaque;
> 
> This variable is used only when on of the following macros are defined
> CONFIG_XFS, CONFIG_FALLOCATE, CONFIG_FALLOCATE_PUNCH_HOLE or
> CONFIG_FALLOCATE_ZERO_RANGE. Fortunately, CONFIG_FALLOCATE_PUNCH_HOLE
> and CONFIG_FALLOCATE_ZERO_RANGE could be defined only along with
> CONFIG_FALLOCATE. Therefore checking for CONFIG_XFS or CONFIG_FALLOCATE
> would be enough.
> 
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Peter Maydell <peter.maydell@linaro.org>
> CC: Kevin Wolf <kwolf@redhat.com>

Reviewed-by: Kevin Wolf <kwolf@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] block/raw-posix: fix compilation warning on OSX
  2015-02-12  5:35 [Qemu-devel] [PATCH 1/1] block/raw-posix: fix compilation warning on OSX Denis V. Lunev
  2015-02-12  9:52 ` Kevin Wolf
@ 2015-02-16 10:23 ` Kevin Wolf
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2015-02-16 10:23 UTC (permalink / raw)
  To: Denis V. Lunev; +Cc: Peter Maydell, qemu-devel

Am 12.02.2015 um 06:35 hat Denis V. Lunev geschrieben:
> block/raw-posix.c:947:19: warning: unused variable 's' [-Wunused-variable]
>     BDRVRawState *s = aiocb->bs->opaque;
> 
> This variable is used only when on of the following macros are defined
> CONFIG_XFS, CONFIG_FALLOCATE, CONFIG_FALLOCATE_PUNCH_HOLE or
> CONFIG_FALLOCATE_ZERO_RANGE. Fortunately, CONFIG_FALLOCATE_PUNCH_HOLE
> and CONFIG_FALLOCATE_ZERO_RANGE could be defined only along with
> CONFIG_FALLOCATE. Therefore checking for CONFIG_XFS or CONFIG_FALLOCATE
> would be enough.
> 
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Peter Maydell <peter.maydell@linaro.org>
> CC: Kevin Wolf <kwolf@redhat.com>

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-16 10:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-12  5:35 [Qemu-devel] [PATCH 1/1] block/raw-posix: fix compilation warning on OSX Denis V. Lunev
2015-02-12  9:52 ` Kevin Wolf
2015-02-16 10:23 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).