summaryrefslogtreecommitdiffstats
path: root/src/guestfs.c
Commit message (Collapse)AuthorAgeFilesLines
...
* add_drive: Don't use cache=off if not supported by underlying filesystem.Richard W.M. Jones2009-08-131-6/+23
| | | | | | | | | | | | | | | | | | If you use the guestfs_add_drive function, then currently it generates a qemu command line element like: -drive ...,cache=off,... This causes qemu to try to open the device with O_DIRECT. Unfortunately some filesystems don't support this flag, notably tmpfs, which means you can't use libguestfs in conjunction with tmpfs. On some systems /tmp is a tmpfs filesystem. This patch fixes this so that if the filesystem doesn't support O_DIRECT, then we omit the cache=off parameter. This seems reasonable from a reliability point of view, because if you're using tmpfs then you probably didn't expect reliability in the case where your system suddenly powers off.
* Allow selinux=? kernel flag to be controlled.Richard Jones2009-08-121-5/+24
| | | | Adds new API calls to set and get this flags.
* Debug: Improve the way the qemu command line is printed.Richard Jones2009-08-071-7/+31
| | | | | | | | | | | | | | | | Change the way the qemu command is displayed to look like this: /usr/bin/qemu-kvm \ -drive file=/tmp/test.img,cache=off,if=virtio \ -m 500 \ -no-reboot \ -kernel /tmp/libguestfsHBJHRh/kernel \ -initrd /tmp/libguestfsHBJHRh/initrd \ [...] This allows the command line to be copied and pasted directly into the shell, and also makes it simpler to read.
* Allow network interface to be configured.Richard Jones2009-08-071-1/+1
| | | | | | | | Add ./configure --with-net-if=(virtio|ne2k_pci) option. This lets you workaround the following virtio_net bug: https://bugzilla.redhat.com/show_bug.cgi?id=516022
* Add ne2k-pci driver to the appliance.Richard Jones2009-08-061-1/+1
| | | | | This allows people to use the ne2k-pci network driver, for those situations where the virtio_net driver is broken (cough 516022 cough).
* Make user network numbering explicit.Richard Jones2009-08-061-2/+2
| | | | | | Use: -net user,vlan=0,net=10.0.2.0/8 just to make the (already implicit) 10.0.2.x network explicit.
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-031-113/+113
| | | | | | | | | | | 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 : $_'
* guestfs: fix typo in my recent changeJim Meyering2009-08-031-3/+3
| | | | | * src/guestfs.c (guestfs_perrorf): Rename former err to errnum, to avoid compilation error.
* guestfs: don't fault upon failed vasprintfJim Meyering2009-08-031-1/+3
| | | | * src/guestfs.c (guestfs_perrorf): Handle failed vasprintf.
* lib: Add selinux=0 to default kernel command line.Richard W.M. Jones2009-07-311-1/+2
| | | | | | | | | | | SELinux exists in a very disturbed state if it is enabled at boot time, but no policy is loaded. In particular, it messes up the security.selinux extended attributes on files in a not-very-useful way. We can't enable SELinux because we don't know what policy can or should be loaded. Therefore it's best to disable it completely.
* Pass cgroup_disable=memory, saves ~ 5MB of RAM.Richard Jones2009-07-241-1/+2
|
* Revert "Add 'set-kernel'/'get-kernel'/LIBGUESTFS_KERNEL to override ↵Richard Jones2009-07-221-24/+1
| | | | | | appliance kernel." This reverts commit 34d2df41626f1ee4172a6d40b06d72d6ed9d6348.
* Add 'set-kernel'/'get-kernel'/LIBGUESTFS_KERNEL to override appliance kernel.Richard Jones2009-07-221-1/+24
| | | | | This allows you to override the appliance kernel with an easy command or environment variable.
* Add commented-out support for alternate guestfwd syntax.Richard W.M. Jones2009-07-211-9/+32
| | | | | | This commit just moves code around. The new support is not enabled because it doesn't work. See qemu-devel, subject "guestfwd option doesn't allow supplementary ,server,nowait"
* Library: Pass more options on the Linux kernel command line.Richard W.M. Jones2009-07-211-1/+8
| | | | | | | Always pass: noapic (APIC causes problems for lots of people) udevtimeout=300 (for very slow qemu using softemu) acpi=off (ACPI is troublesome and unnecessary, so turn it off)
* Allow TMPDIR to override directory used for temporary files (RHBZ#512905).Richard W.M. Jones2009-07-211-1/+11
|
* Add 'version' call to get true library version number.Richard Jones2009-07-101-0/+13
| | | | | | This patch also changes the way that the version is specified in configure.ac. It is now made out of four parts (major, minor, release and extra) and constructed for AC_INIT.
* Properly close fds and unregister handlers in guestfs_close.Richard Jones2009-07-101-0/+19
| | | | | | | | | This caused a segfault if you tried to repeatedly open and close a guestfs handle in the same program. The reason is that the old handler remained registered (not always - it was racey). This adds proper cleanup to the guestfs_close path, also for file descriptors.
* Generate structs and struct lists generically.Richard Jones2009-07-071-38/+0
| | | | | | | | | | | This modifies the way that struct and struct lists are generated (for return values) so that there is no need to add an explicit new type when adding a new structure. All tests pass, and the C API should be compatible. I have also inspected the changes that are made to the generated code by hand.
* Add a debug message to the library cancellation path.Richard Jones2009-07-061-0/+4
|
* Add 'get-pid' command.Richard Jones2009-07-061-0/+11
| | | | | This is used to get the PID of the qemu subprocess, mainly for debugging and testing purposes.
* use safe_malloc and safe_calloc in generated codeJim Meyering2009-07-031-1/+38
| | | | | | | | | | * src/generator.ml (safe_malloc): Define to guestfs_safe_malloc. (safe_calloc): Define to guestfs_safe_calloc. [most generated code]: Fail immediately upon failure of otherwise- unchecked malloc and calloc calls. * src/guestfs.c: Include <stddef.h>. (xalloc_oversized): Define. * src/guestfs.h (guestfs_safe_calloc): Declare.
* Add ./configure --with-drive-if=(ide|scsi|virtio)Richard W.M. Jones2009-07-021-2/+2
| | | | | | | | With this flag the packager can decide to default to a particular qemu drive model. The current default is 'ide', however note that we intend to change this in future to 'virtio' once some upstream regressions are fixed. Packagers can force a particular drive model if they wish.
* Add 'readdir' call.Richard W.M. Jones2009-07-021-0/+7
| | | | | | | | | | | | This adds a readdir call (mostly intended for programs). The return value is a list of guestfs_dirent structures. This adds the new types 'struct guestfs_dirent' and 'struct guestfs_dirent_list', along with all the code to return these in the different language bindings. Also includes additional tests for OCaml and Perl bindings to test this.
* Change to use virtio_blk (virtio block device) by default.Richard W.M. Jones2009-07-011-2/+2
| | | | | | | | | | | | | virtio_blk is the fast, virt-native block device driver supported by qemu and KVM. Note that virtio_blk device names are called /dev/vd*. Existing scripts should continue working because device name translation will silently change device names of the form /dev/sd* to /dev/vd* as required. See also: http://libguestfs.org/guestfs.3.html#block_device_naming
* Don't dereference or free undefined "msg" upon OOM.Jim Meyering2009-07-011-1/+3
| | | | * src/guestfs.c (guestfs_error): Handle failing vasprintf.
* Add 'set_memsize'/'get_memsize' calls.Richard W.M. Jones2009-06-301-11/+33
| | | | | | Allow the qemu memory size to be specified either by API calls or by setting the LIBGUESTFS_MEMSIZE environment variable.
* Fix for 'broken pipe' error when qemu dies (RHBZ#508713).Richard W.M. Jones2009-06-291-2/+5
|
* Bump up default guest size to 500M.Richard W.M. Jones2009-06-231-1/+1
|
* Command line argument handling.Richard W.M. Jones2009-06-231-3/+106
|
* '-no-kqemu' option is no longer necessary to avoid a warning.Richard W.M. Jones2009-06-231-3/+0
|
* Rename guestfs-supermin-helper -> libguestfs-supermin-helper.Richard Jones2009-06-181-1/+1
|
* Fix build_supermin_appliance to return kernel / initrd names.Richard Jones2009-06-161-3/+12
|
* Experimental implementation of the supermin appliance (passes most tests).Richard Jones2009-06-151-28/+145
|
* Add 'add_drive_ro' call. Fix up documentation. Plus a couple of minor code ↵Richard Jones2009-06-021-0/+21
| | | | improvements in the tests.
* Correctly handle malloc/realloc(0)Richard W.M. Jones2009-05-291-2/+2
| | | | | - malloc and realloc(0) are valid requests. Some implementations may return NULL for these, which would not indicate an error.
* Gettextize the source, make library strings translatable.Richard Jones2009-05-211-58/+70
|
* Don't stash strings in the handle.Richard W.M. Jones2009-05-131-17/+36
| | | | | - makes it impossible to write bindings for set_{path,qemu,append} functions
* Add 'append', LIBGUESTFS_APPEND to set additional kernel options.Richard W.M. Jones2009-05-131-2/+21
|
* Increase the wait time for vmchannel socket to appear (fix for slow / ↵Richard Jones2009-05-131-3/+3
| | | | heavily-loaded) machines.
* Handle EINTR, EAGAIN in select main loop.Richard Jones2009-05-101-0/+2
|
* Fix four memory leaks in guestfs.c revealed by valgrind.Richard Jones2009-05-091-0/+7
|
* Allow recovery from guest failure.Richard Jones2009-05-081-28/+57
|
* Change memory calculation to choose a generous amount of memory.Richard Jones2009-05-081-33/+7
|
* Force qemu quit when kernel panics (Charles Duffy).Richard Jones2009-05-081-1/+2
|
* Use unsigned type for lengths.Richard Jones2009-05-071-9/+12
|
* Handle EINTR and EAGAIN in reads.Richard Jones2009-05-071-4/+11
|
* Replace rtl8139 network card with virtio-net.Richard Jones2009-04-301-1/+1
|
* Autosync now runs umount-all; syncRichard Jones2009-04-301-1/+3
|
* Multiple callbacks during file transfers could cause data corruption - FIXED.Richard Jones2009-04-261-34/+84
|