Commit Graph

9359 Commits

Author SHA1 Message Date
Maxim Perevedentsev
f90185dfdf lvm: modify guestfs_is_lv to take mountable
Calling guestfs_is_lv on btrfs subvolume throws an error.
Here we workaround it by taking Mountable instead of Device
and returning 'false' for non-device mountables.
2016-07-08 13:21:42 +01:00
Maxim Perevedentsev
d6bba9bc42 mllib: add checking for btrfs subvolume
This is needed to skip btrfs subvolumes from output
of list_filesystems where device is needed.
2016-07-08 13:21:42 +01:00
Matteo Cafasso
abf85b050e filesystem_walk: more information into tsk_dirent
Access, modification, last status change and creation time in
Unix format as for statns.

Number of links pointing to a given entry.

If the entry is a symbolic link, report the its target path.

A new flag (DIRENT_COMPRESSED 0x04) indicating whether the file is
compressed using native filesystem compression support.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-07-08 12:08:17 +02:00
Richard W.M. Jones
123dc018b8 mllib: Rename unshift -> push_front, push -> push_back etc.
The C++ function names are more regular.

Updates commit 1c57c71d46.
2016-07-08 09:56:47 +01:00
Richard W.M. Jones
1a3e986b61 builder: Add Fedora 24 (aarch64) image. 2016-07-07 20:36:42 +01:00
Richard W.M. Jones
7d99c2eb84 builder: downloader: More tweaks to curl code.
No functional change.
2016-07-07 18:22:09 +01:00
Richard W.M. Jones
560156d899 v2v: Use imperative list functions to simplify DOM building code. 2016-07-07 18:13:07 +01:00
Richard W.M. Jones
6a3416361b v2v: Don't open DOM module in output_rhev and output_vdsm.
I think this is left over from before we moved the OVF code
out to its own module.
2016-07-07 18:13:07 +01:00
Richard W.M. Jones
442092a305 Replace 'xs := x :: !xs' with 'unshift x xs'.
In one case, I used prepend instead.
2016-07-07 18:13:07 +01:00
Richard W.M. Jones
e84382e9f8 builder, v2v: Use imperative list functions to simplify curl arg code.
No functional change in this commit.
2016-07-07 18:13:07 +01:00
Richard W.M. Jones
1c57c71d46 mllib: Add some imperative list manipulation functions.
This adds imperative list manipulation functions inspired by Perl.
The functions are passed list refs which get updated in place.

This allows us to replace some awkward pure functional code like:

  let xs = ys in
  let xs = if foo then xs @ zs else xs in

with:

  let xs = ref ys in
  if foo then append xs zs;
2016-07-07 18:13:07 +01:00
Richard W.M. Jones
906c05c70f builder: Use the new Curl module for passing parameters to curl.
These are now passed using a curl configuration file, which is a
little bit safer than using command lines.  virt-builder doesn't need
to pass usernames and passwords to curl, but if it ever does in future
this will be a lot safer.
2016-07-07 18:13:07 +01:00
Richard W.M. Jones
20509df94e curl: Change the API to use an abstract data type.
Change the Curl module to use an ADT to store the name of the curl
binary and the arguments.

The callers in virt-v2v are changed accordingly.

This also adds a (currently unused) ?proxy argument to allow callers
to override the proxy.  It also adds some safety arguments implicitly.
2016-07-07 18:13:07 +01:00
Richard W.M. Jones
10e096c063 v2v: Move Curl wrapper to mllib.
Just code motion, no change.
2016-07-07 18:13:07 +01:00
Richard W.M. Jones
b35819d990 v2v: changeuid: Improve error messages. 2016-07-07 18:13:07 +01:00
Pino Toscano
9fa8e07465 daemon: fix cleanup of stringsbuf usages
Declare most of the stringsbuf as CLEANUP_FREE_STRINGSBUF, so they are
freed completely on stack unwind: use take_stringsbuf() in return
places to take away from the stringsbuf its content, and remove all the
manual calls to free_stringslen (no more needed now).
This requires to not use free_stringslen anymore on failure in the
helper functions of stringsbuf, which now leave the content as-is (might
be still useful even on error).

This allows us to simplify the memory management of stringsbuf's, which
are not properly fully freed, fixing memory leaks in some error paths
(which were not calling free_stringslen).
2016-07-07 16:28:18 +02:00
Pino Toscano
6a06b87559 daemon: free the string on stringsbuf add failure
If add_string_nodup fails free the passed string instead of leaking it,
as that string would have been owned by the stringbuf.

