Commit Graph

2602 Commits

Author SHA1 Message Date
Richard W.M. Jones
db98ac041e java: Enable assertions when doing 'make check'.
It turns out that Java assertions are disabled by default.  You have
to add the 'java -ea' flag to the JVM.  Who knew ..?

Because of this oversight, the tests weren't actually performing the
assertions that we wanted (although in fact none of the assertions
were failing).

This change enables assertions when running the tests.
2011-03-02 05:11:55 +00:00
Richard W.M. Jones
f455dc3814 Version 1.9.8. 1.9.8 2011-02-06 17:18:24 +00:00
Richard W.M. Jones
8d7d7c4ecf daemon: Ignore return value from chdir.
This updates commit 7eb012f371.
2011-02-03 19:33:30 +00:00
Richard W.M. Jones
a20e5c00c3 fish: Add guestfish --live, guestmount --live options.
The other programs have the variable, but the flag is not enabled
either because it doesn't make sense or because the implications are
not well understood.
2011-02-03 18:50:45 +00:00
Richard W.M. Jones
2020eded8a Add documentation for attach method. 2011-02-03 18:50:45 +00:00
Richard W.M. Jones
cfd9513a54 Add guestfs_add_domain 'live' flag.
This optional flag controls whether this API call will try to connect
to a running virtual machine 'guestfsd' process.

If the flag is given and the virtual machine is running, then the
libvirt XML is parsed looking for a suitable <channel> element, and
'guestfs_set_attach_method' is called with the corresponding
virtio-serial socket path.
2011-02-03 18:50:45 +00:00
Richard W.M. Jones
17434fb159 lib: Implement attach-method unix:<path>
Allow connections to a Unix domain socket which is connected
(via virtio-serial) to a guestfsd running free in an existing
guest.

In order to use this you have to add the following element
to the libvirt XML:

  <channel type='unix'>
    <source mode='bind' path='/tmp/socket'/>
    <target type='virtio' name='org.libguestfs.channel.0'/>
  </channel>

(or perform the equivalent on the qemu command line).

Then in guestfish, you can do:

  guestfish \
    attach-method unix:/tmp/socket : \
    run : \
    ll /

