1606 Commits

Author SHA1 Message Date
Richard Jones
0c43d63781 Version 1.0.87. 1.0.87 2010-03-23 22:29:49 +00:00
Richard Jones
def627e4da New tools: virt-resize and virt-list-partitions.
Virt-resize is the main contribution here, a program which can
be used to expand and shrink partitions in disk images.

Virt-list-partitions is used as an ancillary tool for planning
resize operations.
2010-03-23 21:56:14 +00:00
Richard Jones
b6483061c2 New API: guestfs_copy_size to copy a fixed number of bytes.
This is similar to 'guestfs_dd', but it copies just a fixed
number of bytes from the source to the destination.  It's an
error if the source is too short or if the destination is too
small.
2010-03-23 21:56:14 +00:00
Richard W.M. Jones
5d90acbe4b Change some _exit(0|1) to _exit(EXIT_SUCCESS|EXIT_FAILURE). 2010-03-23 21:46:22 +00:00
Richard Jones
cef4ba0b8f Mac OS X: Fix configure-time tests for Ruby.
For ARCHFLAGS change, see:
http://www.ruby-forum.com/topic/129717#579065

We also add a test for the <guestfs.h> header and include
that header when testing the library.
2010-03-22 10:41:46 +00:00
Richard Jones
e5fa90a795 guestfs.h: Include <stdint.h>.
This allows programs to work if they just
  #include <guestfs.h>
and no other headers.  It's not useful in the general
case, but fixes some configure-time tests, particularly
the one for Ruby on OS X.
2010-03-22 10:41:46 +00:00
Richard Jones
82bd4fac87 ocaml examples: Fix linking line so it uses local library. 2010-03-22 10:41:46 +00:00
Richard Jones
36e8ece4cc Mac OS X: Disable null vmchannel implementation.
As far as I can tell, Darwin has no way to check the peer euid
of a _loopback_ TCP socket.  This is required for the "null vmchannel"
implementation to work securely.

Therefore disable this - Darwin will use one of the other supported
vmchannel implementations instead.
2010-03-22 10:41:46 +00:00
Richard Jones
d4a202aa7b Mac OS X: 'xdr_uint32_t' is 'xdr_u_int32_t' 2010-03-22 10:41:46 +00:00
Richard Jones
fd8b87ec2b Mac OS X: For PATH_MAX, include <limits.h> 2010-03-22 10:41:45 +00:00
Richard Jones
9e397cc16b Mac OS X: setlocale function requires <locale.h> header file. 2010-03-22 10:41:45 +00:00
Richard Jones
dd12eaefb5 Mac OS X: implement readline functions.
OS X has an older version of readline with some differences
in the names of functions.
2010-03-22 10:41:45 +00:00
Richard Jones
5ebf3a3934 Mac OS X: provide alternate implementation of posix_fallocate. 2010-03-22 10:41:45 +00:00
Richard Jones
b2070ae3d7 Mac OS X: include <rpc/types.h> before <rpc/xdr.h>
In PortableXDR this is not included automatically so we
have to include it explicitly to get definitions for the
XDR types.
2010-03-22 10:41:45 +00:00
Richard Jones
cc6a6a3dcc Mac OS X: include <string.h> in guestfs-actions.c
This is required because guestfs-actions.c uses 'memset'.
2010-03-22 10:41:45 +00:00
Richard Jones
b369fa6f91 Mac OS X: Fix HAVE_GNU_CALLOC so it works when __GLIBC__ is not defined. 2010-03-22 10:41:45 +00:00
Richard Jones
a28791d6ac Mac OS X: strerror_r on Macs is not like GNU strerror_r.
Really this should be turned into a configure-time test.
Perhaps one exists already?
2010-03-22 10:41:44 +00:00
Richard Jones
a6802f80b3 Mac OS X: define MAX macro if not already defined. 2010-03-22 10:41:44 +00:00
Richard Jones
73e472f1f1 Mac OS X: kill(2) requires <signal.h> 2010-03-22 10:41:44 +00:00
Richard Jones
1bf7668110 generator: Small fix for GODI users.
GODI has an odd package layout, so the generator was unable to
find xml-light.  Add the GODI directory to the search path.
2010-03-22 10:41:44 +00:00
Richard Jones
df54298591 Ignore m4/intmax.m4 2010-03-22 10:41:44 +00:00
Richard Jones
35e916dbcf Remove out-of-date comment. 2010-03-22 10:41:44 +00:00
Richard Jones
ef044690c5 configure: Add --disable-daemon and --disable-appliance options.
Use these on any platforms where you don't want or need to
build the daemon/appliance combination.
2010-03-22 10:41:44 +00:00
Richard Jones
b7d59e2cda Run qemu with -nographic option.
On Mac OS X this prevents a short "flash" as qemu opens a
toplevel window.
2010-03-22 10:41:44 +00:00
Richard Jones
a7cb2d9b08 configure: Move host_cpu definition to earlier in the file. 2010-03-22 10:41:43 +00:00
Richard Jones
4a065c99e4 appliance: Run depmod to create modules.dep for the kernel.
Since we disabled running new-kernel-pkg in febootstrap, this
has meant that the normal appliance has not had a modules.dep
file.  (Supermin was unaffected by this).
2010-03-22 10:41:16 +00:00
Richard Jones
7581672c78 Mac OS X: Detect bindtextdomain.
These are missing on Mac OS X.  I think you would need to install
a gettext package to get these.
2010-03-22 08:48:08 +00:00
Richard Jones
f5d52fa3c0 Mac OS X: Use gnulib setenv module explicitly.
See:
https://www.redhat.com/archives/libguestfs/2010-March/thread.html#00094
2010-03-22 08:38:36 +00:00
Richard Jones
50d2af4f85 New APIs: Query the relationship between LVM objects.
These calls allow you to query the relationship between
LVM objects, for example, which PVs contain a VG, or which
LVs are contained in a VG.