Adapt few places to this behaviour.
2016-07-07 16:27:36 +02:00
Richard W.M. Jones
d061b67410 Version 1.33.41. v1.33.41 2016-07-06 14:57:06 +01:00
Richard W.M. Jones
70faafddba v2v: Fix documentation, [--in-place] -> I<--in-place>.
Fixes commit 9221ef6f79.
2016-07-06 13:05:05 +01:00
Richard W.M. Jones
9cf220e73e inspection: Find icon in Windows 7 64 bit guests (RHBZ#1352761).
We have to download the old 32 bit explorer.exe in order to find the
icons as the 64 bit version doesn't contain any icons (where are they?).
Thus prefer the 32 bit (WoW64 subsystem) directory if found.

Fixes commit 7f16c346bb.

Thanks: Xiaoyun Hu
2016-07-06 13:05:05 +01:00
Richard W.M. Jones
4e806c4bd2 inspection: Find Ubuntu logo from an alternate location (RHBZ#1352761).
The current location doesn't exist unless you've installed GNOME,
which is not so common on Ubuntu.  Unfortunately I couldn't find any
other location containing a clean, high quality logo.

This adds another low quality icon source, and also prevents any icon
being returned if the highquality flag was set (note this prevents
virt-manager from displaying an icon, but there's nothing we can do
about that, and it's no worse than the current situation).

Updates commit 1d0683964f.

Thanks: Xiaoyun Hu
2016-07-05 14:01:33 +01:00
Richard W.M. Jones
d6744dac60 p2v: Remove p2v.debug option from test command lines.
Fixes commit 0c04919f50.
2016-07-02 10:16:55 +01:00
Richard W.M. Jones
0c04919f50 p2v: Remove the Enable debugging option, -v, p2v.debug.
This is now enabled by default and cannot be changed/disabled by the
user.  The output is saved into /tmp/.../virt-v2v-conversion-log.txt
on the conversion server.
2016-07-02 10:01:09 +01:00
Pino Toscano
88be0a237f v2v: fix priority of match in configure_kernel_modules
This makes sure that in the internal configure_kernel_modules function,
for virtio or SCSI block types:
a) the warnings about leftover Xen modules are printed
b) the changes in Augeas are saved

Fixes commit ee02191483.
2016-07-01 18:13:01 +02:00
Pino Toscano
d4dfa47158 v2v: fix and implify the internal Convert_linux:discover_modpath
First check for the existence of the directory /etc/modprobe.d, in case
using a file under it; this also skips all the other checks, since they
are not needed at all.  Also /etc/modprobe.d exists on recent Linux
versions, so let's give priority to the more common methods.
When /etc/modprobe.d does not exist, check for the file to edit using a
single list of possible files, now in order of priority, where the first
find is used without checking further for the rest.

Also, make sure all the returned paths are absolute: they are used in
Augeas paths later on, so relative paths will not do anything useful.
2016-07-01 18:13:01 +02:00
Pino Toscano
026992d58d docs: fix link to csvtool
Refer to the new home of the OCaml csv module.

Thanks to: Yehuda Zimmerman.
2016-07-01 15:49:17 +02:00
Richard W.M. Jones
30b728bc3b Version 1.33.40. v1.33.40 2016-07-01 12:22:05 +01:00
Richard W.M. Jones
87131d8681 p2v: Send ^C to remote end to cancel the conversion.
We are now able to cancel the conversion instantly by sending ^C to
the remote virt-v2v process.

Also, this reverts:
"p2v: Poll to make Cancel Conversion button more responsive."
(commit 6da4941db7)
2016-06-30 14:38:20 +01:00
Richard W.M. Jones
fa6402a0f8 p2v: ssh: Set cooked mode on the ssh session which runs virt-v2v. 2016-06-30 14:38:20 +01:00
Richard W.M. Jones
6d9bac80b2 p2v: Use 'scp' to copy the files to remote debugging directory.
Previously we copied / creates files in the remote dir by running
complex shell commands like:

  cat > file <<'EOF'
    ## the file was copied in here
  EOF

This was a little hairy, but in particular it doesn't allow us to set
the ssh session to cooked mode (so we can send ^C to cancel a
conversion).

A cleaner way to do it is to use 'scp' to copy the files over.
2016-06-30 14:38:20 +01:00
Richard W.M. Jones
c2fab43dd6 p2v: Set an SSH error message if mexp_spawnv fails. 2016-06-30 13:53:31 +01:00
Richard W.M. Jones
9445a4da17 p2v: miniexpect: Add mexp_send_interrupt, mexp_spawnvf, mexp_spawnlf and various flags. 2016-06-29 21:21:40 +01:00
Richard W.M. Jones
3390df44d3 miniexpect: Set signals to defaults and close other file descriptors after forking. 2016-06-29 15:22:29 +01:00
Richard W.M. Jones
b15b6e69e3 p2v: Colourize kernel-conversion status messages from virt-p2v.
The messages that come "through" from virt-v2v are already colourized.
However the other messages are not.  This colourizes the ones
generated during kernel-mode conversions.

Note that because of the way journal/syslog works we have to write the
ansi_restore before the end of line, thus code like this:

 ansi_magenta (stdout);
 printf ("%s: %s", guestfs_int_program_name, data);
 ansi_restore (stdout);
 putchar ('\n');

This also adds a "Conversion finished successfully" message (in green).

Thanks: Ming Xie
2016-06-29 13:00:14 +01:00
Richard W.M. Jones
d2abfc7b48 utils: Move ansi_* functions to header guestfs-internal-frontend.h.
This is just code motion.
2016-06-29 12:49:46 +01:00
Richard W.M. Jones
3ac0aa8232 mllib: Add powerpc64 and powerpc64le to normalize_arch (RHBZ#1264835).
Add powerpc64 (ppc64) and powerpc64le (ppc64le) cases to the
normalize_arch function.  Also remove a few duplicate cases which are
already caught in the catch-all case at the end of the match.
2016-06-29 10:09:27 +01:00
Matteo Cafasso
2d65129e7e Reserve entries to tsk_dirent struct
Already implemented entries.

tsk_inode
tsk_type
tsk_size
tsk_name
tsk_flags

Easy ones to add.

tsk_atime_sec
tsk_atime_nsec
tsk_mtime_sec
tsk_mtime_nsec
tsk_ctime_sec
tsk_ctime_nsec
tsk_blksize
tsk_blocks

Further ideas.

tsk_nlink
tsk_link_name

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-06-28 22:09:36 +01:00
Richard W.M. Jones
b221863f22 p2v: Add more utilities to the virt-p2v ISO.
- iscsi-initiator-utils (open-iscsi), as a partial fix for RHBZ#1337052

- vi (Vim), to use as an editor inside the XTerm window.
2016-06-28 17:27:52 +01:00
Richard W.M. Jones
13307325e8 p2v: Remove trailing \n from fixed disks device box.
Fixes commit 6aba5a4944.
2016-06-28 13:38:34 +01:00
Richard W.M. Jones
cc38d62fdf p2v: Ensure messages are flushed through to the journal immediately (RHBZ#1229386).
In kernel conversion mode, we must ensure messages are flushed to the
journal as soon as they are received from virt-v2v, otherwise (now
that debugging is not the default) we won't see any messages at all
until the last moment.

Thanks: Ming Xie
2016-06-28 12:29:29 +01:00
Richard W.M. Jones
5f248dcd39 p2v: Add 'less' package to the ISO.
When running the xterm it is very useful to be able to do:

  dmesg | less
2016-06-27 15:42:30 +01:00
Richard W.M. Jones
2783f695ff p2v: Add --install option to virt-p2v-make-disk, virt-p2v-make-kickstart.
This allows you to install extra packages in the disk/ISO.  The
implementation of this option in virt-p2v-make-disk was particularly
simple and followed naturally from the previous commit.
2016-06-27 11:41:19 +01:00
Richard W.M. Jones
07137ea565 p2v: virt-p2v-make-disk passes through --no-warn-if-partition to virt-builder.
See: https://bugzilla.redhat.com/show_bug.cgi?id=1342337#c4

Thanks: Junqin Zhou
2016-06-27 11:41:19 +01:00
Pino Toscano
de5c00eebf automake2junit.ml: sanitize logs, make it more conformant
- sanitize the logs, removing terminal color codes and carriage returns
- add an empty "properties" node
- put the log for skipped tests as "message" attribute, hoping it is
  read from there
- do not blacklist the log of test-virt-rescue.pl, which should not
  cause issues now
2016-06-27 11:52:35 +02:00
Richard W.M. Jones
0b836c40f2 p2v: Fix timeout error when connecting to unresponsive ssh server (RHBZ#1350363).
If an ssh server is completely unresponsive (ie. it doesn't even send
back ICMP errors), then eventually ssh times out after ConnectTimeout
seconds [ConnectTimeout is an ssh option].

Unfortunately the miniexpect timeout (default 60 seconds) was less
than ConnectTimeout so we never saw the ssh error.  Instead we would
see the internal error:

  remote server closed the connection unexpectedly,
  waiting for: password prompt

This commit sets the ssh ConnectTimeout to an explicit value, and sets
the miniexpect timeout to be 20 seconds larger than ConnectTimeout, so
that in most cases we will see the ssh error message before miniexpect
times out.

Thanks: Ming Xie for finding and diagnosing the problem
2016-06-27 10:34:10 +01:00
Richard W.M. Jones
40448d6d0d p2v: Make the conversion dialog slightly higher.
Otherwise the information pane is smaller than its content.
2016-06-24 22:28:40 +01:00
Richard W.M. Jones
9270a27650 p2v: Display serial number of fixed disks (RHBZ#855058).
Use "lsblk -o serial" to get the serial number of each fixed disk, and
if it is available display that in the GUI.
2016-06-24 15:30:34 +01:00
Richard W.M. Jones
6aba5a4944 p2v: Combine size & model columns into the device column.
In the GUI disks block, instead of using separate "Size" and "Model"
columns, combine that information into a markup column under "Device".

To make the GUI look consistent I also had to change the removables
"Device" column to be a markup column and embolden the device name
there too.
2016-06-24 15:30:33 +01:00
Richard W.M. Jones
68ff3ffd1d p2v: Refactor into get_blockdev_size and get_blockdev_model functions.
This is just refactoring, but it reveals and fixes a bug too.  The
size_gb field was left as NULL when the --test-disk option was used.
Apparently passing NULL to gtk_list_store_set is fine, but just in
case I replaced it with "".
2016-06-24 15:30:33 +01:00
Richard W.M. Jones
5ea62c57c4 Revert "p2v: add -x option to nm-online"
This reverts commit f51c0bc837.
2016-06-24 10:51:22 +01:00