Commit Graph

5137 Commits

Author SHA1 Message Date
Richard W.M. Jones
0b285cd8a6 docs: Update documentation on attach-methods.
Add better instructions for getting the default attach-method.

Update libguestfs-test-tool(1) to show how to enable and disable
libvirt.
2013-03-12 13:19:26 +00:00
Richard W.M. Jones
6e4f9be492 php: Pass all libvirt environment variables down to PHP test scripts.
Including LIBVIRTD_* and VIRTLOCKD_*.

This updates commit cd40cf7139.
2013-03-12 12:35:17 +00:00
Richard W.M. Jones
49622ab63b Version 1.21.19. 1.21.19 2013-03-11 23:03:38 +00:00
Richard W.M. Jones
5e5026b730 qemu-img info: Use --output json and YAJL (JSON parser) to safely parse output (RHBZ#920225).
The old parser is still used if either YAJL is not available or
qemu-img info doesn't support the --output json option.
2013-03-11 19:10:04 +00:00
Richard W.M. Jones
2f8960f784 qemu-img info: Prefix parsing functions as old_parser_*.
Prefix functions in this file with old_parser_... to make it clear
this is the old / slightly unsafe human output parser, which is
shortly to be replaced by a safer JSON parser.

This is just code motion.
2013-03-11 16:27:13 +00:00
Richard W.M. Jones
cd40cf7139 php: Fix tests.
- Use ./run script to run the tests.
- Set environment variables correctly, including $PATH.
- Test the locally built, not installed, copy of libguestfs.
2013-03-11 16:04:17 +00:00
Richard W.M. Jones
becc4fecf4 php: Revise README-PHP documentation. 2013-03-11 14:29:13 +00:00
Richard W.M. Jones
c64e99782f docs: Note that $PATH affects libguestfs.
If $PATH is not set, libguestfs and/or libvirt tend to break.
2013-03-11 14:28:40 +00:00
Richard W.M. Jones
350c478d7b launch: libvirt: Unset $PATH can cause libvirt launch to fail.
Note this fact in the error message that is printed in this situation.
2013-03-11 14:27:56 +00:00
Richard W.M. Jones
02159e9aa8 launch: libvirt: Print proper dotted libvirt version. 2013-03-11 14:05:33 +00:00
Richard W.M. Jones
fe3798f366 php: Print libguestfs error string if test fails. 2013-03-11 13:44:50 +00:00
Richard W.M. Jones
d44752a110 php: Fix test, /dev/null format must be "raw". 2013-03-11 13:44:33 +00:00
Richard W.M. Jones
7a968beb46 lib: Give values for each state in 'enum state'.
The values of CONFIG, LAUNCHING and READY and (kind of) exposed
through the API so shouldn't change.

Use a bad sentinel for NO_HANDLE since that indicates a serious error.
2013-03-11 12:34:22 +00:00
Richard W.M. Jones
99e5ffd1de lib: Add comment for libguestfs handle. 2013-03-11 12:32:30 +00:00
Richard W.M. Jones
d9efcfb556 RHEL 5: tests/xml: Define O_CLOEXEC in LD_PRELOAD library. 2013-03-11 11:04:38 +00:00
Richard W.M. Jones
1b5b397da8 RHEL 5: tests: Use gnulib.
Gnulib defines O_CLOEXEC which is missing on RHEL 5.
2013-03-10 20:08:59 +00:00
Richard W.M. Jones
d16bb6b70c RHEL 5: Replacement for 'Unix.isatty stdout' for old OCaml versions.
Unix.isatty missing on RHEL 5-era OCaml 3.09.3.
2013-03-09 22:32:30 +00:00
Richard W.M. Jones
e73944faf4 RHEL 5: gnulib: Use module mkstemps.
RHEL 5 glibc doesn't have this function.
2013-03-09 18:53:51 +00:00
Richard W.M. Jones
bb0617859f RHEL 5: inspect: Add macro for be32toh if one is not defined in the header files. 2013-03-09 18:53:51 +00:00
Richard W.M. Jones
74297e6109 Add suppression for memory leak in libmagic. 2013-03-08 17:03:37 +00:00
Richard W.M. Jones
52c3edd5e0 filearch: Use a more logical way to construct the cpio command. 2013-03-08 14:02:19 +00:00
Richard W.M. Jones
801487f2a7 filearch: Don't print errno if cpio command fails, print command status instead.
errno is meaningless here.
2013-03-08 13:51:18 +00:00
Richard W.M. Jones
22d82d00b4 generator: Small fix for OCaml 3.12.1.
OCaml 3.12.1 (unlike 4.00.1) doesn't let you use printf formatters
in this way:

  printf (if foo then "&%s" else "%s") str
2013-03-08 13:17:45 +00:00
Hilko Bengen
0ee24ccf8a Move Ruby-related checks from autoconf to extconf.rb; add extra check for rb_alloc_func_t
Ruby ships its own config.h which may or may not define the same
relevant constants as our autoconf-generated config.h. Instead of
trying to specify the exact path to the wanted header file we may just
as well simply use Ruby's autoconf-inspired checks and macros.
2013-03-08 12:47:24 +00:00
Richard W.M. Jones
3a895ba794 df/parallel.c: Fix if libvirt is not available at compile time. 2013-03-07 23:29:21 +00:00
Richard W.M. Jones
ef33ea359d Version 1.21.18. 1.21.18 2013-03-07 21:53:16 +00:00
Hilko Bengen
6557d0c082 out-of-tree build: Fix link creation 2013-03-07 21:26:05 +00:00
Hilko Bengen
a568dec4cf Still build the libguestfs-specific parts when --disable-appliance is passed to configure 2013-03-07 21:26:03 +00:00
Hilko Bengen
43b37d02a1 out-of-tree build: Fix localized manpages 2013-03-07 21:17:30 +00:00
Hilko Bengen
0a50e64435 out-of-tree build: don't distribute extconf.rb.in template, use generated exconf.rb
Apparently, the file will only be autogenerated in $(builddir) if it
is not already present in $(srcdir).
2013-03-07 21:14:11 +00:00
Richard W.M. Jones
bb1f665d7f protocol: Handle log messages from connection layer centrally.
Previously described as a "gross hack and massive layering violation".
2013-03-07 18:23:45 +00:00
Richard W.M. Jones
ed41fcd75c protocol: Abstract out socket operations from protocol code.
This creates an abstract layer below the protocol code which handles
the socket operations.  This will make it easier to introduce libvirt
virSocketPtr operations in future.

In the handle, g->conn contains the connection to the appliance.
g->conn is NULL when we're not connected.

poll(2) is used instead of select(2).

All error messages about launch failing or the appliance unexpectedly
dying are handled by two common error message functions, and these
contain a better explanation of what to do.
2013-03-07 18:15:09 +00:00
Richard W.M. Jones
06b39b8098 protocol: Remove message_summary code.
Produces lots of output, and not very helpful.
2013-03-07 16:29:12 +00:00
Richard W.M. Jones
2c8e7ba9b4 launch: unix: Set g->daemon_sock = -1 after closing it.
This ensures we don't accidentally use the closed fd.
2013-03-07 11:40:44 +00:00
Richard W.M. Jones
9ae639948a lib: Rename g->fd to console_sock and g->sock to daemon_sock.
This just renames the fields in the handle to more descriptive names.
There is no functional change.
2013-03-07 11:39:44 +00:00
Richard W.M. Jones
f9381847f1 launch: appliance: Set FD_CLOEXEC flag on console socket.
The earlier (pipe-based) code never set this flag, but that was a bug,
potentially allowing the file descriptor to be leaked to subprocesses.

Set the FD_CLOEXEC flag, but also ensure it is cleared in the child
process just before qemu is exec'd (otherwise qemu would not have a
console).
2013-03-07 11:12:04 +00:00
Richard W.M. Jones
6e7cbb09a9 launch: appliance: Use socketpair instead of pipe for qemu stdin/stdout.
The libvirt backend already uses a Unix socket for the appliance
console, and so for the libvirt backend the fields g->fd[0] == g->fd[1].

