Commit Graph

7728 Commits

Author SHA1 Message Date
Pino Toscano
8b268bd897 generator: add a simple HTML escaping function 2015-02-11 15:02:56 +01:00
Pino Toscano
4905d6eb95 Revert "java: Turn off doclint to prevent errors on JDK 8"
The errors will be fixed for good, together will other small javadoc
improvements.

This reverts commit 8940b03658.
2015-02-11 15:02:56 +01:00
Margaret Lewicka
28462caacc macosx/bsd: Use getprogname() where available 2015-02-11 13:50:33 +00:00
Margaret Lewicka
8940b03658 java: Turn off doclint to prevent errors on JDK 8
On JDK 8, doclint is enabled by default with strict validation of HTML
tags, which causes the build to fail. See
http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
2015-02-11 13:49:47 +00:00
Pino Toscano
668c4784a9 perl: tests: reenable set_path tests
guestfs_set_path now does a copy of the passed string, so bindings don't
need to take care of the lifetime of strings parameters for it.
2015-02-09 11:00:47 +01:00
Richard W.M. Jones
5cafedaa45 lib: Change 'program_name' macro to avoid conflict with gnulib.
The gnulib 'error' module uses 'program_name'.  On some platforms --
but not Linux / glibc -- it references it as:

  extern char *program_name;

This means when you compile libguestfs on non-glibc (eg. Mac OS X)
gnulib requires 'program_name' as an external string reference, which
we don't provide.

This change doesn't define this string reference for gnulib, but it
does change the name of the macro we use to avoid conflicts if we
eventually need to export 'program_name' as a string.

Thanks: Margaret Lewicka
2015-02-07 16:30:28 +00:00
Margaret Lewicka
7ddf6bcbfd macosx: Include <sys/un.h> and define SOCK_* for Mac OS X. 2015-02-06 10:01:28 +00:00
Margaret Lewicka
eaae0b614c macosx: ruby: Use correct dllib extension instead of assuming '.so'. 2015-02-06 09:53:45 +00:00
Richard W.M. Jones
f630677c14 resize: Preserve GPT GUID so we don't break EFI bootloaders (RHBZ#1189284).
When copying disks that use EFI, we created a new partition table,
randomizing the GPT GUID of the first partition.  Since EFI may store
the GUID in its NVRAM variables, this could make the guest unbootable.
2015-02-05 08:19:19 +00:00
Richard W.M. Jones
40c133b2c8 New APIs: part-set-gpt-guid and part-get-gpt-guid
In GPT, each partition has a GUID assigned randomly.  Allow this GUID
to be written and read.

