qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Build issue with qemu-2.7.0


From: Fam Zheng
Subject: Re: [Qemu-devel] Build issue with qemu-2.7.0
Date: Mon, 7 Nov 2016 14:34:45 +0800
User-agent: Mutt/1.7.1 (2016-10-04)

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
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]