summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* OCaml viewer: Use ocamlduce to replace xpath code.Richard Jones2009-09-305-48/+36
|
* OCaml viewer: Handle exceptions properly.Richard Jones2009-09-291-1/+8
|
* OCaml example: graphical disk usage viewer.Richard Jones2009-09-298-3/+776
| | | | | | | | | This is an example of how to write an app which uses libguestfs and libvirt, and has a responsive user interface (using threads). It is a Gtk-based "graphical virt-df". Read the top of the 'viewer.ml' file first for instructions on how to compile. This program is not compiled by default.
* virt-df: Add note about parsing CSV.Richard Jones2009-09-241-2/+27
|
* avoid use of all ctype macrosJim Meyering2009-09-2413-27/+29
| | | | | | | | | | | | | | | | | | | | * cfg.mk (disable_temporarily): Don't disable sc_avoid_ctype_macros. * fish/tilde.c: Remove unnecessary inclusion of ctype.h. * bootstrap: Add gnulib's c-ctype module to the list. * daemon/m4/gnulib-cache.m4: Likewise. * daemon/ext2.c: Include "c-ctype.h", not <ctype.h>. Use c_isspace, etc, rather than isspace. * daemon/guestfsd.c: Likewise. * daemon/lvm.c: Likewise. * daemon/proto.c: Likewise. * fish/fish.c: Likewise. * fish/tilde.c: Likewise. * src/generator.ml: Likewise. * src/guestfs.c: Likewise. * examples/to-xml.c: Likewise. * examples/Makefile.am (to_xml_CPPFLAGS): Add -I$(top_srcdir)/gnulib/lib so inclusion of "c-ctype.h" works. (to_xml_CPPFLAGS): Rename from to_xml_CFLAGS.
* maint: prune dead wood from list of skipped syntax-check rulesJim Meyering2009-09-241-18/+1
| | | | | * cfg.mk (local-checks-to-skip): Remove now-passing and no-longer-relevant rule names.
* maint: use spaces, not TABs for indentationJim Meyering2009-09-244-30/+30
| | | | | | | | "make syntax-check" was failing. This fixes it. * HACKING: Indent with spaces, not TABs. * configure.ac: Likewise. * rescue/virt-rescue: Likewise. * src/generator.ml: Likewise.
* Prepare for 1.0.72.1.0.72Richard Jones2009-09-233-710/+730
| | | | Also update PO files.
* More HTMLFILES.Richard Jones2009-09-231-0/+2
|
* Include virt tools in EXTRA_DIST.Richard Jones2009-09-235-5/+10
| | | | | | Partially revert b488436cc54288fcae8988493749f2e6c87f274c. It turns out that automake doesn't automatically place bin_SCRIPTS in EXTRA_DIST.
* Rename virt-[tool].pl as virt-[tool]Richard Jones2009-09-2312-46/+32
|
* Check return value from readlink.Richard Jones2009-09-235-5/+5
|
* Create manpage atomically.Richard Jones2009-09-235-5/+5
| | | | Don't fail with a partial file if disk full, etc.
* Replace @...@ with $(...) in these common Makefile.am files.Richard Jones2009-09-235-20/+20
|
* guestfish: Update 'SEE ALSO' section of the manpage.Richard Jones2009-09-231-1/+4
|
* New tool: virt-editRichard Jones2009-09-239-3/+329
| | | | | | | | | | | | | Edit any file in a guest. This was possibly previously using guestfish, but having a separate command makes it simpler. The usage is simply: virt-edit mydomain /some/file It runs $EDITOR or vi on the file, and if the user changes it, uploads the result back to the VM.
* virt-cat: Remove some unused Perl module includes.Richard Jones2009-09-231-3/+0
|
* Add 'virt-rescue' command.Richard Jones2009-09-2310-1/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command runs a "rescue appliance" against a virtual machine or disk image. This is useful for making ad-hoc interactive changes to virtual machines. $ virt-rescue --ro /dev/vg_trick/F11x64 Welcome to virt-rescue, the libguestfs rescue shell. Note: The contents of / are the rescue appliance. You have to mount the guest's partitions under /sysroot before you will be able to examine them. bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell ><rescue> mount /dev/vg_f11x64/lv_root /sysroot EXT4-fs (dm-0): barriers enabled kjournald2 starting: pid 269, dev dm-0:8, commit interval 5 seconds EXT4-fs (dm-0): internal journal on dm-0:8 EXT4-fs (dm-0): delayed allocation enabled EXT4-fs: file extents enabled EXT4-fs: mballoc enabled EXT4-fs (dm-0): mounted filesystem with ordered data mode ><rescue> ls /sysroot/ bin dev home lib64 media opt root selinux sys usr boot etc lib lost+found mnt proc sbin srv tmp var ><rescue> exit
* Add direct appliance mode flag and implementation.Richard Jones2009-09-232-33/+94
| | | | | | | | When the g->direct flag is set, the appliance stdin/stdout are not connected to the library. Instead they inherit the stdin/stdout of the caller. This is used to implement virt-rescue.
* Tidy up appliance rescue code.Richard Jones2009-09-231-3/+7
| | | | | The appliance shouldn't run the daemon after we leave the rescue shell. It should just exit instead.
* Rejig configure.ac tests for qemu vmchannel support.Richard Jones2009-09-231-11/+32
| | | | | | | | | | | vmchannel is no longer required, so we shouldn't test for it. However we should test instead for user mode networking support. Also fix up the documentation / error messages. Always test for vmchannel and user mode networking support in qemu. This gives us more troubleshooting information if people report bugs.
* Prepare for 1.0.71.1.0.71Richard Jones2009-09-224-218/+212
| | | | | | Update version number and update PO files. Put latest version and release date on the website front page.
* Change handling of spaces on Linux kernel command line.Richard Jones2009-09-221-8/+8
|
* Update documentation of qemu / vmchannel.Richard Jones2009-09-221-10/+29
|
* Implement "null vmchannel" - no vmchannel needed!Richard Jones2009-09-221-64/+297
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes the requirement for vmchannel, although retaining support for it. In this configuration, known as "null vmchannel", the library listens on a random loopback port. It passes the number of this port to the appliance (guestfs_vmchannel=tcp:10.0.2.2:12345), and the daemon then connects back. The library, instead of connecting, listens and accepts the connection during guestfs_launch. QEMU SLIRP (user mode networking) is still required to make this work: SLIRP forwards the TCP connection transparently (instead of explicitly as with guestfwd) to 127.0.0.1:<port> There is a window in which any other local process on the machine could see the port number in the qemu command line and try to connect to it. This would be a devastating security hole, because any local process could pretend to be the daemon and feed back malicious replies to our remote procedure calls. To prevent this, we check the UID of the other side of the TCP connection. If the UID is different from the library's EUID, then we reject the connection. To do this we have to parse /proc/net/tcp. (On Solaris we could use getsockopt (SO_PEERCRED), but this doesn't work on Linux TCP sockets). Other vmchannel(s) are still supported. This is important, because we can't in general be sure the qemu will always support SLIRP. In particular, in recent versions of qemu it is possible to compile out SLIRP.
* Gnulib: Add arpa-inet and netinet-in modules.Richard Jones2009-09-222-0/+6
|
* Flexible guestfs_vmchannel parameter for future appliances.Richard Jones2009-09-222-34/+141
| | | | | | | | | | | | | | | | | | | | | | This reimplements parts of commit da0a4f8d1f6ddd302ceba028d87c6e009589e503 in a different, but compatible way. We pass guestfs_vmchannel=tcp:<ip>:<port> on the command line. This is intended to be used as follows (now and in future versions): tcp:10.0.2.4:6666 for guestfwd vmchannel tcp:10.0.2.2:<port> for future "no vmchannel" implementation /dev/vcon4 for future virtio-console vmchannel* It also accepts the old-style guestfs=10.0.2.4:6666 parameter which is sent by older libraries, and turns this transparently into the correct format above. If no guestfs_vmchannel is passed, then this defaults to the guestfwd vmchannel which older libraries would expect. * Maybe this last one should be dev:/dev/vcon4 or file:/dev/vcon4, but we don't need to decide that now.
* Rearrange and tidy up code in guestfsd.cRichard Jones2009-09-221-30/+74
| | | | | | | | | | | | | | | This just tidies up the main() function in the daemon. There is no longer a huge fixed-sized buffer used for the kernel command line. Variables are moved closer to where they are used. Some local variables turned out to be unused - these are removed. Finally the part that reads the kernel command line is moved into a separate function. There is only minimal functional change here (it now prints out the kernel command line). Literal '4' replaced with 'sizeof' expression, at Jim Meyering's suggestion during patch review.
* Make GUESTFWD_PORT into a string.Richard Jones2009-09-211-4/+4
|
* Remove unnecessary extra space from qemu command line.Richard Jones2009-09-211-1/+1
|
* Remove guestfs_wait_ready (turn it into a no-op).Richard Jones2009-09-2128-105/+56
| | | | | | | | | | | | | | This commit changes guestfs_launch so that it both launches the appliance and waits until it is ready (ie. the daemon communicates back to us). Since we removed the pretence that we could implement a low-level asynchronous API, the need to call launch() followed by wait_ready() has looked a bit silly. Now guestfs_wait_ready() is basically a no-op. It is left in the API for backwards compatibility. Any calls to guestfs_wait_ready() can be removed from client code.
* Combine temporary buffers.Richard Jones2009-09-211-7/+5
| | | | | | | buf[], append[] and memsize_str[] were all temporary buffers used in non-overlapping code. Combine them to use a single buffer (buf[]).
* Rearrange qemu command line order (no functional change).Richard Jones2009-09-211-29/+30
|
* Enable new-style -chardev ... guestfwd command line.Richard Jones2009-09-181-20/+26
| | | | | | | | | | | | Newer versions of qemu have changed the command line format (again). '-net channel' is now deprecated. Instead we use: -chardev socket,id=guestfsvmc,path=/path/to/sock,server,nowait -net user,vlan=0,net=10.0.2.0/8,guestfwd=tcp:10.0.2.4:6666-chardev:guestfsvmc -net nic,model=ne2k_pci,vlan=0 The old style format is still used if the new style is not detected at runtime.
* Fix code which looked for leaked FDs between each command.Richard Jones2009-09-172-5/+6
| | | | | | This code was not checking the return value from system() so it failed if uncommented. Add ignore_value() around the call to system. However, leave the code still disabled.
* Remove explicit guestfs=10.0.2.4:6666 kernel command line parameter.Richard Jones2009-09-172-63/+25
| | | | | | | | | | Since we control the appliance tightly, we can just specify that it will always use a particular host and port, and we don't need to pass it on the command line each time. Also the VMCHANNEL_* constants are only relevant to the particular guestfwd vmchannel implementation, so we rename them as GUESTFWD_*.
* Daemon: fix handling of errors from xread and xwrite.Richard Jones2009-09-173-10/+17
| | | | | | If xread or xwrite returns -1, that indicates an error and we should exit. Note that xread/xwrite has already printed the error message.
* Fix verbose packet dumping functions.Richard Jones2009-09-174-10/+26
| | | | | | | | | | Add the configure parameter --enable-packet-dump so that this code can be enabled without editing the source. This code is normally commented out, because it is too verbose unless you happen to be debugging the underlying protocol. Because it is normally commented out, I found it had bit-rotted slightly. This commit also fixes the obvious problems.
* 'len' should be an unsigned 32 bit int.Richard Jones2009-09-171-1/+1
| | | | | This only happened to work by accident before because 'unsigned len' happens to be 32 bit on all platforms we support.
* Disable -Wunsafe-loop-optimizationsRichard Jones2009-09-171-0/+2
| | | | | | This warning indicates that GCC could not do a particular sort of loop optimization. It pops up randomly in certain forms of looping code, and seems safe to ignore.
* Update PO files (no functional change).Richard Jones2009-09-152-3/+3
|
* Prepare for version 1.0.70.1.0.70Richard Jones2009-09-151-1/+1
|
* Update PO files.Richard Jones2009-09-152-5/+5
|
* Set minimum gettext version to 0.17.Richard Jones2009-09-151-1/+1
| | | | | | | | | | | | | | This fixes the problem that the 1.0.69 tarball would fail in the po/ subdirectory when installing: make[1]: Entering directory `/builddir/build/BUILD/libguestfs-1.0.69/po' /bin/sh @MKINSTALLDIRS@ /builddir/build/BUILDROOT/libguestfs-1.0.69-1.fc11.x86_64/usr/share /bin/sh: @MKINSTALLDIRS@: No such file or directory make[1]: Leaving directory `/builddir/build/BUILD/libguestfs-1.0.69/po' RHEL 5.3 has gettext 0.14.6. However the tarball will still build (since it includes all the required code). This may cause a problem if RHEL users want to build from the git repository.
* Fix comparison between signed and unsigned (for RHEL 5).1.0.69Richard Jones2009-09-151-1/+1
|
* Move decl out for C99 compliance.Richard Jones2009-09-141-1/+3
|
* Update PO files.Richard Jones2009-09-142-1081/+1000
|
* Move guestfs-internal-actions.h to EXTRA_DIST.Richard Jones2009-09-141-2/+2
|
* Prepare for 1.0.69.Richard Jones2009-09-141-1/+1
|
* Remove main loop.Richard Jones2009-09-144-1224/+552
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes the external main loop, which never worked and caused a number of bugs. Requests are now done synchronously, and if the user wants to have requests issued in the background or to have a responsive GUI, then they'll just have to use threads. The big change is to push all reads and writes through two functions called send_to_daemon (for writes) and recv_from_daemon (for reads) which operate synchronously. These functions read/write whole messages, and also handle checking for EOF (ie. daemon died) and asynchronous log message events from qemu (eg. from debug / dmesg printed by the guest). A more complete description of how these work can be found in the code. This code passes a complete run of the tests. Bugs believed to be fixed by this commit: https://bugzilla.redhat.com/show_bug.cgi?id=501888 internal error: reply callback called twice https://bugzilla.redhat.com/show_bug.cgi?id=504418 In virt-inspector: "download: guestfs_download reply failed, see earlier error messages" I have tried to avoid reintroducing this: https://bugzilla.redhat.com/show_bug.cgi?id=508713 libguestfs: error: write: Broken pipe (guestfish only) One other benefit of this is that 'set_busy/end_busy' calls no longer appear in traces.