Commit Graph

4855 Commits

Author SHA1 Message Date
Richard W.M. Jones
3e7dcc384a haskell: Enable RString, RConstString in generator. 2012-12-28 20:11:23 +00:00
Richard W.M. Jones
beebade874 haskell: Enable RBool in generator. 2012-12-28 19:59:31 +00:00
Richard W.M. Jones
11e111ec01 haskell: Replace deprecated INCLUDE directive.
The INCLUDE directive is obsolete.  You must now put the name of the
include file before the C function name.
2012-12-28 19:55:01 +00:00
Richard W.M. Jones
9ae248e03f arm: Recomment vexpress-a15 instead of vexpress-a9.
Neither works (because of lack of PCI) but A15 emulation is probably
better than A9 emulation.
2012-12-27 20:02:31 +00:00
Richard W.M. Jones
6c9aaf394f launch: appliance: Fix parsing of QEMU_OPTIONS.
If there was no quoting character, the options could run off the end
of the string and into whatever string which happened to be following
in memory.

This bug was revealed when libguestfs was compiled on arm.
2012-12-27 20:01:15 +00:00
Richard W.M. Jones
bcdaa46313 launch: appliance: Small refactoring of virtio-scsi detection code.
This is just code motion.
2012-12-27 19:36:33 +00:00
Richard W.M. Jones
a9d70d1ae4 Fix whitespace in configure.ac.
Standardize on 4 spaces for indentation in configure.ac file.
This is just a change of whitespace.
2012-12-27 18:55:34 +00:00
Richard W.M. Jones
364ee94b8d arm: Prevent -Wcast-align warnings.
See link below for a general description of the problem:

f8b62e4cd2
2012-12-27 18:08:55 +00:00
Richard W.M. Jones
5af94b5692 arm: Only use -device sga if qemu supports this device.
qemu-system-arm does not have the sgabios device.
2012-12-27 15:57:15 +00:00
Richard W.M. Jones
741c8606db lib: Remove useless cast.
'strings' is declared as char **, so the return type of
this expression will already be char *.  The cast is both
useless and potentially hides errors.
2012-12-27 15:27:20 +00:00
Richard W.M. Jones
4a877452f5 build: Fix ./configure --with-febootstrap-yum-config option.
This fixes commit bfddae7cee.

Also tested that all variants actually work.
2012-12-24 09:48:41 +00:00
Richard W.M. Jones
4b5d27869f Version 1.21.2. 1.21.2 2012-12-22 22:42:29 +00:00
Richard W.M. Jones
bfddae7cee build: Change --with-febootstrap-yum-config to --with-febootstrap-packager-config
For the rationale behind this renaming, see:
b8cbe191d0

You can still, for the time being, use
./configure --with-febootstrap-yum-config
but it's preferred to switch to the new option.  The new option is
identical, just renamed.

Qe still pass the deprecated --yum-config option to febootstrap
itself, since both old and new febootstrap support this.
2012-12-22 17:28:10 +00:00
Richard W.M. Jones
e73cf67762 inspection: Set fs->device field on swap devices.
For some reason the fs->device field was not set for swap devices.

Apparently this did not matter before (this bug has existed since at
least libguestfs 1.16), but in commit 6ee80b8dac we started to depend
on the fs->device field being non-NULL.  This resulted in segfaults
when inspecting any guest which had a swap device, eg:

 #0  __strcmp_sse42 () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:164
 #1  0x00007ffff7d740cb in parent_device_already_probed (g=0x703a70,
                        partition=0x6f79b0 "/dev/vda4") at inspect.c:156
 #2  0x00007ffff7d73e00 in guestfs__inspect_os (g=0x703a70) at inspect.c:83
 #3  0x00007ffff7cee11d in guestfs_inspect_os (g=0x703a70) at actions-1.c:397

This commit sets fs->device to the device name.

(Thanks Matthew Booth for first noticing this problem.)
2012-12-20 15:36:36 +00:00
Richard W.M. Jones
6628cc7ef6 Pass noapic on i686 kernel command line.
qemu 1.2 i686 TCG is buggy and hangs when emulating APIC.
https://bugzilla.redhat.com/show_bug.cgi?id=857026
2012-12-20 12:09:49 +00:00
Richard W.M. Jones
eca01c3105 faq: Suggest 'approx' (apt proxy) to speed up Debian builds.
Thanks Hilko Bengen.
2012-12-18 20:39:46 +00:00
Richard W.M. Jones
d1ad89520e tests: Skip windows.img tests if it is zero-sized.
If ntfs-3g is not installed, then tests/guests creates a 'windows.img'
file which is zero-sized.

