summaryrefslogtreecommitdiffstats
path: root/daemon/mount.c
Commit message (Collapse)AuthorAgeFilesLines
* daemon: Fix /dev/mapper paths from mounts and mountpoints (RHBZ#646432).Richard W.M. Jones2010-10-281-0/+21
| | | | Make the LV paths returned by these two commands canonical.
* Fix FileIn cmds losing synch if both ends send cancel messages (RHBZ#576879).Richard Jones2010-05-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | During a FileIn command (eg. upload, tar-in) if both sides experience errors, then both sides could send cancel messages, the result being lost synchronization. The reason for the lost synch was because the daemon was ignoring this case and sending an error message back which the library side (which had cancelled) was not expecting. Fix this by checking in the daemon for the case where the library also cancels during daemon cancellation, and not sending an error messages. This also includes an enhanced regression test which checks for this case. This extends the original fix in commit 5922d7084d6b43f0a1a15b664c7082dfeaf584d0. More details can be found here: https://bugzilla.redhat.com/show_bug.cgi?id=576879#c5
* Fix upload losing synchronization if root not mounted (RHBZ#576879).Richard Jones2010-04-171-4/+4
| | | | | | | | | | | | Modify the generator so that it can correctly handle early cancellation for Pathname|Device|.. parameters. This fixes the upload command, but consequently we need to fix the parameters for tar_in and t?z_in commands. This should also mean that 'win:' can now be used as the second argument of tar_in and t?z_in commands in guestfish, whereas previously this wouldn't have worked. Adds a regression test for the original problem.
* daemon: Don't need to prefix error messages with the command name.Richard Jones2010-02-121-6/+6
| | | | | | | | | | | | | | | | | | | | The RPC stubs already prefix the command name to error messages. The daemon doesn't have to do this. As a (small) benefit this also makes the daemon slightly smaller. Code in the daemon such as: if (argv[0] == NULL) { reply_with_error ("passed an empty list"); return NULL; } now results in error messages like this: ><fs> command "" libguestfs: error: command: passed an empty list (whereas previously you would have seen ..command: command:..)
* use STREQ, not strcmp: part 1Jim Meyering2009-11-091-1/+1
| | | | | git grep -l 'strcmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
* change strncmp() == 0 to STREQLEN()Jim Meyering2009-11-091-1/+1
| | | | | git grep -l 'strncmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrncmp( *\(.*?\)) *== *0\b/STREQLEN$1/g'
* umount: Enable device name translation for device parameter.Richard Jones2009-08-131-3/+8
|
* mount: Check mountpoints are absolute paths.Richard Jones2009-08-131-0/+2
|
* In rmmountpoint, have to explicitly check for ABS_PATH (*not* NEED_ROOT).Richard Jones2009-08-131-0/+3
|
* do_umount: don't use RESOLVE_DEVICE anymoreJim Meyering2009-08-131-13/+9
| | | | | * daemon/mount.c (do_umount): Don't use RESOLVE_DEVICE here, now that the caller always invokes REQUIRE_ROOT_OR_RESOLVE_DEVICE.
* generator.ml: use new "Pathname" designationJim Meyering2009-08-131-16/+10
| | | | | | | | | | Nearly every file-related function in daemons/*.c is affected: Remove this pair of statements from each affected do_* function: - NEED_ROOT (return -1); - ABS_PATH (dir, return -1); and change the type of the corresponding parameter to "const char *". * src/generator.ml: Emit NEED_ROOT just once, even when there are two or more Pathname args.
* update all NEED_ROOT usesJim Meyering2009-08-131-3/+3
| | | | | | run this command: git grep -l -w NEED_ROOT|xargs perl -pi -e \ 's/(NEED_ROOT) \((.*?)\)/$1 (return $2)/'
* * src/generator.ml: Change all `String "device"' to `Device "device"'.Jim Meyering2009-08-131-2/+0
| | | | | | | | | | | | | | | | | | | | | Then update each affected function, removing each uses of RESOLVE_DEVICE, now that it's generated in caller from stub.c. * daemon/blockdev.c (call_blockdev): Remove use of RESOLVE_DEVICE. * daemon/devsparts.c (do_mkfs): Likewise. * daemon/ext2.c (do_e2fsck_f, do_get_e2label, do_get_e2uuid): Likewise. (do_resize2fs, do_set_e2label, do_set_e2uuid, do_tune2fs_l): Likewise. * daemon/fsck.c (do_fsck): Likewise. * daemon/grub.c (do_grub_install): Likewise. * daemon/lvm.c (do_lvremove, do_pvcreate, do_pvremove): Likewise. (do_pvresize): Likewise. * daemon/mount.c (do_mount_vfs): Likewise. * daemon/ntfs.c (do_ntfs_3g_probe): Likewise. * daemon/scrub.c (do_scrub_device): Likewise. * daemon/sfdisk.c (sfdisk, sfdisk_flag): Likewise. * daemon/swap.c (do_mkswap, do_mkswap_L, do_mkswap_U): Likewise. (do_swapoff_device, do_swapon_device): Likewise. * daemon/zero.c (do_zero): Likewise. * daemon/zerofree.c (do_zerofree): Likewise.
* update all uses of ABS_PATHJim Meyering2009-08-131-3/+3
| | | | | | run this command: git grep -l -w ABS_PATH|xargs perl -pi -e \ 's/(?:ABS_PATH)( \(.*?,) (.*?)\)/ABS_PATH$1 return $2)/'
* change almost all uses: s/IS_DEVICE/RESOLVE_DEVICE/Jim Meyering2009-08-131-2/+2
| | | | | | Use this command: git grep -l -w IS_DEVICE|xargs perl -pi -e \ 's/\b(?:IS_DEVICE)\b( \(.*?,) (.*?)\)/RESOLVE_DEVICE$1 return $2)/'
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-031-20/+20
| | | | | | | | | | | Do it by running this command: [exempted files are matched via .x-sc_TAB_in_indentation] git ls-files \ | pcregrep -vf .x-sc_TAB_in_indentation \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
* Make /sysroot path configurable.Richard Jones2009-07-181-27/+23
| | | | | | | | | Currently /sysroot is hard-coded throughout the daemon code. This patch turns the path into a variable so that we can change it in future, for example to allow standalone mode to be implemented. This patch was tested by running all the C API tests successfully.
* New commands: 'mkmountpoint' and 'rmmountpoint'Richard W.M. Jones2009-07-151-0/+51
| | | | | | | | | | | | | | | | | | | | | These specialized commands are used to create additional mountpoints before mounting filesystems. They are only used where you want to mount several unrelated or read-only filesystems together, and need additional care to use correctly. Here is how to use these calls to unpack the "Russian doll" nest of a Fedora 11 live CD: add-ro Fedora-11-i686-Live.iso run mkmountpoint /cd mkmountpoint /squash mkmountpoint /ext3 mount /dev/sda /cd mount-loop /cd/LiveOS/squashfs.img /squash mount-loop /squash/LiveOS/ext3fs.img /ext3 The inner filesystem is now unpacked under the /ext3 mountpoint.
* New command: 'mountpoints' which returns a hash of device -> mountpoint.Richard W.M. Jones2009-07-151-2/+29
|
* remove trailing blanksJim Meyering2009-07-031-1/+1
|
* Add mount-loop command (RHBZ#508668).Richard W.M. Jones2009-06-291-0/+44
| | | | | | | | | Loop device mounts don't work for the generic 'mount' commands because the first parameter should be a file not a device. We want to separate out files parameters from device parameters in the long term, so this adds a new mount-loop command for this purpose.
* Fix memory leak in daemon/mount.c:do_mount_vfs.Richard W.M. Jones2009-06-291-0/+1
|
* In the daemon, change all const char * parameters to char *.Richard Jones2009-06-101-7/+7
|
* Add IS_DEVICE checks for all calls which take a device parameter.Richard Jones2009-06-101-3/+6
|
* Fix umount_all command so it unmounts filesystems in the correct order.Richard Jones2009-04-301-8/+68
|
* Add mount_ro, mount_options, mount_vfs. Fix small bug in OCaml generator.Richard Jones2009-04-221-4/+29
|
* Added test suite.Richard Jones2009-04-111-0/+115
|
* Implemented 'mount' and 'touch' commands.Richard Jones2009-04-031-0/+76