Commit Graph

45 Commits

Author SHA1 Message Date
Richard W.M. Jones
9df9c87147 configure: Move ocaml-gettext writing boilerplate to separate m4 module.
This is just code motion.

NOTE that after this commit you have to do:

  aclocal -I m4
  autoconf

as 'make' may not do this automatically.
2014-02-13 21:07:40 +00:00
Richard W.M. Jones
308292e4fb Update to latest gnulib. 2013-12-18 16:19:08 +00:00
Richard W.M. Jones
cfa0ec55ce Update gnulib to latest version. 2013-05-21 17:14:32 +01:00
Richard W.M. Jones
f4d5f3d6a2 Update gnulib to latest. 2013-04-11 14:42:54 +01:00
Richard W.M. Jones
e73944faf4 RHEL 5: gnulib: Use module mkstemps.
RHEL 5 glibc doesn't have this function.
2013-03-09 18:53:51 +00:00
Richard W.M. Jones
e4495b24bc daemon: link: Remove use of PATH_MAX.
Replace readlink calls with gnulib areadlink function.
2013-02-11 13:21:51 +00:00
Richard W.M. Jones
903e4864c0 Update gnulib to latest version for libguestfs 1.20 release. 2012-12-11 23:24:00 +00:00
Richard W.M. Jones
bdfe221671 configure: Fix capitalization in configure script.
Just make the output of ./configure --help and the <config.h>
file consistent.
2012-10-12 22:03:11 +01:00
Richard W.M. Jones
e942c02a2e Update to latest gnulib. 2012-09-17 10:07:27 +01:00
Richard W.M. Jones
4efa0f8f38 m4: Sort .gitignore with LANG=C. Also add pipe2.m4 (used by RHEL 6). 2012-07-31 13:41:51 +01:00
Masami HIRATA
399887defd Mac OS X: Use real files for gtk-doc (not the symlink)
Signed-off-by: Masami HIRATA <msmhrt@gmail.com>
2012-07-24 19:40:39 +01:00
Masami HIRATA
a47fa7a65e Mac OS X: Use gnulib fstatat module explicitly.
Signed-off-by: Masami HIRATA <msmhrt@gmail.com>
2012-07-24 19:18:37 +01:00
Masami HIRATA
d6ef91d7c4 Mac OS X: Use gnulib memmem module explicitly.
m4/.gitignore: Update.

Signed-off-by: Masami HIRATA <msmhrt@gmail.com>
2012-07-24 19:18:37 +01:00
Richard W.M. Jones
7b72c12428 Update to latest gnulib. 2012-05-09 16:13:57 +01:00
Richard W.M. Jones
75514ab57a Remove gettextize.
Replace the sociopathic nonsense in gettextize with a simple
Makefile.am which does the same ... and is faster.
2012-05-01 08:58:15 +01:00
Matthew Booth
b0ebf37a94 gobject: Add infrastructure to build gtk-doc 2012-03-28 20:04:20 +01:00
Richard Jones
b169b03dd4 m4: Update .gitignore for old Fedora. 2012-03-28 18:55:38 +01:00
Richard W.M. Jones
7972b1da81 Update to latest gnulib.
This contains a workaround for stdalign bug:
http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00340.html
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023

(Thanks Paul Eggert).
2012-01-27 18:56:14 +00:00
Matthew Booth
5c5babb40b gobject: Add GObject bindings 2012-01-20 18:12:38 +00:00
Richard W.M. Jones
065b6b5798 gnulib: Rebase to latest. 2011-11-22 16:41:48 +00:00
Richard W.M. Jones
aa88c1bbd2 Update to latest gnulib. 2011-09-24 19:06:23 +01:00
Richard W.M. Jones
60d5a50f4d daemon: Remove separate configure of daemon subdirectory.
Combine the two Gnulib instances together.

Add checks from old daemon/configure.ac into configure.ac.

Fix daemon/Makefile.am so it is like a normal subdirectory
Makefile.am.

Because we are now using the replacement strerror_r function from
Gnulib (instead of the one from glibc directly), this requires a small
change to src/guestfs.c.
2011-08-05 12:34:11 +01:00
Jim Meyering
92a7d592df build: update to latest gnulib
* .gnulib: Update submodule to latest.
* daemon/m4/gnulib-cache.m4: Regenerate.
2011-06-10 12:29:38 +01:00
Richard W.M. Jones
fbc2555903 New tool: virt-filesystems
This tool replaces virt-list-filesystems and virt-list-partitions with
a new tool written in C with a more uniform command line structure
and output.

