summaryrefslogtreecommitdiffstats
path: root/daemon/sfdisk.c
Commit message (Collapse)AuthorAgeFilesLines
* daemon: Don't need to prefix error messages with the command name.Richard Jones2010-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | 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:..)
* sfdisk.c, fallocate.c: use a string literal as formatJim Meyering2009-08-171-2/+2
| | | | | * daemon/fallocate.c (do_fallocate): Format was not a string literal. * daemon/sfdisk.c (sfdisk): Likewise.
* adjust const "**" pointers to avoid warningsJim Meyering2009-08-171-5/+5
| | | | | | Also, ... * src/generator.ml: Add DeviceList type, and propagate that change out to all calling/interface code.
* sfdisk: guard against buffer overflowJim Meyering2009-08-131-2/+15
| | | | | * daemon/sfdisk.c (sfdisk): Don't let outrageous "extra_flag" or "device" strings overflow a fixed-size buffer.
* generator.ml: use new "Pathname" designationJim Meyering2009-08-131-9/+9
| | | | | | | | | | 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.
* * src/generator.ml: Change all `String "device"' to `Device "device"'.Jim Meyering2009-08-131-4/+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.
* convert the last few, manuallyJim Meyering2009-08-131-1/+1
|
* 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-4/+4
| | | | | | | | | | | 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 : $_'
* remove trailing blanksJim Meyering2009-07-031-1/+1
|
* Add 'sfdiskM' command.Richard W.M. Jones2009-07-021-2/+13
| | | | | | | | | | This command is a saner interface to partitioning. All partition sizes are specified in megabytes (not cylinders). You don't need to specify the cyls/heads/secs parameters. All the test code has been updated to use this, so it is now CHS-independent (eg. when CHS changes as between IDE and virtio).
* Call 'udevadm settle' after operations which add/remove device nodes.Richard W.M. Jones2009-07-011-0/+4
| | | | | | | | | | | | | Because udev operates asynchronously, we found errors which were caused by a previous command (eg. sfdisk or pvremove) creating or removing a device, and that change not having happened by the time the next command was run. This patch adds calls to '/sbin/udevadm settle' after any commands which can add or remove device nodes. If udev is not being used or not available, this should have no effect. The command fails and this is silently ignored.
* Fix error handling of external sfdisk command.Richard W.M. Jones2009-07-011-4/+3
| | | | | | | | Should use 'pclose' instead of 'fclose' (although fclose happens to work because of glibc internals). The result of pclose is the exit status of the command, so we need to test this is != 0.
* In the daemon, change all const char * parameters to char *.Richard Jones2009-06-101-9/+9
|
* Add vg-activate{,-all} commands, and resize recipe.Richard Jones2009-05-181-1/+4
|
* Add: pvresize, sfdisk-N, sfdisk-l, sfdisk-kernel-geomtry, ↵Richard W.M. Jones2009-05-151-0/+130
sfdisk-disk-geometry commands. Pass --no-reread flag to sfdisk.