| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
rpcgen generates source which can't be safely compiled with strict-aliasing
enabled.
|
|
|
|
|
|
|
|
| |
Reimplement these so they read /proc/mounts instead of trying to parse
the output of the 'mount' external command.
One consequence of this is that these commands now work again for
ntfs-3g filesystems.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces a new form of progress event, where we don't know how
much of the operation has taken place, but we nevertheless want to
send back some indication of activity. Some progress bar indicators
directly support this, eg. GtkProgressBar where it is known as "pulse
mode".
A pulse mode progress message is a special backwards-compatible form
of the ordinary progress message. No change is required in callers,
unless they want to add support for pulse mode.
The daemon sends:
- zero or more progress messages with position = 0, total = 1
- a single final progress message with position = total = 1
Note that the final progress message may not be sent if the call fails
and returns an error. This is consistent with the behaviour of
ordinary progress messages.
The daemon allows two types of implementation. Either you can just
call notify_progress (0, 1); ...; notify_progress (1, 1) as usual.
Or you can call the functions pulse_mode_start, pulse_mode_end and/or
pulse_mode_cancel (see documentation in daemon/daemon.h). For this
second form of call, the guarantee is very weak: it *just* says the
daemon is still capable of doing something, and it doesn't imply that
if there is a subprocess that it is doing anything. However this does
make it very easy to add pulse mode progress messages to all sorts of
existing calls that depend on long-running external commands.
To do: add a third variant that monitors a subprocess and only sends
back progress messages if it's doing something, where "doing
something" might indicate it's using CPU time or it's printing output.
|
| |
|
| |
|
|
|
|
|
| |
Notes:
Labels: cleanup, forcestable
Depends: 227bea6c7ef89b707fe2c01c4d0d0fb9081e8c04
|
|
|
|
| |
Notes:
Labels: bugfix, RHBZ#690819
|
|
|
|
|
|
|
|
|
|
| |
The particular issue is that ntfs-3g (or FUSE?) no longer appears
to update /etc/mtab, which meant that umount-all was not unmounting
these partitions. But parsing /proc/mounts is simpler and more
robust in any case.
Notes:
Labels: bugfix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 adds 'guestfsd: ...' prefix before each message, and
also puts a message at the top of the main loop just after
a new message has been received.
The intent is to make it simpler to follow the protocol.
|
|
|
|
|
|
|
| |
The chunk.cancel field should always be [0|1]. If it is not then
something has gone badly wrong -- probably loss of synchronization.
If this occurs print a debug message and return error from
receive_file function.
|
| |
|
|
|
|
| |
This updates commit 7eb012f3710bb554d5fc2c4229036901b0b5ad90.
|
|
|
|
| |
This option was not being used.
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Ensure the daemon always starts with current directory == root.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This allows the -O parameter to be added to the mkfs command line.
This is used to select filesystem features.
|
| |
|
|
|
|
|
|
| |
Add a new section called "EXTENDING LIBGUESTFS" to the
guestfs manual page which contains all the information
previously in "HACKING".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These APIs are essentially required to work around a problem
with ntfs-3g. This filesystem (or FUSE?) does not list all
extended attributes of a file when you call listxattr(2). However
if you know the name of an extended attribute, you can retrieve
it directly using getxattr(2).
The current APIs (getxattrs etc) are simple to use, but they
don't work if we can't list out the extended attributes (ie.
by calling listxattr(2)).
Example using the new APIs on an ntfs-3g filesystem:
><fs> lgetxattr "/Documents and Settings" system.ntfs_attrib | hexdump -C
00000000 16 24 00 00 |.$..|
00000004
><fs> lgetxattr "/Documents and Settings" system.ntfs_reparse_data | hexdump -C
00000000 03 00 00 a0 34 00 00 00 00 00 18 00 1a 00 10 00 |....4...........|
00000010 5c 00 3f 00 3f 00 5c 00 43 00 3a 00 5c 00 55 00 |\.?.?.\.C.:.\.U.|
00000020 73 00 65 00 72 00 73 00 00 00 43 00 3a 00 5c 00 |s.e.r.s...C.:.\.|
00000030 55 00 73 00 65 00 72 00 73 00 00 00 |U.s.e.r.s...|
0000003c
><fs> getxattr "/Documents and Settings" system.ntfs_reparse_data | hexdump -C
libguestfs: error: getxattr: getxattr: No such file or directory
><fs> getxattr "/Documents and Settings" system.ntfs_attrib | hexdump -C
libguestfs: error: getxattr: getxattr: No such file or directory
><fs> lgetxattr "/Documents and Settings" system.ntfs_attrib | hexdump -C
00000000 16 24 00 00 |.$..|
00000004
><fs> getxattr "/Users" system.ntfs_attrib | hexdump -C
00000000 11 00 00 00 |....|
00000004
|
|
|
|
| |
This updates commit 0938509e0422363554023ab99381fd70a22a6e08.
|
|
|
|
| |
(Revealed by compiling under Debian where this is a warning).
|
|
|
|
|
|
|
|
| |
Even with the '-f' option, LVM on Ubuntu sometimes cannot remove
active LVs and VGs.
Change lvm-remove-all so it deactivates each LV and VG before
removing them.
|
|
|
|
|
|
|
| |
This reverts commit ad2abf89c364d5ec73fb12af63b053637d99d757.
Ubuntu still has errors even with the addition of udev_settle
after umount-all. Therefore this was just masking the problem.
|
|
|
|
|
| |
Really we should have a test for "is program on $PATH?" but this
fix will do for now.
|
|
|
|
|
|
| |
This helps avoid an error on Ubuntu, but it's not clear if this
is a real solution or just helps by adjusting the timing of some
race condition.
|
|
|
|
| |
These are seen on gcc 4.5.1 used in Ubuntu.
|
|
|
|
|
|
| |
This is an extensible version of 'mkfs' which supports optional
arguments. There is now no need for 'mkfs_b' since you should
use 'mkfs_opts' with the optional 'blocksize' argument instead.
|
|
|
|
|
|
|
|
| |
Previously we only supported optional arguments for library
functions (commit 14490c3e1aac61c6ac90f28828896683f64f0dc9).
This extends that work so that optional arguments can also be
passed through to the daemon.
|
| |
|
|
|
|
|
|
|
| |
If the daemon sends progress notification messages while we
are uploading FileIn parameters, these are received in
check_for_daemon_cancellation_or_eof. Modify this library
function so that it turns these messages into callbacks.
|
|
|
|
|
|
|
|
| |
Two unrelated changes to the protocol to support progress
messages during uploads, and optional arguments.
Note that this makes an incompatible change to the protocol,
and this is reflected in the protocol version field (3 -> 4).
|
| |
|
|
|
|
| |
Remove both possible cache locations.
|
| |
|
| |
|
|
|
|
|
|
|
| |
If either the daemon sends back an errno, or a system call
fails in the library, save the errno in the handle and then
make it available to callers through the guestfs_last_errno
function.
|
|
|
|
|
|
|
|
| |
This changes the protocol again so that if the errno is available,
it is converted to a string (like "EIO") and sent back over the
protocol to the library.
In this commit the library just discards the string.
|
|
|
|
|
| |
This file is already hard-linked into the current directory, so
the relative path is not required.
|
|
|
|
|
| |
See commit 840536ea5a0568296dfd3e483442c76b93c5a949
and commit 956fc5a3feacc970ea763697bf28fb686c875408.
|
|
|
|
| |
Make the LV paths returned by these two commands canonical.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When logical volume names appear in places like /etc/fstab
files they can have the form "/dev/mapper/foo-bar". This
function takes such names and makes them canonical.
Note that this operation cannot be performed using the current
API, because 'guestfs_stat' does not work on device names, and
we don't really want to make a 'stat-device' call since that
exposes too much non-useful detail about the appliance.
With this patch you can do this:
><fs> debug ll /dev/mapper
total 8
drwxrwxr-x 2 root root 4096 Oct 25 12:51 .
drwxr-xr-x 16 root root 4096 Oct 25 12:51 ..
crw------- 1 root root 10, 62 Oct 25 12:51 control
lrwxrwxrwx 1 root root 7 Oct 25 12:51 vg_f13x64-lv_root -> ../dm-0
lrwxrwxrwx 1 root root 7 Oct 25 12:51 vg_f13x64-lv_swap -> ../dm-1
><fs> lvm-canonical-lv-name /dev/mapper/vg_f13x64-lv_root
/dev/vg_f13x64/lv_root
><fs> lvm-canonical-lv-name /dev/mapper/vg_f13x64-lv_swap
/dev/vg_f13x64/lv_swap
><fs> lvm-canonical-lv-name /dev/mapper/foo
libguestfs: error: lvm_canonical_lv_name: lvm_canonical_lv_name_stub: /dev/mapper/foo: No such file or directory
><fs> lvm-canonical-lv-name /dev/mapper/control
libguestfs: error: lvm_canonical_lv_name: /dev/mapper/control: not a logical volume
><fs> lvm-canonical-lv-name /dev/vg_f13x64/lv_root
/dev/vg_f13x64/lv_root
|