This existing Perl tools are deprecated but remain indefinitely.
2010-11-23 10:22:08 +00:00
Richard Jones
32f48cc333 gnulib: Ignore asm-underscore.m4 in the correct place. 2010-06-04 11:21:58 +01:00
Richard Jones
01c1d82823 Update to latest gnulib. 2010-05-06 18:57:25 +01:00
Richard Jones
df54298591 Ignore m4/intmax.m4 2010-03-22 10:41:44 +00:00
Richard Jones
cb9613b993 Rewrite libguestfs-supermin-helper in C.
libguestfs-supermin-helper was previously a shell script.  Although
we had steadily optimized it, there were a number of intractable
hot spots:

  (1) cpio still reads input files in 512 byte chunks; this is *very*
    pessimal behaviour, particularly when SELinux is enabled.
  (2) the hostfiles globbing was done very inefficiently by the shell,
    with the shell rereading the same directory over and over again.

This is a rewrite of this shell script in C.  It is approximately
3 times faster without SELinux, and has an even greater speed difference
with SELinux.

The main features are:

  (a) It never frees memory, making it simpler.  The program is designed
    to run and exit in sub-second times, so this is acceptable.
  (b) It caches directory reads, making the globbing of host files much
    faster (measured this as ~ 4 x speed up).
  (c) It doesn't use external cpio, but instead contains code to write
    newc format cpio files, which is all that the kernel can read.  Unlike
    cpio, this code uses large buffers for reads and writes.
  (d) Ignores missing or unreadable hostfiles, whereas cpio gave a
    warning.
  (e) Checks all return values from system calls.
  (f) With --verbose flag, it will print messages timing itself.

This passes all tests.

