| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
| |
Add 'event', 'list-events' and 'delete-event' commands so that event
handlers can be registered, listed and deleted in guestfish. The
event handler is a shell script snippet or host command.
Cc: Pádraig Brady <P@draigBrady.com>
|
|
|
|
|
|
|
| |
Check that we properly handle fstab entries of the form /dev/md0 and
/dev/md/foo.
RWMJ: Add a skip to test if the Augeas lens is not available.
|
|
|
|
|
| |
export SKIP_TEST_LAUNCH_RACE_PL=1
will cause this test to be skipped.
|
|
|
|
|
|
|
|
| |
This API is used to stop a md device.
When we want to move a device to another md array, we should
stop the md device which contained this device first.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
|
|
|
|
|
|
|
|
| |
This change renames the following 2 apis:
* mdadm_create -> md_create
* mdadm_detail -> md_detail
This is more consistent with list_md_devices, and removes a reference to an
implementation detail from the api.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Return a list of Linux MD devices detected in the guest.
This API complements list_devices, list_partitions, list_lvs and
list_dm_devices.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This optional argument controls how <readonly/> disks in
the libvirt XML are handled. It can be set to one of:
"write" (default) - add them R/W
"read" - add them R/O
"error" - throw an error if asked to add them R/W
"ignore" - ignore these disks
I have added limited regression tests for this feature. However
libvirt's test:/// XML does not allow you to specify that a domain
starts off shut down, so we cannot fully test this. Instead I tested
it by hand.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We currently use a heuristic to guess how drive names we find
referenced in the guest map to drive names in the appliance. If this
heuristic fails it can cause inspection to fail.
This change adds a new 'name' option to add_drive_opts, which allows
the user to explicitly pass the name of a drive to libguestfs if it is
known. This change also updates the fstab-parsing inspection code to
use this information if it is available.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a NFC on its own, but provides a place-holder for drive metadata which
can be used after launch.
Fixes by RWMJ:
- Fix the tests: this requires a new internal function 'debug-drives'
that dumps out the g->drives information so it can be checked in
two of the tests. Previously these tests used 'debug-cmdline'.
- Test file existence / use_cache_off in the add_drive_opts function,
not when launching qemu in the child process.
- Call free along error paths.
- Add comments.
|
|
|
|
|
|
| |
The guestfs_ll command currently lists files in the appliance if you
prefix filenames with "/..". However this is a bug, not a feature,
and we should not be testing it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is another case where downloads of small files could fail if the
library side (writer) fails. In this case the library would send back
a cancellation, but it would be received after the daemon had finished
sending the whole file (because the file is small enough). The daemon
would reenter the main loop and immediately get an unexpected cancel
message, causing the daemon to die.
This commit also makes test-cancellation-download-librarycancels.sh
more robust. We use Monte-Carlo testing with a range of file sizes.
Small file sizes should trigger the error case.
|
|
|
|
|
|
| |
This avoids conflicts with the globally installed libguestfs
appliance, or lets us build in multiple local directories at the same
time without conflicts.
|
|
|
|
| |
This updates commit 319e946b92e175c05cdd1fdcb85c9b86f5631011.
|
|
|
|
| |
Related to RHBZ#727178.
|
|
|
|
|
|
|
|
| |
If debugging or tracing is enabled, extra messages are sent to stderr
which mess with this test. Remove the extra messages before checking
stderr.
This updates commit 617e7f6bafa7de2303c08e1715004aae3141c389.
|
| |
|
| |
|
|
|
|
| |
List device mapper devices.
|
|
|
|
| |
Notes:
Labels: bugfix, RHBZ#690819
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the case where both ends cancel at the same time (eg. both ends
realize there are errors before or during the transfer), previously we
skipped sending back an error from the daemon, on the spurious basis
that the library would not need it (the library is cancelling because
of its own error).
However this is wrong: we should always send back an error message
from the daemon in order to preserve synchronization of the protocol.
A simple test case is:
$ guestfish -N fs -m /dev/sda1 upload nosuchfile /
libguestfs: error: open: nosuchfile: No such file or directory
libguestfs: error: unexpected procedure number (66/282)
(Notice two things: there are errors at both ends, and the
loss of synchronization).
After applying this commit, the loss of synchronization does not occur
and we just see the library error:
$ guestfish -N fs -m /dev/sda1 upload nosuchfile /
libguestfs: error: open: nosuchfile: No such file or directory
The choice of displaying the library or the daemon error is fairly
arbitrary in this case -- it would be valid to display either or even
to combine them into one error. Displaying the library error only
makes the code considerably simpler.
This commit also (re-)enables a test for this case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As a previous, incorrect attempt to fix RHBZ#576879 we tried to
prevent the daemon from sending an error reply if the daemon had
cancelled the transfer. This is wrong: the daemon should send an
error reply in these cases.
A simple test case is this:
guestfish -N fs -m /dev/sda1 upload big-file /
(This fails because the target "/" is a directory, not a file.)
Prior to this commit, libguestfs would hang instead of printing an
error. With this commit, libguestfs prints an error.
What is happening is:
(1) Library is uploading
a file (2) In the middle of the long
upload, daemon detects an error.
Daemon cancels.
(3) Library detects cancel,
sends cancel chunk, then waits
for the error reply from the
daemon. (4) Daemon is supposed to send
an error reply message.
Because step (4) wasn't happening, uploads that failed like this would
hang in the library (waiting for the error message, while the daemon
was waiting for the next request).
This also adds a regression test.
This temporarily breaks the "both ends cancel" case (RHBZ#576879c5).
Therefore the test for that is disabled, and this is fixed in the next
patch in the series.
This partially reverts commit dc706a639eec16084c0618baf7bfde00c6565f63.
|
| |
|
|
|
|
| |
This updates commit cbd8da6d4dd2e4cbc3b87fbc7cb7d6129eb69172.
|
|
|
|
|
|
|
| |
We suspect that there are in fact two separate bugs. In any
case it makes sense for the two tests to be done separately.
Note that these tests still fail.
|
| |
|
|
|
|
| |
This fixes commit 1d999540bddd7aea7c2d0fef8b15223d4acc645f.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
This also adds a regression test.
|
|
|
|
| |
This is necessary because of too old cryptsetup on Ubuntu.
|
|
|
|
|
| |
This test has worked only intermittently for a while. Disable
it. The upstream bug has been reopened.
|
| |
|
|
|
|
|
|
|
|
| |
We were generating this dummy 'Fedora' image already in the
tools directory. It contains just enough Fedora-like files
to fool our inspection code and thus to test the tools.
This is general enough that we can use it everywhere.
|
|
|
|
|
|
| |
This also makes libxml2 and libvirt into optional dependencies.
If they are missing then the core API will print an error, as
will the '-d' option to guestfish.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This new API allows you to add the disks from a libvirt
domain.
In guestfish you can use the 'domain' command to access the
API, eg:
><fs> domain Fedora14 libvirturi:qemu:///system
1
The returned number is the number of disks that were added.
Also here is a proposed (but commented out) low-level API
which would allow you to add a domain from a virDomainPtr.
However there are several problems with this API -- see discussion
on the list:
https://www.redhat.com/archives/libguestfs/2010-November/thread.html#00028
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cached appliances are discovered by their predictable path. Previously we were
creating a cached appliance directly in this predictable path. This had at least
2 undesirable effects:
* Interrupting appliance creation would leave a corrupt appliance
* 2 processes could simultaneously attempt to create the same appliance, causing
corruption.
This patch causes the cached appliance to be created in a temporary directory,
and then renamed to the predictable path. As rename is an atomic operation, this
makes the whole creation atomic.
This patch also changes the predictable path to have a prefix of 'guestfs.'.
This will make it simpler for system administrators to clean up old cached
appliances.
This patch resolves RHBZ#639405
|
|
|
|
| |
This test has started to hang, for reasons we don't understand.
|
|
|
|
|
|
|
|
| |
For libvirt guests, the disk format is copied from libvirt (if
libvirt knows it).
For command line disk images, you can use --format to override
format auto-detection.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This large commit changes the generator so that optional arguments
can be supported for functions.
The model for arguments (known as the "style") is changed from
(ret, args) to (ret, args, optargs) where optargs is a more limited
list of arguments.
One function has been added which takes optional arguments, it is
"add-drive-opts", modelled as:
(RErr, [String "filename"], #required
[Bool "readonly"; String "format"; String "iface"]) #optional
Note that this function is processed in the library (does not go over
the RPC protocol to the daemon). This has allowed us to simplify
the current implementation by omitting changes related to RPC or the
daemon, although we plan to add these at some point in the future.
From C this function can be called in 3 different ways as in these
examples:
guestfs_add_drive_opts (g, filename,
GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,
GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
-1);
(the argument(s) between 'filename' and '-1' are the optional ones).
guestfs_add_drive_opts_va (g, filename, args);
where 'args' is a va_list. This works like the first version.
struct guestfs_add_drive_opts_argv optargs = {
.bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK,
.readonly = 1,
}
guestfs_add_drive_opts_argv (g, filename, &optargs);
This last form lets you construct lists of optional arguments, and
is used by guestfish and the language bindings.
In guestfish optional arguments are used like this:
add-drive-opts filename readonly:true
In OCaml these are mapped naturally to OCaml optional arguments, eg:
g#add_drive_opts ~readonly:true filename;
In Perl these are mapped to extra arguments, eg:
$g->add_drive_opts ($filename, readonly => 1);
In Python these are mapped to optional arguments, eg:
g.add_drive_opts ("file", readonly = 1, format = "qcow2")
In Ruby these are mapped to a final hash argument, eg:
g.add_drive_opts("file", {})
g.add_drive_opts("file", :readonly => 1)
g.add_drive_opts("file", :readonly => 1, :iface => "virtio")
In PHP these are mapped to extra parameters. This is not quite
accurate since you cannot omit arbitrary optional parameters, but
there's not much than can be done within the limitations of PHP
as a language.
Unimplemented in: Haskell, C#, Java.
|
| |
|
|
|
|
|
|
| |
Instead of testing the installed /usr/bin/guestfish.
This fixes commit ddda0f7bd00a37274dae38f4ce93955b8cfdf7d7.
|
|
|
|
|
| |
Since these options were both broken in released version 1.5.17,
best to have a regression test to catch this in future.
|
| |
|
| |
|