| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
documentation
Since some modules (`getopt', for example) may copy files
into the build directory, `top_builddir/lib' is needed as well as
`top_srcdir/lib'. -- GNU Gnulib manual, section 2.2 Initial import
(cherry picked from commit 1a35ca59088e572c11633e85524bb282cb436186)
|
|
|
|
|
|
|
| |
This is the minimum alignment. 1MB would be better.
Note that the exact behaviour is not defined in the API.
(cherry picked from commit c4381dba737d5cb8aad8e1b2e2123b0fcaff1d1a)
|
|
|
|
| |
(cherry picked from commit edd502543adbdc2fa5dda0c015ea7c390bb39f64)
|
|
|
|
| |
(cherry picked from commit 04ea1375c55aa67df4e7fc61dbb534111767f3b6)
|
|
|
|
|
|
|
|
|
|
| |
In the libguestfs live case we need to be careful not to modify the
real /etc/lvm/lvm.conf file (when setting the filter rule).
When the daemon starts, make a complete copy of /etc/lvm in a
temporary directory, and adjust LVM_SYSTEM_DIR to point to the copy.
All changes are made in the temporary copy.
(cherry picked from commit 9c299b64bb24cefafa582fe425bb65b78373d205)
|
|
|
|
|
|
|
| |
Although this doesn't matter for the ordinary (appliance) case, it
matters for the libguestfs live case. In that case it could cause the
guest to be exploited by a tmp/symlink attack.
(cherry picked from commit 6011b1f803ba7308c6a94b9bf6b7212cfccb9f42)
|
|
|
|
|
|
|
|
|
|
|
|
| |
When given an invalid debug command, libguestfs responds with the
error message:
libguestfs: error: debug: use 'debug help' to list the supported commands
However this command does not work, as debug requires two
arguments. This change updates the message to prompt the user to use
'debug help 0'.
(cherry picked from commit 4e3a1205ebfec1a5cbc3062d6f73a684090e80b5)
|
|
|
|
|
|
|
|
|
|
|
| |
The four new APIs:
guestfs_copy_device_to_device,
guestfs_copy_device_to_file,
guestfs_copy_file_to_device, and
guestfs_copy_file_to_file
let you copy from a source to a destination, between files and
devices, optionally allowing source and destination offsets and size
to be specified.
|
|
|
|
|
|
| |
This converts a partition device name (eg. /dev/sda1) to a partition
number (eg. 1). This is useful in conjunction with the parted APIs
that mostly take a disk device + partnum.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 025dba7f803419f510fd8f085ce693838af82878.
If build and source directories are the same, you get this error:
make[3]: Leaving directory `/home/rjones/d/libguestfs/generator'
make[2]: Circular guestfs_protocol.c <- guestfs_protocol.c dependency dropped.
make[2]: Circular guestfs_protocol.h <- guestfs_protocol.h dependency dropped.
rm -f guestfs_protocol.h
ln guestfs_protocol.h
ln: accessing `guestfs_protocol.h': No such file or directory
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These APIs let you copy compressed files or devices out from the disk
image.
Compression is useful for large images which are mostly zeroes. We
cannot currently do sparseness detection, and compression gives us a
form of zero detection for free.
Example usage:
$ guestfish --ro -a /dev/vg_pin/F16x64 -i \
compress-out gzip /etc/passwd /tmp/passwd.gz
$ file -z /tmp/passwd.gz
/tmp/passwd.gz: ASCII text (gzip compressed data, was "passwd", from
Unix, last modified: Sun Aug 28 14:40:46 2011)
|
|
|
|
| |
Code motion.
|
|
|
|
|
|
|
|
| |
This also improves the documentation for this call, pointing out
several pitfalls in using it.
This unfortunately breaks existing callers that might use
guestfs_grub_install without checking for this new group.
|
|
|
|
| |
This is just code motion.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 code modifies zero, zero-device, is-zero, is-zero-device.
zero and zero-device are modified so that if the blocks of the device
already contain zeroes, then we don't write zeroes. The reason for
this is to avoid unnecessarily making the underlying storage
non-sparse or (in the qcow2 case) growing it.
is-zero and is-zero-device are modified so that zero detection is
faster. This is a nice side effect of making the first change.
Since avoiding unnecessary zeroing involves reading the blocks before
writing them, whereas before we just blindly wrote, this can be
slower. As you can see from the tests below, in the case where the
disk is sparse, it actually turns out to be faster, because we avoid
allocating the underlying blocks.
However in the case where the disk is non-sparse and full of existing
data, it is much slower. There might be a case for an API flag to
adjust whether or not we perform the zero check. I did not add this
flag because it is unlikely that the caller would have enough
information to be able to set the flag correctly.
(Elapsed time in seconds)
Format Test case Before After
Raw Sparse 16.4 5.3
Preallocated zero 17.0 18.8
Preallocated random 16.0 41.3
Qcow2 preallocation=off 18.7 5.6
preallocation=metadata 17.4 5.8
The current code uses a fixed block size of 4K for reading and
writing. I also tried the same tests with a block size of 64K but it
didn't make any significant difference.
(Thanks to Federico Simoncelli for suggesting this change)
|
|
|
|
| |
This updates commit 60d5a50f4d3d9e2c2f5a7d42a6859de709bda3f6.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Combine the two Gnulib instances together.
Add checks from old daemon/configure.ac into configure.ac.
Fix daemon/Makefile.am so it is like a normal subdirectory
Makefile.am.
Because we are now using the replacement strerror_r function from
Gnulib (instead of the one from glibc directly), this requires a small
change to src/guestfs.c.
|
|
|
|
| |
Related to RHBZ#727178.
|
|
|
|
|
|
| |
On recent Debian, /etc/blkid.tab is now a symlink to /dev/.blkid.tab.
Rather than chasing the cache file around (it may move to /run in future)
use the -c /dev/null option to stop blkid from reading the cache.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the blkid command returns 2, that means the value was not found.
Note that this changes the output of the vfs-type API when the
filesystem has no type (eg when it is empty). Previously this would
return an error. Now it returns empty string "".
We did not document this either way. Making it return empty string is
consistent with vfs-label and vfs-uuid.
This change broke list-filesystems, since that code was assuming that
vfs-type could only return a filesystem type or an error.
|
|
|
|
| |
Append content to the end of a file.
|
|
|
|
|
|
|
|
| |
If enabled, then the daemon will be installed in $sbindir
(eg. /usr/sbin/guestfsd). The default is off, as now.
This option should be used by packagers when building the libguestfs
live service.
|
|
|
|
| |
This resizes a btrfs filesystem.
|
|
|
|
| |
Allow other types of filesystems to be created.
|
| |
|
|
|
|
|
|
| |
This is a more comprehensive fix for RHBZ#685009. Add a new API which
allows the --force flag to be passed, allowing multiple NTFS resize
operations in a single session.
|
|
|
|
| |
List device mapper devices.
|
|
|
|
| |
This updates commit 5f10c3350338bbca735a74db26f98da968957bd9.
|
| |
|
|
|
|
|
|
|
| |
This is needed because older versions of grub(for example in centos)
do not understand filesystems created with newer version of e2fsprogs.
By default in e2fsprogs 1.4+ creates partitions with 256 bit inode
size, and grub expect 128 bit size.
|
|
|
|
| |
The updated patch makes 'options' into an optional parameter.
|
| |
|
|
|
|
|
| |
* .gnulib: Update submodule to latest.
* daemon/m4/gnulib-cache.m4: Regenerate.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
If the external command failed to run, we could free up the allocated
*stdoutput and *stderror pointers, but then return those freed
pointers to the caller. The caller usually tries to print and free
*stderror, so this is a serious error.
Instead, return *stdoutput as NULL, and *stderror pointing to a
generic error message.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
For some reason we were checking the parameter!
|
| |
|
| |
|
| |
|
| |
|
| |
|