[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 05/42] block/raw-posix: refactor handle_aiocb_wri
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PULL 05/42] block/raw-posix: refactor handle_aiocb_write_zeroes a bit |
Date: |
Thu, 12 Feb 2015 02:29:57 +0000 |
On 6 February 2015 at 16:40, Kevin Wolf <address@hidden> wrote:
> From: "Denis V. Lunev" <address@hidden>
>
> 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
- [Qemu-devel] [PULL 00/42] Block patches, Kevin Wolf, 2015/02/06
- [Qemu-devel] [PULL 01/42] Restore atapi_dma flag across migration, Kevin Wolf, 2015/02/06
- [Qemu-devel] [PULL 05/42] block/raw-posix: refactor handle_aiocb_write_zeroes a bit, Kevin Wolf, 2015/02/06
- Re: [Qemu-devel] [PULL 05/42] block/raw-posix: refactor handle_aiocb_write_zeroes a bit,
Peter Maydell <=
- [Qemu-devel] [PULL 07/42] block/raw-posix: call plain fallocate in handle_aiocb_write_zeroes, Kevin Wolf, 2015/02/06
- [Qemu-devel] [PULL 03/42] block/raw-posix: create translate_err helper to merge errno values, Kevin Wolf, 2015/02/06
- [Qemu-devel] [PULL 04/42] block/raw-posix: create do_fallocate helper, Kevin Wolf, 2015/02/06
- [Qemu-devel] [PULL 02/42] atapi migration: Throw recoverable error to avoid recovery, Kevin Wolf, 2015/02/06
- [Qemu-devel] [PULL 10/42] qemu-img: Add QEMU_PKGVERSION to QEMU_IMG_VERSION, Kevin Wolf, 2015/02/06
- [Qemu-devel] [PULL 06/42] block: use fallocate(FALLOC_FL_ZERO_RANGE) in handle_aiocb_write_zeroes, Kevin Wolf, 2015/02/06
- [Qemu-devel] [PULL 09/42] block: change default for discard and write zeroes to INT_MAX, Kevin Wolf, 2015/02/06
- [Qemu-devel] [PULL 08/42] block: use fallocate(FALLOC_FL_PUNCH_HOLE) & fallocate(0) to write zeroes, Kevin Wolf, 2015/02/06
- [Qemu-devel] [PULL 13/42] hw/virtio-blk: add a constant for max number of merged requests, Kevin Wolf, 2015/02/06