This is problematical because other tests which use this image will
fail at best, or hit RHBZ#847549 (qemu/virtio-scsi bug) at worst.

Change the tests which use windows.img so they skip if 'windows.img'
has zero size.
2012-12-18 17:35:51 +00:00
Richard W.M. Jones
a34072e25b build: Add 'make print-subdirs' rule, useful for selectively running tests.
If you want to selectively run tests, or if the test suite fails half
way through, use:

  make print-subdirs

to print the subdirectories, select the ones you want to run / the
remaining ones, and do:

  make check SUBDIRS="..."
2012-12-18 16:28:23 +00:00
Richard W.M. Jones
fa162417ed daemon: Make gdisk into an optional dependency and optgroup.
Also document that gdisk is a dependency at all.

This fixes commit 956e30effa.
2012-12-18 11:52:41 +00:00
Richard W.M. Jones
2434a86da4 lua: tests: If $LUA is not set, set it to 'lua' instead of '/usr/bin/lua'. 2012-12-18 08:55:06 +00:00
Richard W.M. Jones
3f88f88c80 lua: Fix misapplied patch.
This fixes commit 5b70120293.
2012-12-18 08:53:34 +00:00
Richard W.M. Jones
8be9743e74 ruby: Disable -Wstrict-prototypes warning for Ruby headers. 2012-12-18 08:43:52 +00:00
Richard W.M. Jones
034d393bb1 docs: Properly document attach methods in the guestfs(3) man page. 2012-12-17 23:01:56 +00:00
Richard W.M. Jones
62f98d64a5 lua: Fix Lua configure test on Fedora.
On Debian, the lua pkg-config file is called "lua5.1.pc" (etc)
whereas on Fedora it's called "lua.pc" for all versions.
2012-12-17 23:01:56 +00:00
Hilko Bengen
5b70120293 lua: Use correct binary for tests 2012-12-17 22:24:53 +01:00
Hilko Bengen
f07e89c5f9 lua: Add ifdefs for Lua 5.2 compatibility 2012-12-17 22:24:53 +01:00
Hilko Bengen
05103cc693 lua: Use pkg-config to determine Lua version, parameters 2012-12-17 22:24:52 +01:00
Richard W.M. Jones
8237ac89c5 daemon: Use pvcreate --force option (RHBZ#887971).
pvcreate fails if the partition contains a swap space signature.  Use
more force to stop it from complaining.
2012-12-17 19:27:12 +00:00
Richard W.M. Jones
4ad6b28d83 Version 1.21.1. 1.21.1 2012-12-17 12:49:32 +00:00
Richard W.M. Jones
eab324bbbb list-filesystems: Ignore MBR type 0x42 (Windows dynamic disks) (RHBZ#887520). 2012-12-17 12:39:55 +00:00
Richard W.M. Jones
6f02e33c6f sparsify: Document that virt-sparsify doesn't work well on multi-disk VMs.
See: http://bugzilla.redhat.com/887826
2012-12-17 12:24:29 +00:00
Richard W.M. Jones
79339798b3 launch: libvirt: Improve loop invariant from previous commit.
This fixes commit 11b6293d1b.
2012-12-16 21:29:35 +00:00
Richard W.M. Jones
11b6293d1b launch: libvirt: Parse capabilities XML and fail early if qemu/KVM not supported (RHBZ#886915). 2012-12-16 20:56:39 +00:00
Richard W.M. Jones
c4ad2c0ce3 daemon: Fold stdout on stderr when running e2fsck.
User Phill Bandelow noted that virt-resize fails with an e2fsck error
on a host where the system clock had been accidentally set in the
past.

Unfortunately this was hard to diagnose because guestfsd 'ate' the
stdout of the e2fsck program.  I have verified by code inspection that
e2fsck prints messages on stdout.

Thus this changes the daemon to fold stdout and stderr together so we
get to see all error messages from e2fsck when it fails.
2012-12-16 18:38:41 +00:00
Richard W.M. Jones
22fe98ad9f build: Improve 'make help' output description of 'make extra-tests'. 2012-12-15 20:20:38 +00:00
Richard W.M. Jones
eca2dd2e8c build: Better formatting for 'make help' output.
This is just whitespace changes.
2012-12-15 20:15:12 +00:00
Richard W.M. Jones
486efb002a build: Show 'make -k check' as a possibility in 'make help' output.
Thanks to Cole Robinson for this suggestion.
2012-12-15 20:10:25 +00:00
Richard W.M. Jones
448a02373d ruby: Enable C compiler warnings.
This has the desirable side effect that the correct CFLAGS get passed
to the C compiler when building the Ruby extension.
2012-12-15 19:42:02 +00:00
Richard W.M. Jones
1571aef9cc python: Enable C compiler warnings. 2012-12-15 19:42:02 +00:00
Richard W.M. Jones
62e775c350 Change the handling of private functions, safe_malloc etc.
Rename guestfs_safe_malloc et al to guestfs___safe_malloc etc.

To use the private functions, code now has to define
-DGUESTFS_PRIVATE_FUNCTIONS=1.  This will make it easier for us in
future to work out which programs are using these functions and to
minimize both the number of programs and the functions they are
calling.

Note that the Perl, Python, OCaml, Ruby and Java bindings use
guestfs_safe_* calls.  None of the other bindings do.  This is a bug
(in the bindings using those functions): these functions will call the
out of memory callback on failure.  This function defaults to abort(),
and since this happens from a language binding, there is no way to
change this default.
2012-12-15 19:41:29 +00:00
Richard W.M. Jones
27f6878e2a guestfs.h: Fix use of __attribute__ and GCC < 4.
I guess no one uses GCC 3 any more, because if they did, including
<guestfs.h> would not work since GUESTFS_DLL_PUBLIC would not have
been defined.

At the same time, ensure that __attribute__((noreturn)) is only used
when the compiler is GCC >= 3.1.
2012-12-15 17:03:11 +00:00
Richard W.M. Jones
95df8a7c0c inspection: Don't call guestfs_hivex_close if previous guestfs_hivex_open call failed.
(Thanks Skippy VonDrake)
2012-12-14 22:04:25 +00:00
Matthew Booth
a9051eb98e daemon: Add sentinel attribute to commandf and commandrf
Causes a compiler warning to be emitted if you omit the trailing NULL argument.
2012-12-14 16:58:05 +00:00
Matthew Booth
956e30effa Add support for getting and setting GPT partition type GUIDs
New APIs:
  part_set_gpt_type
  part_get_gpt_type
2012-12-14 16:58:05 +00:00
Matthew Booth
2aa731e7c4 daemon: Remove redundant fork in commandrvf
Currently the code is doing a redundant fork when passed the
COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN flag. The additional
sub-process does a chroot() which has no effect because all file
handles are already open at that point, then simply copies its input
to its output.

This change simply replaces the above with a dup2 of the passed file
handle to STDIN of the command process.

RWMJ:
  Don't initialize 'pid' variable.
2012-12-14 16:21:58 +00:00
Richard W.M. Jones
d7a806ca1a configure: Change minor from .20 to .21 for new development branch. 2012-12-13 17:53:36 +00:00
Matthew Booth
e92f9666de daemon: NFC Use symbolic names in commandrvf
Improve readability of commandrvf() by replacing bare int values for
file descriptors with their symbolic names STD{IN,OUT,ERR}_FILENO.

Also add PIPE_READ and PIPE_WRITE for referencing relevant ends of a pipe.
2012-12-13 17:53:20 +00:00
Matthew Booth
52cd07a0ac daemon: fix directory outside current root when executing commands
When executing a command, we temporarily chroot, fork and exec the
command, then chroot back. We intentionally don't chdir in the parent
process so that we can 'jailbreak' the chroot later. However, this has
the effect that commands are executed with a current working directory
which is outside the current root.  This unusual state can cause
errors in executed commands which don't anticipate it.

This change does a chdir("/") before executing and command. This
happens inside the fork, so the jailbreak isn't affected in the
parent.
2012-12-13 17:15:01 +00:00
Richard W.M. Jones
f784c87859 Version 1.20.0. 1.21.0 1.20.0 2012-12-13 14:18:30 +00:00
Richard W.M. Jones
25652a6d5c proto: Free drives array when qemu subprocess dies abruptly.
Commit ed7fda161e changed the g->drives
linked list into an array, and also made a subtle change to the
(undocumented) semantics of drives in the rare case when qemu is
relaunched.

Every time we go back to the CONFIG state, we should free the drives
array.  However there was one place where this was not happening.
This was caught by the tests of the protocol, but only when using the
default (appliance) method, not the libvirt method which we were more
interested in testing in Fedora.

When testing on Debian using the appliance method, we therefore hit
this bug for the first time.

This relates to or fixes the following commits:
  commit 9df159b34a
  commit 33f49d85c2
  commit ed7fda161e
2012-12-13 11:50:08 +00:00