summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* EPEL 5: Add 1 second pause after unmounting any filesystem.oldlinuxRichard W.M. Jones2012-06-271-0/+6
| | | | | | | | | | | | | | | | | | | This fixes the test-charset-fidelity test case. A simpler example which fails without this is: guestfish <<EOF sparse test1.img 1G run part-disk /dev/sda mbr mkfs msdos /dev/sda1 mount /dev/sda1 / touch /foo umount / mkfs ntfs /dev/sda1 # Next command would fail: mount /dev/sda1 / vfs-type /dev/sda1 -x EOF
* EPEL 5: Fix blkid to return "LVM2_member" for PVs.Richard W.M. Jones2012-06-271-0/+20
| | | | Old blkid in RHEL 5 didn't return the right thing for PVs.
* EPEL 5: Add "null vmchannel" back for qemu without virtio-serial support.Richard W.M. Jones2012-06-271-8/+91
|
* EPEL 5: Don't use C99-style variable decls in for-loop.Richard W.M. Jones2012-06-271-2/+4
|
* part-get-bootable: Fix when partitions are missing or unordered (RHBZ#602997).Richard W.M. Jones2012-06-221-4/+16
| | | | | | | | The original fix for this in commit 511c82df46f5c6f4a7f984fdb81d4691038ed6da was not complete, in that it did not fix the case of the old (pre '-m' option) parted. This doesn't matter for Fedora, but it matters for RHEL 5 which has this ancient parted.
* New API: device-index.Richard W.M. Jones2012-06-131-0/+23
| | | | | | This returns the index of the device, eg. /dev/sdb => 1. Or you can think of it as the order that the device was added, or the index of the device in guestfs_list_devices.
* lvm-filter: Make it work with > 26 devices.Richard W.M. Jones2012-06-131-11/+14
| | | | Thanks Alasdair Kergon.
* daemon: Fix order of devices in guestfs_list_devices when > 26 disks.Richard W.M. Jones2012-06-133-2/+69
| | | | | Sort the device names correctly, not just treating them as strings. As a result, /dev/sdz < /dev/sdaa.
* daemon: Always pass -F option to mke2fs.Richard W.M. Jones2012-06-121-6/+6
| | | | | | | | | | Apparently e2fsprogs only knows that "/dev/sda" is a whole device, but doesn't think that "/dev/vda" is. On switching the default device over to virtio-scsi, that causes mke2fs without -F option to complain and ask for an interactive prompt. Adding -F forces it to go ahead anyway. This caused several less-used APIs to break with virtio-scsi.
* New API: fstrim - allow filesystem trim.Richard W.M. Jones2012-06-122-0/+98
|
* btrfs: Modify btrfs availability to test if the kernel supports btrfs.Richard W.M. Jones2012-06-091-1/+1
| | | | | | This is closer to the real meaning of "availability of btrfs", since just having the btrfs tool doesn't help much if it's not supported by the kernel too.
* New API: filesystem-available: tests for filesystem availability.Richard W.M. Jones2012-06-092-0/+82
| | | | | This also creates an internal filesystem_available function within the daemon.
* xattr: Refuse to set or get oversized extended attributes.Richard W.M. Jones2012-05-281-0/+29
| | | | | See: https://www.redhat.com/archives/libguestfs/2012-May/msg00152.html
* fish/mount: Add better error message when -m (mount) fails (RHBZ#824043).Richard W.M. Jones2012-05-241-1/+2
|
* debug: Add setenv debugging command.Richard W.M. Jones2012-05-221-0/+24
|
* NEW API: add new api btrfs-fsckWanlong Gao2012-05-151-0/+44
| | | | | | | | | Add the new API btrfs-fsck to check the btrfs filesystem. Btrfs is currently under heavy development, and not suitable for any uses other than benchmarking and review. But it'll be useful in the near future. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* btrfs: change the return value of btrfs-set-seedingWanlong Gao2012-05-151-1/+1
| | | | | | Change the return value from "r" to "0". Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* doc: Add notes on how GPT works on 4k sector disks.Richard W.M. Jones2012-05-141-1/+3
| | | | | | | | | I used scsi_debug to create a 4k sector virtual disk: modprobe scsi_debug dev_size_mb=128 sector_size=4096 I then used 'gdisk' to create lots of partitions, and used 'hexdump' to examine what was written to disk.
* New API: add new api btrfs-set-seeding to enable or disable seeding.Wanlong Gao2012-05-141-0/+19
| | | | | | | Add the new API btrfs-set-seeding to support the seeding-device feature for btrfs. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* debug: 'progress' (unsupported debug command) now checks argument is ↵Richard W.M. Jones2012-04-271-1/+5
| | | | | | reasonable (RHBZ#816839). Thanks Yuyu Zhou.
* btrfs-device-delete: Use correct (sysroot-prefixed) path to filesystem.Richard W.M. Jones2012-04-251-1/+3
| | | | This fixes commit 87ea7a04094d5ed40f3f047ff2b7a613d4d530d4.
* New btrfs APIs.Richard W.M. Jones2012-04-251-0/+396
| | | | | | | | | | | | | | | | Bind the easy parts of the 'btrfs' program. The new APIs are: btrfs-device-add: add devices to a btrfs filesystem btrfs-device-delete: remove devices from a btrfs filesystem btrfs-filesystem-sync: sync a btrfs filesystem btrfs-filesystem-balance: balance a btrfs filesystem btrfs-subvolume-create: create a btrfs snapshot btrfs-subvolume-delete: delete a btrfs snapshot btrfs-subvolume-list: list btrfs snapshots and subvolumes btrfs-subvolume-set-default: set default btrfs subvolume btrfs-subvolume-snapshot: create a writable btrfs snapshot
* btrfs: Modify mkfs-btrfs API so it takes a list of devices.Richard W.M. Jones2012-04-251-7/+16
| | | | | | | btrfs filesystems can span multiple filesystems. Note this changes the API, but this API has not yet been released in a stable version of libguestfs.
* New APIs for reading and writing ext2 file attributes and file generation.Richard W.M. Jones2012-04-131-1/+193
| | | | | | | | | | | | The new APIs are: get-e2attrs: List ext2 file attributes of a file. set-e2attrs: Set or clear ext2 file attributes of a file. get-e2generation: Get ext2 file generation of a file. set-e2generation: Set ext2 file generation of a file. These are implemented using the lsattr and chattr programs from e2fsprogs.
* New API: mkfs-btrfs for creating btrfs filesystems (RHBZ#807905).Richard W.M. Jones2012-04-022-1/+110
| | | | This allows all parameters from btrfs to be accessed.
* mkfs: Don't allow blocksize to be set on btrfs (RHBZ#807905).Richard W.M. Jones2012-04-021-0/+5
|
* New API: md-stat.Richard W.M. Jones2012-03-201-0/+172
| | | | | This returns information about the underlying devices of an MD (software RAID) device.
* daemon: Add reply_with_error_errno function.Richard W.M. Jones2012-03-202-6/+7
| | | | | | This function allows you to pass an explicit errno back to the library. reply_with_error is redefined as a macro that calls reply_with_error_errno with errno == 0.
* New API: vgmeta: Download volume group metadata.Richard W.M. Jones2012-03-171-0/+88
|
* New APIs: isoinfo and isoinfo-device.Richard W.M. Jones2012-03-162-0/+293
| | | | | Get ISO primary volume descriptor information for either ISO devices or ISO files.
* daemon: Don't call reply_with_* after split_lines fails.Richard W.M. Jones2012-03-162-6/+2
| | | | | split_lines already sets reply_with_*, so calling it again would lose protocol synchronization.
* Use the new lvcreate-free API to create largest possible LVs.Richard W.M. Jones2012-03-151-1/+1
|
* New API: lvcreate-free: Create logical volume as % of free space.Richard W.M. Jones2012-03-151-0/+30
|
* New API: zero_free_space: zero free space in a filesystem.Richard W.M. Jones2012-03-151-0/+104
| | | | | | | | | | | | | | Add an API for doing what virt-sparsify was doing: freeing up free space in a filesystem. The current implementation is simple-minded: we create a file, fill it with zeroes until we run out of space, then delete the file. However the description leaves it open to do a better implementation, eg. using sparsification support that is currently being worked on in ext4 and qemu. The implementation also sends progress notifications, which is an advantage over the old 'dd' method.
* Use O_CLOEXEC / SOCK_CLOEXEC for almost all file descriptors.Richard W.M. Jones2012-03-1422-51/+57
| | | | | | | | | | | | | | | | | | | | | | | | The presumption is that all file descriptors should be created with the close-on-exec flag set. The only exception are file descriptors that we want passed through to exec'd subprocesses (mainly pipes and stdin/stdout/stderr). For open calls, we pass O_CLOEXEC as an extra flag, eg: fd = open ("foo", O_RDONLY|O_CLOEXEC); This is a Linux-ism, but using a macro we can easily make it portable. For sockets, similarly: sock = socket (..., SOCK_STREAM|SOCK_CLOEXEC, ...); For accepted sockets, we use the Linux accept4 system call which allows flags to be supplied, but we use the Gnulib 'accept4' module to make this portable. For dup, dup2, we use the Linux dup3 system call, and the Gnulib modules 'dup3' and 'cloexec'.
* daemon: When copy subprocess fails, print return code.Richard W.M. Jones2012-03-141-1/+1
| | | | Useful for debugging.
* daemon: labels: Memory leak in 'set_label'.Richard W.M. Jones2012-03-141-3/+7
| | | | This fixes commit d1711dae9dbd7f516469f88807604894c1304228.
* Replace 'int' with 'size_t' passim.Richard W.M. Jones2012-03-1313-66/+74
| | | | | Analyze all uses of 'int' in the code, and replace with 'size_t' where appropriate.
* daemon: Implement a growable strings buffer type.Richard W.M. Jones2012-03-1316-196/+209
| | | | | | | | | | | | | | | | | | | | | | | | Previously a lot of daemon code used three variables (a string list, 'int size' and 'int alloc') to track growable strings buffers. This commit implements a simple struct containing the same variables, but using size_t instead of int: struct stringsbuf { char **argv; size_t size; size_t alloc; }; Use it like this: DECLARE_STRINGSBUF (ret); //... if (add_string (&ret, str) == -1) return NULL; //... if (end_stringsbuf (&ret) == -1) return NULL; return ret.argv;
* daemon: Remove unused variables.Richard W.M. Jones2012-03-122-8/+0
|
* resize2fs: Run 'e2fsck -f' automatically if filesystem is not mounted.Richard W.M. Jones2012-03-093-0/+81
|
* e2fsck: Comment, whitespace, error message cleanups.Richard W.M. Jones2012-03-091-2/+2
|
* Revert "ext2: tweak the error returned message of resize2fs-M(BZ755729)"Richard W.M. Jones2012-03-091-4/+1
| | | | This reverts commit 0eaf06e673833bc25673d5c3d2487fffae310285.
* daemon: glob: Initialize glob buffer (quiet Coverity warning).Richard W.M. Jones2012-03-081-1/+1
| | | | | | | | | Error: UNINIT: /builddir/build/BUILD/libguestfs-1.16.5/daemon/glob.c:32: var_decl: Declaring variable "buf" without initializer. /builddir/build/BUILD/libguestfs-1.16.5/daemon/glob.c:36: uninit_use_in_call: Using uninitialized value "buf.gl_offs" when calling "rpl_glob". /builddir/build/BUILD/libguestfs-1.16.5/gnulib/lib/glob.c:557: read_parm_fld: Reading a parameter field. /builddir/build/BUILD/libguestfs-1.16.5/daemon/glob.c:36: uninit_use_in_call: Using uninitialized value "buf.gl_pathc" when calling "rpl_glob". /builddir/build/BUILD/libguestfs-1.16.5/gnulib/lib/glob.c:557: read_parm_fld: Reading a parameter field.
* comment: Note time-of-check to time-of-use race found by Coverity.Richard W.M. Jones2012-03-081-0/+6
|
* daemon: inotify: Check event->len in inotify struct is reasonable.Richard W.M. Jones2012-03-081-0/+7
| | | | | | | | | | | | | | The Coverity error is this (which I think is wrong): Error: TAINTED_SCALAR: /builddir/build/BUILD/libguestfs-1.16.5/daemon/inotify.c:211: tainted_data_argument: Calling function "read" taints argument "inotify_buf". /builddir/build/BUILD/libguestfs-1.16.5/daemon/inotify.c:232: var_assign_var: Assigning: "event" = "(struct inotify_event *)&inotify_buf[n]". Both are now tainted. /builddir/build/BUILD/libguestfs-1.16.5/daemon/inotify.c:258: lower_bounds: Checking lower bounds of unsigned scalar "event->len" by "event->len > 0U". /builddir/build/BUILD/libguestfs-1.16.5/daemon/inotify.c:272: var_assign_var: Compound assignment involving tainted variable "16UL + event->len" to variable "n" taints "n". /builddir/build/BUILD/libguestfs-1.16.5/daemon/inotify.c:228: lower_bounds: Checking lower bounds of unsigned scalar "n" by "n < inotify_posn". /builddir/build/BUILD/libguestfs-1.16.5/daemon/inotify.c:281: tainted_data: Using tainted variable "n" as an index into an array "inotify_buf". Adding a sanity check of event->len is prudent.
* daemon: debug: Close fd along error path (found by Coverity).Richard W.M. Jones2012-03-081-0/+1
| | | | | | | | Error: RESOURCE_LEAK: /builddir/build/BUILD/libguestfs-1.16.5/daemon/debug.c:469: open_fn: Calling opening function "open". /builddir/build/BUILD/libguestfs-1.16.5/daemon/debug.c:469: var_assign: Assigning: "fd" = handle returned from "open("/proc/sys/kernel/core_pattern", 1)". /builddir/build/BUILD/libguestfs-1.16.5/daemon/debug.c:474: noescape: Variable "fd" is not closed or saved in function "write". /builddir/build/BUILD/libguestfs-1.16.5/daemon/debug.c:476: leaked_handle: Handle variable "fd" going out of scope leaks the handle.
* daemon: upload: Close fd along error path (found by Coverity).Richard W.M. Jones2012-03-081-0/+1
| | | | | | | | Error: RESOURCE_LEAK: /builddir/build/BUILD/libguestfs-1.16.5/daemon/upload.c:225: open_fn: Calling opening function "open". /builddir/build/BUILD/libguestfs-1.16.5/daemon/upload.c:225: var_assign: Assigning: "fd" = handle returned from "open(filename, 0)". /builddir/build/BUILD/libguestfs-1.16.5/daemon/upload.c:233: noescape: Variable "fd" is not closed or saved in function "lseek". /builddir/build/BUILD/libguestfs-1.16.5/daemon/upload.c:235: leaked_handle: Handle variable "fd" going out of scope leaks the handle.
* daemon: 9p: Close fd along error paths (found by Coverity).Richard W.M. Jones2012-03-081-0/+2
| | | | | | | | | Error: RESOURCE_LEAK: /builddir/build/BUILD/libguestfs-1.16.5/daemon/9p.c:130: open_fn: Calling opening function "open". /builddir/build/BUILD/libguestfs-1.16.5/daemon/9p.c:130: var_assign: Assigning: "fd" = handle returned from "open(filename, 0)". /builddir/build/BUILD/libguestfs-1.16.5/daemon/9p.c:142: leaked_handle: Handle variable "fd" going out of scope leaks the handle. /builddir/build/BUILD/libguestfs-1.16.5/daemon/9p.c:149: noescape: Variable "fd" is not closed or saved in function "read". /builddir/build/BUILD/libguestfs-1.16.5/daemon/9p.c:153: leaked_handle: Handle variable "fd" going out of scope leaks the handle.
* New API: set-label, for setting a label on any filesystem.Richard W.M. Jones2012-02-274-25/+105
| | | | | | Currently only ext2/3/4 and (newly) NTFS are supported. This change also deprecates set-e2label.