Commit Graph

28 Commits

Author SHA1 Message Date
Richard W.M. Jones
72cfaff5c5 Update copyright dates for 2025
Automated using this command:

perl -pi.bak -e 's/(20[012][0-9])-20[12][01234]/$1-2025/g' `git ls-files`
2025-02-16 17:00:46 +00:00
Richard W.M. Jones
e2c7bddf10 Update copyright dates for 2023
Run this command across the source:

  perl -pi.bak -e 's/(20[012][0-9])-20[12][012]/$1-2023/g' `git ls-files`

and remove changes to po{,-docs}/*.po{,t} (these will be regenerated
later when we run 'make dist').
2023-02-07 10:50:48 +00:00
Richard W.M. Jones
0e17236d7d Update copyright dates to 2020. 2020-03-06 19:32:32 +00:00
Richard W.M. Jones
05d4fcb64d Update copyright dates for 2019.
This command run over the source:

perl -pi.bak -e 's/(20[01][0-9])-2018/$1-2019/g' `git ls-files`
2019-01-08 11:58:30 +00:00
Richard W.M. Jones
212762c593 Update copyright dates for 2018.
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2017/$1-2018/g' `git ls-files`
2018-01-04 15:30:10 +00:00
Richard W.M. Jones
a75076f271 GCC 7: Allocate sufficient space for sprintf output.
GCC 7.0.1 can determine if there is likely to be sufficient space in
the output buffer when using sprintf/snprintf, based on the format
string.

The errors were all either of this form:

bindtests.c:717:29: error: '%zu' directive output may be truncated writing between 1 and 19 bytes into a region of size 16 [-Werror=format-truncation=]
     snprintf (strs[i], 16, "%zu", i);
                             ^~~
bindtests.c:717:28: note: directive argument in the range [0, 2305843009213693951]
     snprintf (strs[i], 16, "%zu", i);
                             ^~~~~

or this form:

sync.c: In function 'fsync_devices':
sync.c:108:50: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 251 [-Werror=format-truncation=]
       snprintf (dev_path, sizeof dev_path, "/dev/%s", d->d_name);
                                                  ^~

Fixed by converting these into dynamic allocation, or making the
output buffer larger, whichever was easier.

There is a gnulib macro we can use to make this simpler for integers.
It requires a new gnulib module (intprops), but it turns out that we
were already pulling that in through dependencies, so the change to
bootstrap is a no-op.  (thanks: Dan Berrange)
2017-02-14 17:53:28 +00:00
Pino Toscano
55bf7de97c Update copyright dates for 2017
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2016/$1-2017/g' `git ls-files`

(Thanks Rich for the perl snippet, as used in past years.)
2017-01-03 16:48:21 +01:00
Richard W.M. Jones
307c83177c Update copyright dates for 2016.
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2015/$1-2016/g' `git ls-files`
2016-01-02 21:19:51 +00:00
Chen Hanxiao
d29337605a daemon: add a space after func/macro to fit code-style
more daemon codes covered

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-07-17 13:27:13 +01:00
Richard W.M. Jones
c5800dc97d Update copyright dates for 2015. 2015-01-17 09:08:15 +00:00
Richard W.M. Jones
6c971faecf Update copyright dates for 2014. 2014-01-02 16:53:34 +00:00
Richard W.M. Jones
9a6cc3c927 daemon: Recognize /dev/ubd[a-] as a valid device name. 2013-08-11 19:49:46 +01:00
Richard W.M. Jones
f473a173b8 daemon: Add more information to certain calls to perror.
Replace selected calls to 'perror (filename)' with:

  fprintf (stderr, "syscall: %s: %m\n", filename);

so that more information is available about precisely which syscall
failed.

Note this is *not* reply_with_perror.  These messages are only printed
in verbose output, for the benefit of debugging.
2013-02-06 13:14:07 +00:00
Richard W.M. Jones
0d18a8b407 Update copyright dates for 2013. 2013-02-02 13:56:19 +00:00
Richard W.M. Jones
c0a3c9ce70 daemon: Run fsync on block devices after sync (RHBZ#836710).
On Linux, sync(2) does not actually issue a write barrier, thus it
doesn't force a flush of the underlying hardware write cache (or
qemu's disk cache in the virtual case).

This can be a problem, because libguestfs relies on running sync in
the appliance, followed by killing qemu (using SIGTERM).

In most cases, this is fine, because killing qemu with SIGTERM should
cause it to flush out the disk cache before it exits.  However we have
found various bugs in qemu which cause qemu to crash while doing the
flush, leaving the data unwritten (see RHBZ#836913).

The solution is to issue fsync(2) to the block devices.  This has a
write barrier, so it ensures that qemu writes out its cache long
before we get around to killing qemu.
2012-07-02 21:13:21 +01:00
Richard W.M. Jones
de5d416fc7 daemon: Move internal-autosync function to new file internal.c.
This is just code motion.
2012-01-21 21:31:50 +00:00
Richard W.M. Jones
08840bab44 Tempus fugit.
Update all copyright dates to 2012.
2012-01-18 22:05:02 +00:00
Matthew Booth
04ea1375c5 Update FSF address. 2011-11-08 14:43:07 +00:00
Richard W.M. Jones
5ce759bfdc daemon: Remove some less useful debugging messages.
Remove some debug messages which were basically left over from when
the code was being developed.

However we leave debug messages where it is printing an external
command that is about to be executed, since those are useful.
2011-05-08 22:01:00 +01:00
Richard W.M. Jones
338ecaac05 daemon: Allow -r option to run daemon standalone.
This changes several aspects of the daemon.  Currently:

* sysroot will be "" (ie. operate directly on /)
* CHROOT_IN/CHROOT_OUT are disabled
* autosync doesn't try to unmount everything
2011-02-03 18:50:44 +00:00
Richard W.M. Jones
d2636b0984 Add a new internal-autosync API to perform autosync.
Instead of explicitly calling umount-all; sync, we add a daemon
function called internal-autosync which does the same.

Apart from slightly simplifying the process of closing the handle, the
main advantage is we can modify the daemon for the standalone case so
that internal-autosync does not do the umount-all operation.
2011-01-28 15:28:25 +00:00
Richard Jones
369872b91e Tab to space (whitespace fixes only). 2010-03-12 16:23:46 +00:00
Richard Jones
34ac5d7b7a daemon: Fix sync() call on Unix. 2009-11-25 16:54:46 +00:00
Richard Jones
fdbc5aa711 sync: Windows implementation of sync() call.
Replace calls to sync() with calls to sync_disks() which supports
Win32 via FlushFileBuffers.
2009-11-25 16:28:26 +00:00
Jim Meyering
d7569c0078 avoid warning about old-style no-param function definition
* daemon/df.c (do_df, do_df_h): Add "void".
* sync.c (do_sync): Likewise.
2009-08-17 11:40:24 +02:00
Jim Meyering
a7b73d4a1e remove trailing blanks 2009-07-03 17:04:21 +02:00
Richard Jones
b4d2a01828 Added test suite. 2009-04-11 17:04:35 +01:00
Richard Jones
40ca9a5782 Daemon and library are mostly talking to each other now. 2009-04-03 17:24:35 +01:00