summaryrefslogtreecommitdiffstats
path: root/fish/alloc.c
Commit message (Collapse)AuthorAgeFilesLines
* Add support for hotplugging (adding disks) to the libvirt attach-method.Richard W.M. Jones2012-10-081-5/+0
| | | | | | | | | | | | | When libvirt is used, we can allow disks to be hotplugged. guestfs_add_drive can be called after launch to hot-add a disk. When a disk is hot-added, we first ask libvirt to add the disk to the appliance, then we make an internal call into the appliance to get it to wait for the disk to appear (ie. udev_settle ()). Hot-added disks are tracked in the g->drives array. This also adds a test.
* Remove "convenience header" "gettext.h" and use <libintl.h> instead.Richard W.M. Jones2012-05-011-0/+1
| | | | | | | | | | | | gettextize provides a local file called "gettext.h". Remove this and use <libintl.h> from glibc headers instead. Most of this change is mechanical: #include <libintl.h> in every C file which uses any gettext function. But also we remove the gettext.h file, and adjust the "_" macros. Note that this effectively removes the ./configure --disable-nls option, although we don't know if that ever worked.
* Use O_CLOEXEC / SOCK_CLOEXEC for almost all file descriptors.Richard W.M. Jones2012-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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'.
* Update FSF address.Matthew Booth2011-11-081-1/+1
|
* fish: Specify format of disks (RHBZ#642934,CVE-2010-3851).Richard W.M. Jones2010-10-221-1/+3
| | | | | | | | For libvirt guests, the disk format is copied from libvirt (if libvirt knows it). For command line disk images, you can use --format to override format auto-detection.
* fish: Change 'int argc' to 'size_t argc' throughout.Richard W.M. Jones2010-10-211-2/+2
|
* generator: Generate guestfish-only commands.Richard W.M. Jones2010-09-181-2/+2
| | | | | | The guestfish-only commands such as 'alloc' and 'edit' are now generated from one place in the generator instead of being spread around ad-hoc in the C code.
* fish: Add guestfish -N bootroot and -N bootrootlv for creating boot+root disks.Richard Jones2010-09-081-4/+2
|
* fish: Allow suffixes on number parameters (eg. 1M)Richard Jones2010-05-211-24/+10
| | | | | | | | | | | | | | | | This small change uses the gnulib xstrtoll functionality to enable suffixes on integer parameters in guestfish. For example: truncate-size /file 1G (previously you would have had to given the full number). This also applies to the 'alloc' and 'sparse' commands (and indirectly to the -N option). The specification for these commands has changed slightly, in that 'alloc foo 1MB' would now use SI units, allocating 1000000 bytes instead of a true megabyte. All existing uses would use 'alloc foo 1M' which still allocates true megabytes.
* fish: Add -N option for making prepared disk images.Richard Jones2010-04-221-75/+66
| | | | | | | | | | | | | | | | | Previously you might have typed: $ guestfish ><fs> alloc test1.img 100M ><fs> run ><fs> part-disk /dev/sda mbr ><fs> mkfs ext4 /dev/sda1 now you can do the same with: $ guestfish -N fs:ext4 Some tests have also been updated to use this new functionality.
* Check error returns from posix_fallocate (RHBZ#579664).Richard Jones2010-04-071-1/+4
| | | | | | | | | | | | | | | | | | | | | posix_fallocate has a non-standard way to return error indications. Thus all our calls to posix_fallocate were effectively unchecked. For example: $ guestfish alloc test.img 1P $ echo $? 0 $ ll test.img -rw-rw-r--. 1 rjones rjones 0 2010-04-06 11:02 test.img $ rm test.img With this change, errors are detected and reported properly: $ ./fish/guestfish alloc test.img 1P fallocate: File too large This is a fix for: https://bugzilla.redhat.com/show_bug.cgi?id=579664
* Mac OS X: provide alternate implementation of posix_fallocate.Richard Jones2010-03-221-0/+19
|
* Fixes for compiling on 32 bit.Richard W.M. Jones2009-11-061-7/+7
|
* fish: Allow <nn>P and <nn>E for petabyte and exabyte allocations.Richard Jones2009-11-041-0/+2
|
* fish: Allow <nn>T for terabyte allocations.Richard Jones2009-11-041-3/+4
|
* fish: New command 'sparse', like 'alloc' but to generate sparse files.Richard Jones2009-11-041-0/+54
| | | | | | | | | | | | | | | | | With sparse you can make sparse files, which is fun because you can experiment with really large devices: ><fs> sparse /tmp/test.img 100G ><fs> run ><fs> sfdiskM /dev/vda , ><fs> mkfs ext2 /dev/vda1 # very long pause here ... ><fs> mount /dev/vda1 / To see the real (ie. allocated) size of the sparse file, use the du command, eg: ><fs> !du -h /tmp/test.img 1.6G -rw-rw-r-- 1 rjones rjones 100G 2009-11-04 17:40 /tmp/test.img
* remove trailing blanksJim Meyering2009-07-031-1/+1
|
* Gettextize the source, make library strings translatable.Richard Jones2009-05-211-4/+4
|
* Implement -command (to ignore errors) in guestfish, and allow recovery from ↵Richard Jones2009-05-081-1/+1
| | | | qemu process failure.
* 'guestfish edit' commands and several bugfixes.Richard Jones2009-04-151-2/+2
|
* Move guestfish 'alloc' command to a separate file.Richard Jones2009-04-151-0/+111