Note this is different from the GUID type code which is used to
identify the type of the partition.
2015-02-05 08:19:19 +00:00
Richard W.M. Jones
b3e3750b13 daemon: Fix whitespace. 2015-02-05 08:01:48 +00:00
Richard W.M. Jones
ff1cf989fd builder: Fix large performance regression in pxzcat (RHBZ#1188866).
Commit 9135129b0f changed
two stack buffers to pointers:

-  uint8_t buf[BUFFER_SIZE];
-  unsigned char outbuf[BUFFER_SIZE];
+  CLEANUP_FREE uint8_t *buf = NULL;
+  CLEANUP_FREE uint8_t *outbuf = NULL;

but we were still using sizeof buf to calculate the size of the
buffer.  sizeof buf == 8 so the original code which used large buffers
for reading/writing the file changed to using 8 byte buffers.
2015-02-04 13:17:40 +00:00
Cédric Bosdonnat
5f663c2082 customize: Invoke zypper correctly. 2015-02-03 14:38:02 +00:00
Richard W.M. Jones
8fd4231051 btrfs: Proper error when output of 'btrfs qgroup show' command cannot be parsed.
sscanf doesn't set errno in these cases so it's wrong to call perror
here.

This fixes commit 2b7f7810ed.
2015-02-03 08:53:43 +00:00
Richard W.M. Jones
725d95422b Version 1.29.24. 1.29.24 2015-02-02 20:01:45 +00:00
Pino Toscano
573fe962b9 customize: add copy-in operation (RHBZ#1135585).
Add the copy-in operation to virt-customize/builder/sysprep, so it is
possible to easily copy directories at once in the guest.
2015-02-02 18:55:10 +00:00
Pino Toscano
5efce8c56d fish: use copy-in and copy-out
Simply the copy-in & copy-out commands of guestfish using the new
implementations of copy-in & copy-out in the library.
2015-02-02 18:44:52 +00:00
Pino Toscano
fb9bc908f8 New APIs: copy-in and copy-out
Currently implemented as guestfish commands, provide them instead as
single source -> destination functions for the library, so they can be
used also in other places.

These functions are not added to guestfish, since guestfish has its own
implementation (which will soon switch to call copy-in and copy-out for
multiple paths).
2015-02-02 18:44:52 +00:00
Pino Toscano
8aadde50b3 generator: add VPublicNoFish visibility type
Usable to have public functions, i.e. like VPublic, but do not showing
them in guestfish.
2015-02-02 18:44:52 +00:00
Pino Toscano
db055262d4 cmd: add the possibility to get a fd to the process stdin
Add the possibility to forward to the stdin of the process, and get the
fd for it; only in async mode for now.
2015-02-02 18:44:52 +00:00
Pino Toscano
449fab3ed1 cmd: add a child-setup callback
Easy way to do pre-exec setup in the child process.
2015-02-02 18:44:52 +00:00
Pino Toscano
c5d3d198dc cmd: add a way to run (and wait) asynchronously commands 2015-02-02 18:44:52 +00:00
Pino Toscano
4bb3c44a28 sparsify: ignore read-only devices
In copy mode, make sure to not zero-free-space devices mounted as
read-only, as we cannot write to them.

Related to RHBZ#1079625.
2015-02-02 15:02:31 +01:00
Pino Toscano
864c2ee371 sparsify: ignore read-only btrfs snapshots (RHBZ#1079625)
In copy mode, make sure to not zero-free-space read-only btrfs
snapshots, as we cannot write to them.
2015-02-02 14:50:52 +01:00
Richard W.M. Jones
8d83f57799 sparsify: Ignore read-only LVs (RHBZ#1185561). 2015-02-02 13:32:24 +00:00
Richard W.M. Jones
7d784fb9c9 mllib: Add function for comparing LVM2 UUIDs, ignoring '-' characters. 2015-02-02 13:32:24 +00:00
Richard W.M. Jones
ab950f8290 mllib: Add a better List.assoc function.
You can specify what comparison function is used; and instead of
having it raise 'Not_found', it returns a ~default value.
2015-02-02 13:32:24 +00:00
Pino Toscano
83eea0b197 tests: don't add test-dlopen twice
test-dlopen needs to be added only when libdl is available, and it is
like that already (within if HAVE_LIBDL); hence don't unconditionally
add it as well.
2015-01-29 12:00:32 +01:00
Pino Toscano
e57ed7cd34 build: use libintl where needed
Followup of commit a5426cce5f.
2015-01-29 12:00:01 +01:00
Pino Toscano
2313f28895 daemon: parted: use --part-type with recent sfdisk
Check whether --part-type is supported (in the rewritten sfdisk in
util-linux >= 2.26), and use it instead of --print-id & --change-id.

The actual result should be the same, just not using a (recently)
deprecated command line API.
2015-01-28 15:34:49 +01:00
Richard W.M. Jones
6a195d0f95 v2v: -i ova: Make error message "unsupported file format" clearer.
Thanks: Moran Goldboim
2015-01-28 13:30:55 +00:00
Pino Toscano
282a131677 customize: handle Arg.Set parameters in commands file
When reading commands from a file, handle also Arg.Set parameters, so
they can be enabled as well.
2015-01-28 09:59:27 +01:00
Richard W.M. Jones
d0cecca272 Version 1.29.23. 1.29.23 2015-01-26 17:15:51 +00:00
Richard W.M. Jones
d6cfd24feb .gitignore: Ignore mllib/oUnit-anon.cache file from oUnit.
This updates commit d19eb31060.
2015-01-26 17:15:51 +00:00
Pino Toscano
d0a2ba40c8 mllib: fix JSON_tests
Properly write int64 values, so they are handled correctly also on 32bit
architectures.
2015-01-26 16:36:26 +01:00
Shahar Havivi
889e555168 v2v: -o vdsm should assume data domain at -os path
Unlike -o rhev which have only one data domin, -o vdsm can and usually
does have multiple data domain.
The path to vdsm is pre mounted so no need to assume nfs path with -os
Example:
-o vdsm -os /rhev/data-center/<data-center-uuid>/<data-domain-uuid>

Bug-Url: https://bugzilla.redhat.com/1176591
Signed-off-by: Shahar Havivi <shaharh@redhat.com>
2015-01-26 10:31:14 +00:00
Richard W.M. Jones
c24f242521 aarch64: Increase default appliance memory size on aarch64.
Kernel 3.19 has problems uncompressing the RAM disk with <= 500 MB.
(This is likely to be a kernel bug)

64 KB pages are common on aarch64, so treat this case the same as ppc,
and use a larger default appliance memory size.

Thanks: Laszlo Ersek for help and reproducing the bug.
2015-01-24 15:40:05 +00:00
Richard W.M. Jones
987273ebd0 launch: libvirt: When debugging the appliance dir, use 'ls -R'.
Since libguestfs >= 1.26 / supermin 5, the appliance has lived in a
subdirectory of $TMPDIR/.guestfs-$UID.  As a result using 'ls -l'
didn't display any information about the files in the appliance.

Using '-R' causes this information to be displayed again.
2015-01-24 08:47:00 +00:00
Richard W.M. Jones
f9c5b4aa2a launch: libvirt: In debug messages use ls --lcontext instead of ls -Z.
ls -Z stops ls from displaying the size field.  --lcontext uses longer
lines but has the advantage of still displaying the size field as well
as the SELinux context.
2015-01-24 08:45:48 +00:00
Richard W.M. Jones
b6cd5c3a2b p2v: Add NetworkManager in the hope of getting working network.
I know "working network" and "NetworkManager" are oxymorons, but
sometimes we have to live in hope.
2015-01-23 15:34:51 +00:00
Richard W.M. Jones
9638b13ba0 p2v: Set root password of virt-p2v ISO to 'p2v'.
It is documented as 'p2v', but in fact this was not implemented
so there is no way to log in as root on the console.

On RHEL we also have to add the 'passwd' package, else you get:

  Error creating Live CD : Unable to set unencrypted password due to lack of /usr/bin/passwd
2015-01-23 15:34:51 +00:00
Pino Toscano
515c3e3e73 mllib: do not show --short-options among the long options
--long-options is ignored because it is only meant as aid for shell
completers, so --short-options should be too for the same reason.
2015-01-23 14:15:09 +01:00
Pino Toscano
6bc9976886 mllib: add simple tests for the JSON module 2015-01-23 11:23:35 +01:00
Pino Toscano
6f14cae1ba mllib: tests: add tests for string_lines_split 2015-01-23 11:08:27 +01:00
Pino Toscano
d19eb31060 mllib: convert common_utils_tests to oUnit
Covert common_utils_tests to use oUnit as testing framework, replacing
the hand-made assert in favour of structured unit tests and better
error reporting.

common_utils_tests is now built only when the oUnit module has been
found.
2015-01-23 10:57:23 +01:00
Pino Toscano
1f5e525533 configure: look for the oUnit OCaml module
It will be used for the OCaml unit tests.
2015-01-23 10:57:23 +01:00
Pino Toscano
eda4126868 customize: add --commands-from-file
Pass to --commands-from-file the name of a file containing customization
commands in each line, as if they were specified as command line
arguments.

This eases the reuse of commands among different
builder/customize/sysprep invocations.
2015-01-22 17:07:02 +01:00
Pino Toscano
09f76fd2a9 mllib: add string_lines_split
Introduce an helper function to split a text into lines, keeping into
accout continuation lines (i.e. with \ at the end).
2015-01-22 17:06:56 +01:00
Richard W.M. Jones
145db4f629 test: fuse: Add debugging of commands run in the test. 2015-01-22 10:44:32 +00:00
Richard W.M. Jones
34b118a25a Version 1.29.22. 1.29.22 2015-01-21 20:45:17 +00:00