All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Build issue with qemu-2.7.0
@ 2016-11-06 12:34 Colum Paget
  2016-11-07  6:34 ` Fam Zheng
  0 siblings, 1 reply; 2+ messages in thread
From: Colum Paget @ 2016-11-06 12:34 UTC (permalink / raw)
  To: qemu-devel

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'.

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.

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

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

* Re: [Qemu-devel] Build issue with qemu-2.7.0
  2016-11-06 12:34 [Qemu-devel] Build issue with qemu-2.7.0 Colum Paget
@ 2016-11-07  6:34 ` Fam Zheng
  0 siblings, 0 replies; 2+ messages in thread
From: Fam Zheng @ 2016-11-07  6:34 UTC (permalink / raw)
  To: Colum Paget; +Cc: qemu-devel

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
> 

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

end of thread, other threads:[~2016-11-07  6:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-06 12:34 [Qemu-devel] Build issue with qemu-2.7.0 Colum Paget
2016-11-07  6:34 ` Fam Zheng

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.