[libvirt] [PATCH] build: use gnulib fdatasync

Commit 1726a73 hacked around MacOS' lack of fdatasync, since gnulib did not have it at the time. But now that we use newer gnulib, we can avoid the hack. * bootstrap.conf (gnulib_modules): Add fdatasync. * configure.ac (AC_CHECK_FUNCS_ONCE): Drop our own check. --- bootstrap.conf | 1 + configure.ac | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index d029253..0faa2e2 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -40,6 +40,7 @@ environ fclose fcntl fcntl-h +fdatasync ffs fnmatch fsync diff --git a/configure.ac b/configure.ac index df19445..6a0936a 100644 --- a/configure.ac +++ b/configure.ac @@ -135,12 +135,9 @@ AC_CHECK_SIZEOF([long]) dnl Availability of various common functions (non-fatal if missing), dnl and various less common threadsafe functions -AC_CHECK_FUNCS_ONCE([cfmakeraw fdatasync geteuid getgid getgrnam_r getmntent_r \ +AC_CHECK_FUNCS_ONCE([cfmakeraw geteuid getgid getgrnam_r getmntent_r \ getpwuid_r getuid initgroups kill mmap posix_fallocate posix_memalign \ regexec sched_getaffinity]) -if test $ac_cv_func_fdatasync = no; then - AC_DEFINE([fdatasync], [fsync], [Define to fsync if you lack fdatasync]) -fi dnl Availability of pthread functions (if missing, win32 threading is dnl assumed). Because of $LIB_PTHREAD, we cannot use AC_CHECK_FUNCS_ONCE. -- 1.7.4.4

On Mon, Oct 24, 2011 at 16:44:49 -0600, Eric Blake wrote:
Commit 1726a73 hacked around MacOS' lack of fdatasync, since gnulib did not have it at the time. But now that we use newer gnulib, we can avoid the hack.
* bootstrap.conf (gnulib_modules): Add fdatasync. * configure.ac (AC_CHECK_FUNCS_ONCE): Drop our own check. --- bootstrap.conf | 1 + configure.ac | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-)
ACK BTW, are there any plans on enhancing gnulib fsync module to provide a replacement for certain versions of OS X? Although they provide fsync, it doesn't really sync anything and one needs to do some ioctl hackery to really achieve what fsync should do. Jirka

[adding bug-gnulib] On 10/25/2011 03:44 AM, Jiri Denemark wrote:
On Mon, Oct 24, 2011 at 16:44:49 -0600, Eric Blake wrote:
Commit 1726a73 hacked around MacOS' lack of fdatasync, since gnulib did not have it at the time. But now that we use newer gnulib, we can avoid the hack.
* bootstrap.conf (gnulib_modules): Add fdatasync. * configure.ac (AC_CHECK_FUNCS_ONCE): Drop our own check. --- bootstrap.conf | 1 + configure.ac | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-)
ACK
BTW, are there any plans on enhancing gnulib fsync module to provide a replacement for certain versions of OS X? Although they provide fsync, it doesn't really sync anything and one needs to do some ioctl hackery to really achieve what fsync should do.
Any quick pointers to example code using that ioctl? Then again, I'll probably find them with a quick google search myself. Yes, gnulib should be taught to make fsync() more useful on OS X. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 10/25/2011 04:32 PM, Eric Blake wrote:
[adding bug-gnulib]
On 10/25/2011 03:44 AM, Jiri Denemark wrote:
On Mon, Oct 24, 2011 at 16:44:49 -0600, Eric Blake wrote:
Commit 1726a73 hacked around MacOS' lack of fdatasync, since gnulib did not have it at the time. But now that we use newer gnulib, we can avoid the hack.
* bootstrap.conf (gnulib_modules): Add fdatasync. * configure.ac (AC_CHECK_FUNCS_ONCE): Drop our own check. --- bootstrap.conf | 1 + configure.ac | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-)
ACK
BTW, are there any plans on enhancing gnulib fsync module to provide a replacement for certain versions of OS X? Although they provide fsync, it doesn't really sync anything and one needs to do some ioctl hackery to really achieve what fsync should do.
Any quick pointers to example code using that ioctl? Then again, I'll probably find them with a quick google search myself.
Yes, gnulib should be taught to make fsync() more useful on OS X.
Hmm I thought fsync() on both GNU/Linux and OS X were similar. I.E. flush the OS buffers. The OS X provided F_FULLFSYNC _in addition_ asks the device to drain its buffers. cheers, Pádraig.