See the example / test program 'regressions/test-lvm-mapping.pl'
for an example of how to do this from Perl.
2010-03-18 15:21:08 +00:00
Richard Jones
27e73269d3 daemon: Add a trim utility function.
This function trims the whitespace from around a string.  It
does this in-place, so it can be called for malloc'd strings.
2010-03-18 15:21:04 +00:00
Richard Jones
676462684e add_drive_ro adds readonly=on option if available.
Change the add_drive_ro call so it adds the readonly=on option
if qemu supports that.

This just means that qemu will not try to open the drive with
O_RDWR, and should not otherwise change the behaviour of qemu or
libguestfs.  (In particular, writes to the read-only drive are
still permitted, and are just discarded when the handle is closed).

However it should alleviate RHBZ#571714 where udev was deciding
to incorrectly relabel a device because we had opened the device
for writing (even though we didn't actually write to it).
2010-03-16 21:50:13 +00:00
Richard Jones
5442f45aea Allow qemu_supports to run earlier.
Reimplement qemu_supports() internal function.  Allow it to run
before launch so we can test qemu features.  Document that you
should run guestfs_set_qemu as early as possible to make sure
these tests are reliable.
2010-03-16 21:44:26 +00:00
Richard Jones
f8d781a00d Add minimal vim to the appliance for virt-rescue.
virt-rescue lacks an editor.  Add vim-minimal (Fedora)
or vim-tiny (Debian) to make up for this omission.
2010-03-16 21:13:06 +00:00
Richard Jones
760a1c84d7 tests: Don't use <guestfs-internal.h> in tests.
It was failing when including this header, as a consequence
of earlier commit 1f56debfcf.
2010-03-16 21:13:06 +00:00
Richard Jones
d89955fde9 guestfs.h: More adjustment to comments in the header file. 2010-03-16 11:50:39 +00:00
Richard Jones
1f56debfcf guestfs.h: Move some internal functions to the internal header.
Functions like guestfs__send were never exported through the public
API (libguestfs.syms prevented that).  However they appeared in the
public header.  Move them to the internal header.
2010-03-16 11:18:51 +00:00
Richard Jones
504177b0aa Rearrangement and comment changes in <guestfs.h> header file.
There should be no substantive change.
2010-03-16 11:15:28 +00:00
Richard Jones
84bcb4dbee Prepare for version 1.0.86. 1.0.86 2010-03-12 18:28:21 +00:00
Richard Jones
369872b91e Tab to space (whitespace fixes only). 2010-03-12 16:23:46 +00:00
Richard Jones
ffa3af3b5d Docs: Change exit(1) -> exit(EXIT_FAILURE) 2010-03-12 16:23:14 +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
891aac7a0c guestfish: Use xstrtoll to parse Int params (RHBZ#569757 RHBZ#567567).
Change guestfish so it uses xstrtoll to parse Int (31 bit)
parameters.  This fixes two bugs on 32 bit platforms which
failed when long = 32 bits.  long long = 64 bits on both.
2010-03-12 15:13:05 +00:00
Richard Jones
599f94c9c1 Special case hostfiles handling for libntfs-3g.so
The ntfs-3g project keeps bumping their soname, and this causes
dependency problems for the Fedora package.  The root of the problem
is we depend on /lib/libntfs-3g.so.<N>, but if <N> keeps bumping,
the dependency keeps breaking.

This commit changes the hostfiles (and hence dependency) to be on
/lib/libntfs-3g.so.* instead.  The downside to this is we could end
up pulling more files into the appliance than are strictly required,
but it will fix the Fedora packaging problems being felt by the
Fedora maintainer of ntfs-3g.

After applying this commit, the change to hostfiles looks like this:

@@ -1489,7 +1489,7 @@
 ./lib/libpam_misc.so.0
 ./lib/libdmraid.so
 ./lib/libidn.so.11
-./lib/libntfs-3g.so.74
+./lib/libntfs-3g.so.*
 ./lib/libext2fs.so.2.*
 ./lib/libpam.so.0
 ./lib/libsepol.so.1
@@ -1520,7 +1520,6 @@
 ./lib/libnss_files-*.so
 ./lib/libgio-2.0.so.0
 ./lib/libpam_misc.so.0.*
-./lib/libntfs-3g.so.74.*
 ./lib/libanl.so.1
 ./lib/libdevmapper-event-lvm2.so.2.*
 ./lib/libpthread.so.0
2010-03-12 15:13:05 +00:00
Richard Jones
ebfcb7f23d inspector: Read information about Windows guests from the Registry.
This commit changes substantially the way that we get information
about Windows guests.  We now use the Windows Registry to get
information such as the version, product name and much else.

This uses Win::Hivex (ie. the hivex library).  'reged' is no longer
needed or used.

As an incidental change, this also tries harder to search for
%systemroot%, in the case when we cannot find boot.ini (ie.
Windows Vista and more recent).  This ensures we can get more
detail from those versions of Windows.
2010-03-08 19:35:23 +00:00
Richard Jones
4851466ec5 inspector: Add product_name field to output.
This is a free text string containing the "product name" of
the OS.  It's mainly useful for Windows guests, and a forthcoming
patch will get this field from the Windows Registry.
2010-03-08 19:35:22 +00:00
Richard Jones
ed6fc794c8 inspector: Don't crash if $os->{kernels} does not exist.
ie. on Windows.
2010-03-08 19:35:22 +00:00
Richard Jones
dcfa05f703 inspector: Sort application names.
This ensures the list of applications is stable.
2010-03-08 19:24:48 +00:00
Richard Jones
aca024e976 Remove plymouth libraries from the appliance. 2010-03-08 16:04:09 +00:00
Daniel Cabrera
f550f31477 Spanish translation of libguestfs (RHBZ#570181). 2010-03-03 15:49:39 +00:00
Richard Jones
4891ff9945 More complete fix for bash regexp quoting bug.
Commit 457fccae1b was not a complete fix, in that it
didn't work properly on RHEL 5 era bash (3.2.x).  For example:

  file=libntfs-3g.so.74
  [[ "$file" =~ ^lib(.*)\.so\.([0-9]+)\. ]] && \
    echo "lib${BASH_REMATCH[1]}.so.${BASH_REMATCH[2]}.*"

would on those old shells print:

  libntfs-3g.so.7.*

It seems the final \. was being treated as a plain period (ie.
match anything).

The only way to work around this incompatibility is to assign the
patterns to variables and match on those, ie:

  p='^lib(.*)\.so\.([0-9]+)\.'
  [[ "$file" =~ $p ]] && ...

This works in both old and new shells.
2010-03-02 10:34:20 +00:00