Commit Graph

1815 Commits

Author SHA1 Message Date
Richard Jones
71b02d6654 New API: resize2fs-size to allow shrinking ext2 filesystems (RHBZ#585221). 2010-05-21 14:51:54 +01:00
Richard Jones
5e1aff7856 fish: Allow suffixes on number parameters (eg. 1M)
This small change uses the gnulib xstrtoll functionality to
enable suffixes on integer parameters in guestfish.  For example:

 truncate-size /file 1G

(previously you would have had to given the full number).

This also applies to the 'alloc' and 'sparse' commands (and
indirectly to the -N option).  The specification for these commands
has changed slightly, in that 'alloc foo 1MB' would now use SI
units, allocating 1000000 bytes instead of a true megabyte.  All
existing uses would use 'alloc foo 1M' which still allocates true
megabytes.
2010-05-21 14:51:53 +01:00
Richard Jones
48a216a06d fish: Fix '-N part' disk partition type sub-option. 2010-05-21 14:51:53 +01:00
Richard Jones
478e1942a9 TODO: Suggest including undelete utility. 2010-05-21 11:25:36 +01:00
Richard Jones
aecdf3c117 Fix name of update-bugs script in output file BUGS. 2010-05-21 11:25:19 +01:00
Richard Jones
5f9630338b ubuntu: Use direct udevd method to start udev on Ubuntu.
On Ubuntu, /etc/init.d/udev is a symlink to an upstart file,
but running that causes the appliance to hang.

Therefore detect if this is a symlink and fall through to the
direct start of udevd.  This shouldn't affect Debian because the
file is not a symlink on standard Debian.
2010-05-20 18:57:20 +01:00
Richard Jones
4557112772 ubuntu: Remove two FUSE packages from the default list.
fuse-utils (a dependency of these) cannot be installed under
debirf because it does something with the system udevd which is
not permitted.  Seems to be a bug either in fakeroot or in the
post install scripts for fuse-utils.
2010-05-20 17:37:19 +01:00
Richard Jones
4312988e0e ubuntu: Ignore packages in packagelist.in which are missing.
For distros using 'yum', packages which cannot be found are just
ignored.  This allows us to include for example 'e4fsprogs' on the
list even though that only exists on RHEL 5.

However for Debian-derived distros, missing packages would cause
apt to fail.  This was particularly a problem when building Ubuntu
since it doesn't have as complete a list of packages, and the list
changed a lot between releases.

This commit adds a check first for missing packages, ignoring those
and thus acting more like 'yum'.
2010-05-20 17:37:16 +01:00
Richard Jones
2954491e73 Ubuntu: Use apt-get instead of aptitude when installing guestfsd. 2010-05-20 17:37:14 +01:00
Richard Jones
a34fadf900 Ubuntu: Revert install-kernel to debirf default script. 2010-05-20 17:37:11 +01:00
Richard Jones
53ca11ee44 generator: Make 'xz' into an optional group.
On Ubuntu <= Karmic, xz-utils was not packaged, and therefore
any xz-related tests would fail.  Thus make this an optional
group so that we can test for this and avoid running the tests
if xz utils are not present.
2010-05-20 10:42:21 +01:00
Richard Jones
30c091f49d generator: Check parameters are not NULL (RHBZ#501893).
This adds additional tests to check that several types of parameter
including String are not NULL when passed to the C functions.
Previously this would cause a segfault inside libguestfs.  With
this change, you get an error message / exception.

Of the possible pointer parameters, only OptString is now permitted
to be NULL.

This change does not affect the Perl bindings.  This is because Perl
XS code was already adding similar checks if you passed undef into
a parameter expecting a string.
2010-05-20 10:30:12 +01:00
Richard Jones
e715451fae generator: Some String parameters should be OptString (RHBZ#501894).
I haven't checked the list of functions exhaustively, but
these are the obvious ones.
2010-05-20 10:30:12 +01:00
Richard Jones
9735484c35 fuse: Implement write syscall (RHBZ#592883). 2010-05-20 10:30:12 +01:00
Richard Jones
1214b32162 New API: Implement pwrite system call (partial fix for RHBZ#592883). 2010-05-20 10:30:12 +01:00
Richard Jones
3920ad95f6 New API: write for creating files with fixed content (RHBZ#501889).
The guestfs_write call can be used to create small files with
arbitrary 8 bit content, including \0 bytes.

This replaces and deprecates write-file, which cannot be modified
to use BufferIn because of an unfortunate choice in the ABI: the
size parameter to write-file, if zero, means that the daemon tries
to calculate the length of the buffer using strlen.  However this
fails if we pass a zero-length buffer using BufferIn because then
the daemon tries to do strlen on a (really) zero length buffer, not
even containing a terminating \0 character, thus segfaulting.
2010-05-20 10:30:12 +01:00
Richard Jones
bda6cf75f2 generator: Implement BufferIn parameter type (RHBZ#501889).
The BufferIn argument turns into various things:

 in C      const char *, size_t parameter pair

 in XDR    an opaque<> type (instead of string) which allows \0 chars

 in other bindings
           mostly just a string, since most languages except for C
           permit strings to contain any 8 bit data
2010-05-20 10:30:12 +01:00
Richard Jones
5af010c96d fish: Fix build error if built without readline.
fish.c:1447: error: 'add_history_line' defined but not used [-Wunused-function]

(Reported by Matt Booth)
2010-05-20 10:30:12 +01:00
Richard Jones
6e10a24df0 appliance: Fix /etc/resolv.conf
Since changing to use link local address
(commit fbf29976b3)
we have included an incorrect resolv.conf file in the appliance
which points to the old (qemu) DNS server.  This commit changes
to use the new DNS server.
2010-05-20 10:30:12 +01:00
Richard Jones
58d1f3c030 Update BUGS. 2010-05-19 11:06:46 +01:00
Daniel Cabrera
49fae775c4 Update Spanish translations (RHBZ#593292). 2010-05-18 14:38:57 +01:00
Richard Jones
2dc7bb0033 appliance: Ignore utempter unreadable binaries (for RHEL 6). 2010-05-18 10:37:11 +01:00
Richard Jones
155aa76e57 appliance: Change comment about unreadable binaries. 2010-05-18 10:01:45 +01:00
Richard Jones
f1b651a99b Version 1.3.13. 1.3.13 2010-05-15 21:07:49 +01:00
Richard Jones
ef5f132588 Update BUGS 2010-05-15 20:40:25 +01:00
Richard Jones
d858418b8b Update PO files. 2010-05-15 08:44:04 +01:00
Richard Jones
002dc21cba Generate BUGS file from Red Hat Bugzilla database.
Add a script which generates the 'BUGS' file from Red Hat Bugzilla.
This is run whenever we do 'make dist' and deliberately stored in git.
2010-05-15 08:43:02 +01:00
Richard Jones
5d5565ca24 virt-df: Display domains in sorted order. 2010-05-14 19:42:48 +01:00
Richard Jones
ee03a22f41 Updated Spanish translations (RHBZ#592360). 2010-05-14 17:41:39 +01:00
Richard Jones
40d270b011 Ensure ordinary appliance is updated before trying to build supermin appliance. 2010-05-14 15:43:51 +01:00
Richard Jones
2357adc79a Version 1.3.12, update PO files. 1.3.12 2010-05-14 12:38:39 +01:00
Richard Jones
8700a55d52 Unify supermin appliance building using febootstrap 2.7 2010-05-13 18:52:15 +01:00
Richard Jones
55748a94bc Improve errors from tar-in/tgz-in commands (RHBZ#591155 RHBZ#591250).
This commit improves the error messages from the tar-in, tgz-in (etc)
commands by capturing the stderr from the tar command in a file and
sending that back in the error message.

The method used for the error file is primitive, and there is a case
for a more generic error file mechanism, but this will do for now.

Sample error messages after this change:

$ virt-tar -u /tmp/test1.img /tmp/not.tar /
tar_in: tar subcommand failed on directory: /: tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors at /home/rjones/d/libguestfs/tools/virt-tar line 247.

$ virt-tar -u /tmp/test1.img /tmp/test.tar /
tar_in: tar subcommand failed on directory: /: tar: access.log: Cannot open: Read-only file system
tar: Exiting with failure status due to previous errors at /home/rjones/d/libguestfs/tools/virt-tar line 247.
2010-05-13 17:08:02 +01:00
Richard Jones
b76fd51e14 Combine common code in daemon/tar.c.
This commit shouldn't result in any change in the semantics
of the code.
2010-05-13 17:08:02 +01:00
Richard Jones
dc706a639e Fix FileIn cmds losing synch if both ends send cancel messages (RHBZ#576879).
During a FileIn command (eg. upload, tar-in) if both sides
experience errors, then both sides could send cancel messages,
the result being lost synchronization.

The reason for the lost synch was because the daemon was ignoring
this case and sending an error message back which the library side
(which had cancelled) was not expecting.

Fix this by checking in the daemon for the case where the library
also cancels during daemon cancellation, and not sending an error
messages.

This also includes an enhanced regression test which checks for this
case.

This extends the original fix in
commit 5922d7084d.

More details can be found here:
https://bugzilla.redhat.com/show_bug.cgi?id=576879#c5
2010-05-13 17:08:02 +01:00
Richard Jones
11a2ad8c9a guestfish: Fix build error in 'print_shell_quote' function.
Amend commit 1c6ed48bd3 so the prototype of
'print_shell_quote' function is correct.
2010-05-13 17:07:45 +01:00
Richard Jones
520d895383 fish: Fix guestfish -N option when called with unknown image type.
Previously it was falling off the end of the loop if you
called it with an unknown image type.
2010-05-13 16:22:10 +01:00
Richard Jones
94e310dcfb Improved error if virt-inspector cannot find OSes in image (RHBZ#591142). 2010-05-13 16:22:10 +01:00
Richard Jones
287f8957fe Fix error message in string-e command (RHBZ#588651). 2010-05-13 16:22:10 +01:00
Richard Jones
1c6ed48bd3 guestfish -i and virt-inspector work on filenames containing spaces (RHBZ#507810).
This commit fixes a long-standing bug which prevented guestfish -i
and virt-inspector from working on disk images which had a space
in the filename (or other unsafe characters).  It works by ensuring
that the strings passed between guestfish -i and virt-inspector are
quoted correctly in both directions.

Note that this commit adds a dependency from virt-inspector to
the perl module String::ShellQuote.  We have previously used this
module in virt-make-fs.
2010-05-13 16:22:05 +01:00
Richard Jones
7232458080 Add version numbers to Perl modules (RHBZ#521674).
Sys::Guestfs now contains a version number which reflects the
ABI that we are compiled against, ie. '0.<MAX_PROC_NR>'.  This has
the beneficial side effect of causing an error if the user tries
to mix versions of the Perl module and the XS code.

Sys::Guestfs::Lib now contains a synthetic version number which
will reflect future changes in that module.
2010-05-12 18:13:01 +01:00
Richard Jones
b7046fecee Update PO files, including extra strings from Perl files. 2010-05-12 18:13:01 +01:00
Richard Jones
feb0cd0482 po: Include strings from Perl programs in the PO files (RHBZ#559963).
xgettext will only recognize '*.pl' as being a Perl file (otherwise
it treats it as a C file and does not correctly find any strings
in it).

This commit also fixes two actual bugs that xgettext found in the
strings in our Perl programs.
2010-05-12 18:13:01 +01:00
Richard Jones
4813311807 po: Don't generate po/Makevars file and include Perl keywords (RHBZ#559963).
I don't see a reason to autogenerate po/Makevars, and in the
earlier commit which changed this file to being autogenerated
we accidentally lost the special Perl keywords, copyright notice
and bug reporting address.  Fix all of that.

This partially reverts commit febff9d2a3.
2010-05-12 18:13:01 +01:00
Richard Jones
5477d98548 Reduce imported functions in virt-df to ones which are actually used. 2010-05-12 18:13:01 +01:00
Richard Jones
0c1e77219e New API: fill-pattern for creating files with predefined patterns. 2010-05-12 17:33:16 +01:00
Richard Jones
9d158c3ab1 Run udev_settle() after swapon/swapoff (RHBZ#516096). 2010-05-12 16:13:07 +01:00
Richard Jones
87eecb507e fish: With both '-x' and '-i', pass through '-x' to inferior process. 2010-05-12 16:13:07 +01:00
Richard Jones
3cead72850 Version 1.3.11. 1.3.11 2010-05-08 20:12:55 +01:00
Richard Jones
f35365ecbf virt-rescue: Add extra options.
This commit adds the extra options '--append', '--memsize' and '--selinux'.
2010-05-08 19:57:52 +01:00