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

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.