Change the appliance backend to use a socketpair, so we need just a
single file descriptor for qemu stdin/stdout (ie. appliance console).

Consequently we can remove the array int fd[2] in the handle and
replace it with a single file descriptor.
2013-03-07 09:50:36 +00:00
Richard W.M. Jones
8136ca3719 proto: send_to_daemon is not an exported function.
This function is only used inside src/proto.c, so rename
it from guestfs___send_to_daemon to just send_to_daemon.
2013-03-06 21:13:14 +00:00
Richard W.M. Jones
7de25c2bca valgrind: Add suppression for memory leak found in libselinux. 2013-03-06 14:39:07 +00:00
Richard W.M. Jones
c44c5ee268 debug: Add command to generate lots of debug messages. 2013-03-06 11:18:14 +00:00
Richard W.M. Jones
ba08a51094 launch: libvirt: When debugging, print permissions of appliance and sockets.
When debugging is enabled, this prints out the permissions (ie.
ls -laZ) of the appliance and sockets directories.  This should be
helpful for debugging RHBZ#913774.
2013-03-05 17:03:21 +00:00
Richard W.M. Jones
59f01c4a70 launch: libvirt: Rename 'is_root' as 'current_proc_is_root', and documentation. 2013-03-05 16:49:46 +00:00
Richard W.M. Jones
ed354e8f8b launch: libvirt: When root, set socket permissions to 0660 (vs 0775).
Since qemu connects to both, there was no point at all in having these
sockets be readable by other, nor executable by anyone.

The sockets should now end up as:

  srw-rw---- root.qemu
2013-03-05 16:49:46 +00:00
Richard W.M. Jones
a4a2a181c2 fuse: tests: Set FD_CLOEXEC flag on file descriptor.
This is not required here, but it helps if the test code matches what
the documentations says you should do.
2013-03-05 15:26:41 +00:00
Richard W.M. Jones
f7789acdab Version 1.21.17. 1.21.17 2013-03-05 14:47:10 +00:00
Richard W.M. Jones
6039689344 guestmount: Add --no-fork flag.
This prevent guestmount from daemonizing.
2013-03-05 14:40:27 +00:00
Richard W.M. Jones
0120a087f4 Add guestunmount.1.html to the website.
This fixes commit 3e9e40aee3.
2013-03-05 14:05:35 +00:00
Richard W.M. Jones
3e9e40aee3 fuse: Add guestunmount program to handle unmounting (RHBZ#916780). 2013-03-05 13:12:25 +00:00
Richard W.M. Jones
09442d0588 fuse: guestfs_umount_local is not thread-safe.
Despite what the documentation may have said, it certainly was not
safe to call guestfs_umount_local from another thread.

guestfs_umount_local could generate events, call the error handler, or
access other fields in the handle, with no locking at all.

We should aim to make guestfs_umount_local thread-safe in future.

See also:
https://bugzilla.redhat.com/show_bug.cgi?id=917706
2013-03-04 15:31:41 +00:00
Richard W.M. Jones
d08f5ebd9a generator: Generate guestfs_user_cancel.
This function is now generated, so bindings in various languages
are made automatically.

Note that the function previously returned void, but now it returns
int (although always 0).  We don't believe that this is an ABI break
since existing programs will continue to work.
2013-03-04 15:24:26 +00:00