On Tue, Oct 25, 2011 at 09:32:13AM -0600, Eric Blake wrote:
[adding bug-gnulib]
On 10/25/2011 03:44 AM, Jiri Denemark wrote:
On Mon, Oct 24, 2011 at 16:44:49 -0600, Eric Blake wrote:
Commit 1726a73 hacked around MacOS' lack of fdatasync, since gnulib did not have it at the time. But now that we use newer gnulib, we can avoid the hack.
* bootstrap.conf (gnulib_modules): Add fdatasync. * configure.ac (AC_CHECK_FUNCS_ONCE): Drop our own check. --- bootstrap.conf | 1 + configure.ac | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-)
ACK
BTW, are there any plans on enhancing gnulib fsync module to provide a replacement for certain versions of OS X? Although they provide fsync, it doesn't really sync anything and one needs to do some ioctl hackery to really achieve what fsync should do.
Any quick pointers to example code using that ioctl? Then again, I'll probably find them with a quick google search myself.
I learnt about the problem from http://www.flamingspork.com/talks/2007/06/eat_my_data.odp pages 100-119 are the "fun" part of the story Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 10/25/2011 04:50 PM, Daniel P. Berrange wrote:
On Tue, Oct 25, 2011 at 09:32:13AM -0600, Eric Blake wrote:
[adding bug-gnulib]
On 10/25/2011 03:44 AM, Jiri Denemark wrote:
On Mon, Oct 24, 2011 at 16:44:49 -0600, Eric Blake wrote:
Commit 1726a73 hacked around MacOS' lack of fdatasync, since gnulib did not have it at the time. But now that we use newer gnulib, we can avoid the hack.
* bootstrap.conf (gnulib_modules): Add fdatasync. * configure.ac (AC_CHECK_FUNCS_ONCE): Drop our own check. --- bootstrap.conf | 1 + configure.ac | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-)
ACK
BTW, are there any plans on enhancing gnulib fsync module to provide a replacement for certain versions of OS X? Although they provide fsync, it doesn't really sync anything and one needs to do some ioctl hackery to really achieve what fsync should do.
Any quick pointers to example code using that ioctl? Then again, I'll probably find them with a quick google search myself.
I learnt about the problem from
http://www.flamingspork.com/talks/2007/06/eat_my_data.odp
pages 100-119 are the "fun" part of the story
I think the mysql guys got a bit confused. Here's an apple engineer (Dominic Giampaolo) clarifying things http://lists.mindrot.org/pipermail/portawiki-discuss/2005-November/000002.ht... cheers, Pádraig.

On Tue, Oct 25, 2011 at 05:12:57PM +0100, Pádraig Brady wrote:
On 10/25/2011 04:50 PM, Daniel P. Berrange wrote:
On Tue, Oct 25, 2011 at 09:32:13AM -0600, Eric Blake wrote:
[adding bug-gnulib]
On 10/25/2011 03:44 AM, Jiri Denemark wrote:
On Mon, Oct 24, 2011 at 16:44:49 -0600, Eric Blake wrote:
Commit 1726a73 hacked around MacOS' lack of fdatasync, since gnulib did not have it at the time. But now that we use newer gnulib, we can avoid the hack.
* bootstrap.conf (gnulib_modules): Add fdatasync. * configure.ac (AC_CHECK_FUNCS_ONCE): Drop our own check. --- bootstrap.conf | 1 + configure.ac | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-)
ACK
BTW, are there any plans on enhancing gnulib fsync module to provide a replacement for certain versions of OS X? Although they provide fsync, it doesn't really sync anything and one needs to do some ioctl hackery to really achieve what fsync should do.
Any quick pointers to example code using that ioctl? Then again, I'll probably find them with a quick google search myself.
I learnt about the problem from
http://www.flamingspork.com/talks/2007/06/eat_my_data.odp
pages 100-119 are the "fun" part of the story
I think the mysql guys got a bit confused. Here's an apple engineer (Dominic Giampaolo) clarifying things http://lists.mindrot.org/pipermail/portawiki-discuss/2005-November/000002.ht...
Thanks, that does clarify it. From libvirt's POV, I think a regular fsync() is good enough then :-) Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 10/25/2011 03:44 AM, Jiri Denemark wrote:
On Mon, Oct 24, 2011 at 16:44:49 -0600, Eric Blake wrote:
Commit 1726a73 hacked around MacOS' lack of fdatasync, since gnulib did not have it at the time. But now that we use newer gnulib, we can avoid the hack.
* bootstrap.conf (gnulib_modules): Add fdatasync. * configure.ac (AC_CHECK_FUNCS_ONCE): Drop our own check. --- bootstrap.conf | 1 + configure.ac | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-)
ACK
Thanks; pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Jiri Denemark
-
Pádraig Brady