From: Kevin Wolf <kwolf@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Igor Mammedov <imammedo@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Hu Tao <hutao@cn.fujitsu.com>
Subject: Re: [Qemu-devel] build regression on osx in block layer
Date: Mon, 29 Sep 2014 17:36:39 +0200 [thread overview]
Message-ID: <20140929153639.GJ3910@noname.str.redhat.com> (raw)
In-Reply-To: <CAFEAcA8FjTfqH=dU-Qs+LcSccQJoc2hhZXXwUTHdhYUPYnXNTg@mail.gmail.com>
Am 29.09.2014 um 15:58 hat Peter Maydell geschrieben:
> On 29 September 2014 11:10, Igor Mammedov <imammedo@redhat.com> wrote:
> > Build fails with:
> >
> > $ make
> > LINK qemu-nbd
> > Undefined symbols for architecture x86_64:
> > "_posix_fallocate", referenced from:
> > _raw_create in raw-posix.o
> > ld: symbol(s) not found for architecture x86_64
> >
> > introduced by
> > 06247428be raw-posix: Add falloc and full preallocation
>
> I think the MacOSX interface to this involves
> fcntl(F_PREALLOCATE). This is what Mozilla uses:
>
> fstore_t store = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, aLength};
> // Try to get a continous chunk of disk space
> int ret = fcntl(fd, F_PREALLOCATE, &store);
> if(-1 == ret){
> // OK, perhaps we are too fragmented, allocate non-continuous
> store.fst_flags = F_ALLOCATEALL;
> ret = fcntl(fd, F_PREALLOCATE, &store);
> if (-1 == ret)
> return false;
> }
> return 0 == ftruncate(fd, aLength);
>
> This has probably broken compilation on the BSDs
> as well, since I don't suppose they all have
> posix_fallocate(). In extremis we can implement
> it with truncate-and-write, cf:
> http://stackoverflow.com/questions/11497567/fallocate-command-equivalent-in-os-x
>
> We probably need a util/qemu-fallocate.c...
Sent a patch to make the build of that code conditional. Having some
util/qemu-fallocate.c probably wouldn't hurt, but it needs to be done by
someone who has a system that uses a different path (i.e. not me).
Kevin
prev parent reply other threads:[~2014-09-29 15:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-29 10:10 [Qemu-devel] build regression on osx in block layer Igor Mammedov
2014-09-29 13:58 ` Peter Maydell
2014-09-29 15:36 ` Kevin Wolf [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=20140929153639.GJ3910@noname.str.redhat.com \
--to=kwolf@redhat.com \
--cc=hutao@cn.fujitsu.com \
--cc=imammedo@redhat.com \
--cc=peter.maydell@linaro.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).