From: Fam Zheng <famz@redhat.com>
To: Colum Paget <colum.paget@googlemail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Build issue with qemu-2.7.0
Date: Mon, 7 Nov 2016 14:34:45 +0800 [thread overview]
Message-ID: <20161107063445.GA10158@lemon> (raw)
In-Reply-To: <CABsuZXUj0A=h+fAMm==7WeEGhRd0-o3RPyQDE74at=BvtN+ZNw@mail.gmail.com>
On Sun, 11/06 12:34, Colum Paget wrote:
> Hi all,
>
> Firstly appologies for not using the launchpad bug tracker, it won't
> let me register an account, keeps telling me my 'page is stale'.
Thanks, while launchpad is the default option, in your case it is also okay to
send bug reports to qemu-devel too.
>
> I'm sending this to you as a build issue, but it could be that it's a
> block-io issue. I'm calling it a build issue because I fixed it by
> changing the configure/build process.
>
> I'm building on a linux-from-scratch system.
>
> at line 1042 of block/raw-posix.c there's a function called
> handle_aiocb_write_zeroes
>
> This function declares a variable 's' only if certain defines are true
>
> #if defined(CONFIG_FALLOCATE) || defined(CONFIG_XFS)
> BDRVRawState *s = aiocb->bs->opaque;
> #endif
>
>
> but it uses variable 's' if *other* defines are true
>
> #ifdef CONFIG_FALLOCATE_ZERO_RANGE
> if (s->has_write_zeroes) {
> int ret = do_fallocate(s->fd, FALLOC_FL_ZERO_RANGE,
> aiocb->aio_offset, aiocb->aio_nbytes);
> if (ret == 0 || ret != -ENOTSUP) {
> return ret;
> }
> s->has_write_zeroes = false;
> }
> #endif
>
>
> so, if CONFIG_FALLOCATE_ZERO_RANGE is defined, but CONFIG_FALLOCATE
> isn't, then the build will fail.
Looking at the actuall feature probe part of configure, only the #include
directives look a bit different between "fallocate" and "fallocate_zero_range"
tests:
#...
# check for fallocate
fallocate=no
cat > $TMPC << EOF
#include <fcntl.h>
int main(void)
{
fallocate(0, 0, 0, 0);
return 0;
}
EOF
if compile_prog "" "" ; then
fallocate=yes
fi
#...
# check that fallocate supports range zeroing inside the file
fallocate_zero_range=no
cat > $TMPC << EOF
#include <fcntl.h>
#include <linux/falloc.h>
int main(void)
{
fallocate(0, FALLOC_FL_ZERO_RANGE, 0, 0);
return 0;
}
EOF
if compile_prog "" "" ; then
fallocate_zero_range=yes
fi
Does it fix the building issue if you add the "#include <linux/falloc.h>" line
to the first program above?
Fam
>
> I *think* that CONFIG_FALLOCATE_ZERO_RANGE shouldn't be set if
> CONFIG_FALLOCATE isn't set (Quite how this situation has come about
> I'm not sure, probably my system is strange in some way). Looking in
> 'configure' I see (at line 5108):
>
>
> if test "$fallocate" = "yes" ; then
> echo "CONFIG_FALLOCATE=y" >> $config_host_mak
> fi
> if test "$fallocate_punch_hole" = "yes" ; then
> echo "CONFIG_FALLOCATE_PUNCH_HOLE=y" >> $config_host_mak
> fi
> if test "$fallocate_zero_range" = "yes" ; then
> echo "CONFIG_FALLOCATE_ZERO_RANGE=y" >> $config_host_mak
> fi
> if test "$posix_fallocate" = "yes" ; then
> echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
> fi
> if test "$sync_file_range" = "yes" ; then
> echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
> fi
>
>
> If I change the CONFIG_FALLOCATE 'if' block to wrap all the FALLOCATE
> options, like so:
>
>
> if test "$fallocate" = "yes" ; then
> echo "CONFIG_FALLOCATE=y" >> $config_host_mak
> if test "$fallocate_punch_hole" = "yes" ; then
> echo "CONFIG_FALLOCATE_PUNCH_HOLE=y" >> $config_host_mak
> fi
> if test "$fallocate_zero_range" = "yes" ; then
> echo "CONFIG_FALLOCATE_ZERO_RANGE=y" >> $config_host_mak
> fi
> if test "$posix_fallocate" = "yes" ; then
> echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
> fi
> fi
>
> then qemu builds successfully on my system.
>
>
> Hope this is some use!
>
> regards
>
> Colum
>
prev parent reply other threads:[~2016-11-07 6:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-06 12:34 [Qemu-devel] Build issue with qemu-2.7.0 Colum Paget
2016-11-07 6:34 ` Fam Zheng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161107063445.GA10158@lemon \
--to=famz@redhat.com \
--cc=colum.paget@googlemail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.