summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* daemon: findfs-uuid and findfs-label should not return /dev/mapper paths.Richard W.M. Jones2010-11-161-0/+16
|
* lib: Expose errno through new API guestfs_last_errno.Richard W.M. Jones2010-11-032-2/+24
| | | | | | | 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.
* daemon: Send back the errno as a string.Richard W.M. Jones2010-11-032-2/+18
| | | | | | | | 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.
* daemon: Don't use ../src path to include generator_protocol.hRichard W.M. Jones2010-11-0333-33/+33
| | | | | This file is already hard-linked into the current directory, so the relative path is not required.
* daemon: Tolerate failure of blockdev --rereadpt after sfdisk.Richard W.M. Jones2010-11-021-2/+1
| | | | | See commit 840536ea5a0568296dfd3e483442c76b93c5a949 and commit 956fc5a3feacc970ea763697bf28fb686c875408.
* daemon: Fix /dev/mapper paths from mounts and mountpoints (RHBZ#646432).Richard W.M. Jones2010-10-283-34/+56
| | | | Make the LV paths returned by these two commands canonical.
* New API: lvm-canonical-lv-name: make LV name canonical.Richard W.M. Jones2010-10-271-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* daemon: Print failed path in stat command errors.Richard W.M. Jones2010-10-251-2/+2
|
* daemon: Use stdint UINT64_C instead of <const>ULL.Richard W.M. Jones2010-10-221-4/+5
|
* parted: Don't return "loop" for non-partitioned devices (RHBZ#634246).Richard W.M. Jones2010-10-181-0/+15
| | | | | | | | If you ran part-get-parttype command on a device which didn't contain a partition, it used to return the string "loop". This is an internal representation that parted uses. We should instead return an error because part-get-parttype makes no sense for devices which are not partitioned.
* debug: Add qtrace <device> on|off to allow selective traces.Richard W.M. Jones2010-10-061-0/+91
|
* part-disk: Align whole disk partition to 64 sectors.Richard W.M. Jones2010-10-061-15/+9
| | | | | | Change the part-disk command so it aligns the partition to 64 sectors (instead of 1 or 34 sectors as now). This should ensure that the filesystem contained within is aligned.
* New API: pread-device, partial read for devices.Richard W.M. Jones2010-09-271-15/+38
|
* pread: Check count and offset parameters are not negative.Richard W.M. Jones2010-09-271-0/+10
|
* New API: pwrite-deviceRichard W.M. Jones2010-09-261-9/+35
| | | | | This is the same as the existing 'pwrite' API call, but allows you to write to a device.
* pwrite: Check offset is not negative.Richard W.M. Jones2010-09-261-0/+5
|
* Call blockdev --rereadpt then udev_settle after sfdisk commands.Richard W.M. Jones2010-09-241-3/+6
| | | | | | | This updates commit 956fc5a3feacc970ea763697bf28fb686c875408 so that we call udev_settle after rereading the partition table. This ensures that the devices nodes for the new partitions have been created.
* Call blockdev --rereadpt after sfdisk commands.Richard W.M. Jones2010-09-221-1/+13
| | | | | | | | | | | | On fast machines sfdisk has some sort of race where it fails to re-read the partition table it has just created (it's not clear if this is a race in sfdisk, the kernel or some other component). This commit works around the problem by calling blockdev --rereadpt after sfdisk operations, which experience shows is enough to stop the problem from happening.
* New APIs: upload-offset and download-offsetRichard W.M. Jones2010-09-211-3/+112
| | | | | These APIs allow you to efficiently write and read parts of files or devices.
* New API: part-to-dev: Convert partition name to device name.Richard Jones2010-09-151-0/+27
| | | | | This adds a formal API for going from a partition to the containing device, eg. /dev/sda1 -> /dev/sda
* Split generator into separate source files.Richard Jones2010-09-111-4/+5
| | | | | | | | | | 'src/generator.ml' is no more. Instead the generator is logically split up over many different source files. Read generator/README for help and tips. We compile the generator down to bytecode, not native code. This means it will run more slowly, but is done for maximum portability.
* syntax: Remove unused c-ctype.h header.Richard Jones2010-09-101-1/+0
|
* New APIs: is-chardev, is-blockdev, is-fifo, is-symlink, is-socketRichard Jones2010-09-091-17/+61
| | | | These complement the existing is-file and is-dir APIs.
* daemon: Move 'exists', 'is-file' and 'is-dir' to separate file.Richard Jones2010-09-094-56/+87
| | | | This commit is just code movement.
* daemon: Don't warn about 'long long' usage.Richard Jones2010-09-061-0/+2
| | | | | This removes a fatal warning (-Werror) which stops compilation on 32 bit machines.
* debug: Add 'debug progress' command.Richard Jones2010-09-011-0/+33
| | | | | This debugging command generates progress notification messages, used for testing purposes.
* debug: Arrange prototypes in alphabetical order.Richard Jones2010-09-011-1/+1
|
* daemon: Enable debug command by default.Richard Jones2010-09-012-32/+8
| | | | | | | The debug command is useful for internal testing, and so should be enabled by default in all builds. Note that it is still *not* part of the stable ABI.
* Add progress messages to download command.Richard Jones2010-09-011-0/+27
|
* Add progress messages to zero-device command.Richard Jones2010-09-011-5/+16
|
* Add progress messages to zero command.Richard Jones2010-09-011-1/+3
|
* Add progress messages to fill-pattern command.Richard Jones2010-09-011-0/+1
|
* Add progress messages to fill command.Richard Jones2010-09-011-0/+1
|
* Add progress messages to copy-size command.Richard Jones2010-08-311-4/+15
|
* Implement progress messages in the daemon and library.Richard Jones2010-08-312-5/+98
| | | | | | | | | | | | This implements progress notification messages in the daemon, and adds a callback in the library to handle them. No calls are changed so far, so in fact no progress messages can be generated by this commit. For more details, see: https://www.redhat.com/archives/libguestfs/2010-July/msg00003.html https://www.redhat.com/archives/libguestfs/2010-July/msg00024.html
* daemon: Set O_CLOEXEC flag on the virtio-serial file descriptor.Richard Jones2010-08-271-1/+7
|
* Add a core_pattern debug commandMatthew Booth2010-08-261-0/+53
| | | | | | This adds a new debug command, core_pattern, which writes a new pattern for coredump files to the appliance kernel, and sets the daemon's hard and soft core limits to infinity.
* Change protocol to send Linux errno from daemon to library.Richard Jones2010-08-241-4/+5
| | | | | | | This changes the protocol so that the Linux errno (if available) is sent back to the library. Note that the errno is not yet made available to callers, since it is not clear how best to present this Linux-specific number.
* Use virtio-serial, remove other vmchannel methods.Richard Jones2010-08-241-133/+6
| | | | | | | | | | | | | This adds support for virtio-serial, and removes all other vmchannel methods. Virtio-serial is faster than other methods, and is now widely available. I tested this by using the guestfs_upload API on an 83 MB file: before: 6.12 seconds (14.1 MB/sec) after: 4.20 seconds (20.6 MB/sec) (note this is with the current 8K chunk size)
* Change to using ext2-based, cached supermin appliance.Richard Jones2010-08-233-0/+34
| | | | | | | | | | | | This changes the method used to build the supermin appliance to use the new ext2-based appliance supported by latest febootstrap. The appliance can also be cached, so we avoid rebuilding it each time it is used. Mailing list discussion goes into the rationale and details: https://www.redhat.com/archives/libguestfs/2010-August/msg00028.html Requires febootstrap >= 2.8.
* New APIs: findfs-label and findfs-uuidRichard Jones2010-08-172-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | These two calls wrap up the /sbin/findfs command, allowing you to find a filesystem by only knowing its label or UUID. This is especially useful when resolving LABEL=... or UUID=... entries in /etc/fstab. Sample guestfish session: ><fs> vfs-uuid /dev/vda1 277dd61c-bf34-4253-a8dc-df500a05e7df ><fs> findfs-uuid 277dd61c-bf34-4253-a8dc-df500a05e7df /dev/vda1 ><fs> vfs-label /dev/vda1 /boot ><fs> findfs-label /boot /dev/vda1 ><fs> vfs-uuid /dev/VolGroup00/LogVol00 40ce7c36-82ce-4a12-a99d-48f5e054162c ><fs> findfs-uuid 40ce7c36-82ce-4a12-a99d-48f5e054162c /dev/mapper/VolGroup00-LogVol00 ><fs> findfs-uuid 12345678 libguestfs: error: findfs_uuid: findfs: unable to resolve 'UUID=12345678'
* New API: is-lv: check if a block device is a logical volume (RHBZ#619793)Richard Jones2010-07-301-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new API, guestfs_is_lv (g, device), which returns true iff the named device is an LVM2 logical volume. A sample guestfish session: ><fs> lvs /dev/vg_f13x64/lv_root /dev/vg_f13x64/lv_swap ><fs> list-devices /dev/vda ><fs> list-partitions /dev/vda1 /dev/vda2 ><fs> is-lv /dev/vg_f13x64/lv_root true ><fs> is-lv /dev/vg_f13x64/lv_swap true ><fs> is-lv /dev/vda false ><fs> is-lv /dev/vda1 false ><fs> is-lv /dev/vda2 false
* New APIs: Support for creating LUKS and managing keys.Richard Jones2010-07-221-20/+184
| | | | | | | | | | | | | | | | | | | This commit adds four APIs for creating new LUKS devices and key management. These are: luks_format Format a LUKS device with the default cipher. luks_format_cipher Format with a chosen cipher. luks_add_key Add another key to an existing device. luks_kill_slot Delete a key from an existing device. This enables all the significant functionality of the cryptsetup luks* commands. Note that you can obtain the UUID of a LUKS device already by using vfs-uuid. This also includes a regression test covering all the LUKS functions.
* New APIs: Support for opening LUKS-encrypted disks.Richard Jones2010-07-212-0/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for opening LUKS-encrypted disks, via three new APIs: luks_open: Create a mapping for an encrypted disk. luks_open_ro: Same, but read-only mapping. luks_close: Close a mapping. A typical guestfish session using this functionality looks like this: $ guestfish --ro -a encrypted.img ><fs> run ><fs> list-devices /dev/vda ><fs> list-partitions /dev/vda1 /dev/vda2 ><fs> vfs-type /dev/vda2 crypto_LUKS ><fs> luks-open /dev/vda2 luksdev Enter key or passphrase ("key"): ><fs> vgscan ><fs> vg-activate-all true ><fs> pvs /dev/dm-0 ><fs> vgs vg_f13x64encrypted ><fs> lvs /dev/vg_f13x64encrypted/lv_root /dev/vg_f13x64encrypted/lv_swap ><fs> mount /dev/vg_f13x64encrypted/lv_root / ><fs> ll / total 132 dr-xr-xr-x. 24 root root 4096 Jul 21 12:01 . dr-xr-xr-x 20 root root 0 Jul 21 20:06 .. drwx------. 3 root root 4096 Jul 21 11:59 .dbus drwx------. 2 root root 4096 Jul 21 12:00 .pulse -rw-------. 1 root root 256 Jul 21 12:00 .pulse-cookie dr-xr-xr-x. 2 root root 4096 May 13 03:03 bin NOT included in this patch: - An easier way to use this from guestfish. - Ability to create LUKS devices. - Ability to change LUKS keys on existing devices. - Direct access to the /dev/mapper device (eg. if it contains anything apart from VGs).
* New APIs: lvm-set-filter and lvm-clear-filter.Richard Jones2010-07-162-0/+245
| | | | | | | These APIs allow you to change the device filter, the list of block devices that LVM "sees". Either you can set it to a fixed list of devices / partitions, or you can clear it so that LVM sees everything.
* file: Fix file command on /dev/VG/LV paths (RHBZ#582484).Richard Jones2010-06-081-1/+6
| | | | | | | | | | | | | Previous commit 4df593496e116dfb635731c058b7627e81fc179c broke the "file" command on logical volume paths, since these are symbolic links. We *should* follow these (only). This inadvertantly broke virt-inspector too, which indicates that we need more regression testing in this area. Since carrying whole Fedora images around could make the distribution even larger than now, I'm not sure at the moment how to do this. Thanks to Matt Booth for diagnosing this bug.
* file: Restrict to regular files (RHBZ#582484).Richard Jones2010-06-041-11/+35
| | | | | | | | | | | | | | | | | | | | | | The file call can hang if called on char devices (because we are using the file -s option). This is hard to solve cleanly without adding another file API. However this restricts file to regular files, unless called explicitly with a /dev/ path. For non-regular files, it will now return a string like "directory". There is a small semantic change for symbolic links. Previously it would not have worked at all on absolute links (or rather, the results would have been undefined). It would have treated relative symlinks to regular files as the regular file itself. Now it will return the string "symbolic link" in both cases. This commit also makes the API safe when called on untrusted filesystems. Previously a filesystem might have been set up so that (eg) /etc/redhat-release was a char device, which would have caused virt-inspector and virt-v2v to hang. Now it will not hang.
* touch: Restrict touch to regular files only (RHBZ#582484).Richard Jones2010-06-041-0/+20
|
* daemon: Rearrange code in 'file' command.Richard Jones2010-06-041-16/+15
| | | | | | | | path = path to access file (/sysroot/.. or /dev/..) display_path = original path, saved so we can display it buf = optional buffer which is freed along return codepaths There should be no change to the semantics of the code.
* Update to latest gnulib.Richard Jones2010-06-041-0/+1
|