Updated with feedback from Jim Meyering.
2010-03-12 16:21:58 +00:00
Richard Jones
97dac113f9 Misc documentation and gitignore update. 2010-02-04 10:26:12 +00:00
Richard Jones
58abe782bf guestfish: Use xstrtol to parse integers (RHBZ#557655).
Current code uses atoi to parse the generator Int type and
atoll to parse the generator Int64 type.  The problem with the
ato* functions is that they don't cope with errors very well,
and they cannot parse numbers that begin with 0.. or 0x..
for octal and hexadecimal respectively.

This replaces the atoi call with a call to Gnulib xstrtol
and the atoll call with a call to Gnulib xstrtoll.

The generated code looks like this for all Int arguments:

  {
    strtol_error xerr;
    long r;

    xerr = xstrtol (argv[0], NULL, 0, &r, "");
    if (xerr != LONGINT_OK) {
      fprintf (stderr,
               _("%s: %s: invalid integer parameter (%s returned %d)\n"),
               cmd, "memsize", "xstrtol", xerr);
      return -1;
    }
    /* The Int type in the generator is a signed 31 bit int. */
    if (r < (-(2LL<<30)) || r > ((2LL<<30)-1)) {
      fprintf (stderr, _("%s: %s: integer out of range\n"), cmd, "memsize");
      return -1;
    }
    /* The check above should ensure this assignment does not overflow. */
    memsize = r;
  }

and like this for all Int64 arguments (note we don't need the
range check for these):

  {
    strtol_error xerr;
    long long r;

    xerr = xstrtoll (argv[1], NULL, 0, &r, "");
    if (xerr != LONGINT_OK) {
      fprintf (stderr,
               _("%s: %s: invalid integer parameter (%s returned %d)\n"),
               cmd, "size", "xstrtoll", xerr);
      return -1;
    }
    size = r;
  }

Note this also fixes an unrelated bug in guestfish handling of
RBufferOut.  We were using 'fwrite' without checking the return
value, and this could have caused silent failures, eg. in the case
where there was not enough disk space to store the resulting file,
or even if the program was interrupted (but continued) during the
write.

Replace this with Gnulib 'full-write', and check the return value
and report errors.
2010-01-25 12:07:34 +00:00
Richard Jones
008cbfcc15 Update to latest Gnulib. 2010-01-13 11:27:50 +00:00
Richard Jones
cada248a53 lib: Add thread-safety to global list of handles.
This commit uses the Gnulib 'lock' module to implement a mutex on
the global list of handles which is stored by the library.

Note that Gnulib nicely avoids explicitly linking with -lpthread
unless the application program itself links to -lpthread.  Locks
are only enabled in multithreaded applications.

$ ldd src/.libs/libguestfs.so.0.217.0
	linux-vdso.so.1 =>  (0x00007fffcb7ff000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f96a4e6c000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f96a544d000)

Please enter the commit message for your changes. Lines starting
2009-12-07 11:13:12 +00:00
Richard Jones
4e9fefd4e8 build: update gnulib submodule to latest 2009-11-20 10:48:02 +00:00
Richard Jones
429de22541 FUSE filesystem support.
This implements FUSE filesystem support so that any libguestfs-
accessible disk image can be mounted as a local filesystem.

Note: file writes (ie. write(2) system call) is not yet implemented.

The API needs more test coverage, particularly lesser-used system
calls.

The big unresolved issue is UID/GID mapping between guest filesystem
IDs and the host.  It's not easy to automate this because you need
extra details about the guest itself in order to get to its
UID->username map (eg. /etc/passwd from the guest).
2009-11-03 15:57:26 +00:00
Richard Jones
74bde73d5c daemon: Change chdir to use openat/fdopendir.
Uses Gnulib implementation of openat which should be portable.
2009-10-26 15:09:06 +00:00
Richard Jones
dcb5aa0183 Gnulib: Add arpa-inet and netinet-in modules. 2009-09-22 10:55:03 +01:00
Jim Meyering
0fc0e4bd73 build: use only one m4/ directory
* Makefile.am (ACLOCAL_AMFLAGS): Specify only one include dir: m4.
* bootstrap: Tell gnulib-tool to put .m4 files in m4/, not gnulib/m4.
* autogen.sh: Move autoreconf from here into...
* bootstrap: ...here, so that it is run only when gnulib-tool is.
Also, tell it to skip the usual autopoint and libtoolize runs.
* m4/.gitignore: Update.
2009-08-25 18:44:27 +02:00
Jim Meyering
2f1a50d816 Convert all TABs-as-indentation to spaces.
Do it by running this command:
[exempted files are matched via .x-sc_TAB_in_indentation]

  git ls-files \
    | pcregrep -vf .x-sc_TAB_in_indentation \
    | xargs pcregrep -l '^ *\t' \
    | xargs perl -MText::Tabs -ni -le \
      '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
2009-08-03 17:17:57 +02:00
Jim Meyering
72c829395b Remove files imported via autogen.sh.
* m4/.gitignore: Ignore these files.
* m4/codeset.m4: Remove file.
* m4/gettext.m4: Likewise.
* m4/glibc2.m4: Likewise.
* m4/glibc21.m4: Likewise.
* m4/iconv.m4: Likewise.
* m4/intdiv0.m4: Likewise.
* m4/intl.m4: Likewise.
* m4/intldir.m4: Likewise.
* m4/intlmacosx.m4: Likewise.
* m4/intltool.m4: Likewise.
* m4/inttypes-pri.m4: Likewise.
* m4/inttypes.m4: Likewise.
* m4/inttypes_h.m4: Likewise.
* m4/isc-posix.m4: Likewise.
* m4/lcmessage.m4: Likewise.
* m4/lib-ld.m4: Likewise.
* m4/lib-link.m4: Likewise.
* m4/lib-prefix.m4: Likewise.
* m4/lock.m4: Likewise.
* m4/longdouble.m4: Likewise.
* m4/longlong.m4: Likewise.
* m4/nls.m4: Likewise.
* m4/po.m4: Likewise.
* m4/printf-posix.m4: Likewise.
* m4/progtest.m4: Likewise.
* m4/signed.m4: Likewise.
* m4/size_max.m4: Likewise.
* m4/stdint_h.m4: Likewise.
* m4/uintmax_t.m4: Likewise.
* m4/ulonglong.m4: Likewise.
* m4/visibility.m4: Likewise.
* m4/wchar_t.m4: Likewise.
* m4/wint_t.m4: Likewise.
* m4/xsize.m4: Likewise.
2009-08-03 17:17:55 +02:00
Richard Jones
3fc2412186 Remove files generated by autoreconf (Guido Gunter and Matthew Booth). 2009-07-06 12:03:35 +01:00
Jim Meyering
a7b73d4a1e remove trailing blanks 2009-07-03 17:04:21 +02:00
Richard Jones
e58626a0e5 Back to GNU gettext 0.14 for RHEL 5. 2009-05-27 16:17:13 +01:00
Richard Jones
d70248333e Gettextize the source, make library strings translatable. 2009-05-21 12:01:36 +01:00
Richard Jones
29204fe10d Intltoolize the source. 2009-05-21 10:54:32 +01:00
Richard Jones
acf9000252 Added framework for the language bindings. 2009-04-07 13:08:50 +01:00