(or any other commands as desired).
2011-02-03 18:50:45 +00:00
Richard W.M. Jones
91324e0a73 daemon: Remove -f (don't fork) option.
This option was not being used.
2011-02-03 18:50:44 +00: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
7eb012f371 daemon: change to root directory
Ensure the daemon always starts with current directory == root.
2011-02-03 18:50:17 +00:00
Richard W.M. Jones
58bcfdf321 New APIs: set-attach-method, get-attach-method.
These allow you to get and set the attach method.  The format
is one of:

* appliance
* unix:<path>

It's stored broken out into an enum and a string in the handle.
2011-02-03 18:41:49 +00:00
Richard W.M. Jones
99f0d8859f lib: Move appliance launching to separate function.
This is just code motion.
2011-02-03 18:41:49 +00:00
Richard W.M. Jones
5ae7525592 php: Ignore another generated file in php/extension directory. 2011-02-03 10:56:01 +00:00
Richard W.M. Jones
61a1a2b71c daemon: Parse /proc/mounts instead of /etc/mtab
Since Fedora util-linux 2.19, the %post script does:

  rm -f /etc/mtab
  ln -s /proc/mounts /etc/mtab

We are no longer running %post scripts, so this means that /etc/mtab
is a plain file in the appliance.  Usual 'mount' still updates it, but
for some reason mount.ntfs does *not* update it in Fedora 15, meaning
that you couldn't mount and then operate on NTFS partitions.

It seems better to always parse /proc/mounts (ie. what the kernel
thinks is mounted) unconditionally, rather than relying on the
capriciousness of the external mount command.

Therefore, parse /proc/mounts instead of /etc/mtab, but add a note
saying that in future we should really be parsing
/proc/self/mountinfo, but that needs a custom parser, and the format
is rather tricky:

http://lxr.linux.no/#linux+v2.6.37/Documentation/filesystems/proc.txt#L1462
2011-02-03 09:47:48 +00:00
Richard W.M. Jones
f2a4020caf regressions: Fix rhbz557655.sh so it works with tracing enabled. 2011-02-03 09:14:12 +00:00
Richard W.M. Jones
5079e0fff3 guestfs-perl: Fix missing \n
This updates commit 477eebc83d.
2011-01-31 09:34:47 +00:00
Richard W.M. Jones
ff60650633 Version 1.9.7. 1.9.7 2011-01-30 23:53:54 +00:00
Richard W.M. Jones
0089575d4b virt-make-fs: Fix typo in man page. 2011-01-30 23:53:04 +00:00
Richard W.M. Jones
477eebc83d perl: Translate C examples into Perl and include a manual page. 2011-01-30 23:41:05 +00:00
Richard W.M. Jones
6975e87153 perl: Ignore internal_* functions in POD coverage test.
This updates commit 1d999540bd.
2011-01-29 07:01:06 +00:00
Richard W.M. Jones
b6c70b3f50 Fix test-guestfish-a.sh regression test for new trace format.
This fixes commit 1d999540bd.
2011-01-28 22:51:36 +00:00
Richard W.M. Jones
f060d5bcd4 autobuild: Add a 'make clean' step. 2011-01-28 21:41:16 +00:00
Richard W.M. Jones
82f5fdb0db lib: Fix use-after-free bug in XPath parsing code. 2011-01-28 18:57:34 +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 W.M. Jones
1d999540bd Add a prefix to output when tracing (RHBZ#673479).
Also separate the call and return lines so that everything can be
easily 'grepped' from debug output.  The trace output now looks like
this:

$ guestfish -x -N fs exit
libguestfs: trace: is_config
libguestfs: trace: is_config = 1
libguestfs: trace: add_drive "test1.img"
libguestfs: trace: add_drive = 0
libguestfs: trace: is_config
libguestfs: trace: is_config = 1
libguestfs: trace: launch
libguestfs: trace: launch = 0
libguestfs: trace: part_disk "/dev/sda" "mbr"
libguestfs: trace: part_disk = 0
&c.
2011-01-28 11:51:54 +00:00
Richard W.M. Jones
77df7d6d53 daemon: Replace root_mounted global with intelligence.
We used to maintain a global flag 'root_mounted' which tells us if the
user has mounted something on root (ie. on the sysroot directory).

This flag caused a lot of trouble (eg. RHBZ#599503) because it's hard
to keep the flag updated correctly when the user can do arbitrary
mounts and also use mkmountpoint.

Remove this flag and replace it with a test to see if something is
mounted on *or under* the sysroot.  (It has to be *or under* because
of mkmountpoint and friends).

This also replaces a rather convoluted "have we mounted root yet"
check in the mount* APIs with a simpler check to see if the mountpoint
exists and is an ordinary directory.
2011-01-27 18:08:45 +00:00
Richard W.M. Jones
e85fbee7bf daemon: Add perror to two exit paths to make errors clearer. 2011-01-27 15:55:12 +00:00
Richard W.M. Jones
8a406c7bee debian: Include actual shared libraries in python-guestfs package. 2011-01-27 09:47:44 +00:00
Nikita A Menkovich
92b74729e2 mkfs-opts: Add optional "features" parameter.
This allows the -O parameter to be added to the mkfs command line.
This is used to select filesystem features.
2011-01-26 15:34:01 +00:00
Nikita A Menkovich
dd653336cc mkfs-opts: Add a note about blocksize param and UFS filesystems. 2011-01-26 15:32:18 +00:00
Richard W.M. Jones
2110f6fa8c generator: Fix generation of library-side stubs with optional String arguments. 2011-01-26 14:15:23 +00:00
Richard W.M. Jones
c76f155496 packagelist: Add ufsutils for Debian and Ubuntu.
Note there is no mkfs.ufs available for Fedora (see RHBZ#541618
for details).
2011-01-26 10:00:44 +00:00
Richard W.M. Jones
36fe0acf8a Version 1.9.6. 1.9.6 2011-01-22 18:05:35 +00:00
Richard W.M. Jones
e8ab05b12c fish: Fix typo in error message (copy-in should be copy-out). 2011-01-22 14:46:37 +00:00
Richard W.M. Jones
78f1405de0 Use /var/tmp for the cached appliance (for FHS compliance).
The FHS advises large files not to be stored in the root
filesystem[1], and that /var/tmp is persistent across reboots[2]
(whereas /tmp is possibly not[3]).

Therefore we should store the large cached supermin appliance in
/var/tmp instead of /tmp.  /tmp is still used for all other temporary
files and directories.

In either case you can override this by setting $TMPDIR.

[1] http://www.pathname.com/fhs/pub/fhs-2.3.html#THEROOTFILESYSTEM
[2] http://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARYFILESPRESERVEDBETWEE
[3] http://www.pathname.com/fhs/pub/fhs-2.3.html#TMPTEMPORARYFILES
2011-01-19 21:47:23 +00:00
Richard W.M. Jones
316ad8311a fish: Initialize pcmd structure.
On Debian we get this warning which I'm pretty sure is bogus:

fish.c:690: error: 'pcmd.cmd' may be used uninitialized in this
function [-Wuninitialized]
2011-01-18 22:38:05 +00:00
Richard W.M. Jones
41bbc0a7a3 Version 1.9.5 1.9.5 2011-01-18 13:34:07 +00:00
Richard W.M. Jones
c3887285ab fish: <! cmd executes a shell command and inlines the resulting commands.
The new guestfish construct "<! cmd" executes the shell command
"cmd", and then anything printed to stdout by "cmd" is parsed
and executed as a guestfish command.

This allows some very hairy shell scripting with guestfish.
2011-01-18 13:16:28 +00:00
Richard W.M. Jones
61a4db138e fish: Factor out command line parsing.
Factor out the code which splits a string into a command line.
2011-01-18 11:24:38 +00:00
Richard W.M. Jones
4bcb267a24 fish: Make exit_on_error into a completely local variable.
Note that 'time' and 'glob' (which both run subcommands) do not
correctly pass the exit_on_error flag in the remote case.  This is not
a regression: the current code doesn't work either.
2011-01-18 10:33:01 +00:00
Richard W.M. Jones
f6a21c1e0d fish: exit_on_error is a local variable. 2011-01-18 10:21:49 +00:00
Richard W.M. Jones
deadcc7326 todo: Live CD inspection works, but not for Windows 7. 2011-01-15 16:40:49 +00:00
Richard W.M. Jones
07f1be28e8 Version 1.9.4. 1.9.4 2011-01-15 14:57:52 +00:00
Richard W.M. Jones
bc93d2ba38 README: Note that po4a is mandatory if compiling from git. 2011-01-15 14:56:25 +00:00
Richard W.M. Jones
c2f2a2c676 Add ability to inspect install disks and live CDs.
For examples of the virt-inspector output, see the additional
inspector/example-*.xml files in this commit.
2011-01-15 14:35:50 +00:00
Richard W.M. Jones
4402e6048f inspect: Add macros for file size limits.
This also bumps the file size limit for "small text files"
up to 2 MB, since we want to parse Windows CD txtsetup.sif
files that are usually around 500K in size.
2011-01-15 13:19:26 +00:00
Nikita A Menkovich
4ffa2d6798 New API: resize2fs-M to resize ext2/3/4 to minimum size. 2011-01-14 13:40:17 +00:00
Richard W.M. Jones
69f2f62900 Version 1.9.3. 1.9.3 2011-01-11 21:54:57 +00:00
Richard W.M. Jones
e5220b26f5 df: Skip final '/' character when calculating basename.
Previously it was including the final '/' character when calculating
the basename for the -a option eg:

Filesystem                                Size       Used  Available  Use%
/Ubuntu1010x64:/dev/sda1                  9.4G       2.3G       6.6G   25%

With this patch the '/' is not printed.
2011-01-11 13:55:23 +00:00
Richard W.M. Jones
0c60e4d9dd fish: Don't fail if some mountpoints in /etc/fstab are bogus (RHBZ#668574).
Fix guestfish (and other C tools) so that they ignore errors
when /etc/fstab contains bogus entries.

Update the documentation for inspect-get-mountpoints to emphasize
that callers must be aware of this when mounting the returned
values.

Add a regression test.

Update the example code ("inspect_vm") to reflect the way this
API ought to be called.

For more detail see:
https://bugzilla.redhat.com/show_bug.cgi?id=668574
2011-01-11 11:09:41 +00:00