aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2015-02-12 08:35:49 +0300
committerKevin Wolf <kwolf@redhat.com>2015-03-09 11:11:59 +0100
commita6dcf097fad2773fdee9ea12f8452dcc259e9ee1 (patch)
tree51cb54cfe6c64d9380ff0146e3a9d3c093fdddfb
parent876eb1b0cc2b04927739cba10e4e73e8b990d65e (diff)
block/raw-posix: fix compilation warning on OSX
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> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block/raw-posix.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index b5f077a8f1..c0b46cac9e 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);