Commit Graph

11075 Commits

Author SHA1 Message Date
Richard W.M. Jones
8eb9f06b15 mlxml: Fix pointed target signedness.
xml-c.c: In function 'mllib_xml_to_string':
xml-c.c:199:47: error: pointer targets in passing argument 2 of 'caml_alloc_initialized_string' differ in signedness [-Werror=pointer-sign]
  199 |   strv = caml_alloc_initialized_string (size, mem);
      |                                               ^~~
      |                                               |
      |                                               xmlChar * {aka unsigned char *}

(cherry picked from commit ea10827b4cfb3cfe5f782421c01d2902e5f73f90)
2020-09-23 12:41:24 +01:00
Richard W.M. Jones
17df30b820 builder: Fix const correctness for OCaml 4.10.
String_val now returns a const char *.

(cherry picked from commit d6fcf519f2)
2020-09-23 12:38:40 +01:00
Richard W.M. Jones
93422725a0 cat: Fix GCC 10 warning.
I believe this warning is bogus, but simply initializing the local
variable is enough to avoid it.

log.c: In function 'do_log':
log.c:390:7: error: 'comm_len' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  390 |       printf (" %.*s", (int) comm_len, comm);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(cherry picked from commit 4e199494c4)
2020-09-23 12:38:40 +01:00
Richard W.M. Jones
96462b30d5 ocaml: Change calls to caml_named_value() to cope with const value* return.
In OCaml >= 4.09 the return value pointer of caml_named_value is
declared const.

Based on Pino Toscano's original patch to ocaml-augeas.

(cherry picked from commit 74ce7332db)
2020-09-23 12:38:40 +01:00
Richard W.M. Jones
3b4082b239 ocaml: Use caml_alloc_initialized_string instead of memcpy.
Since about 2017 OCaml has had a function for creating an initialized
string.  This uses the function instead of caml_alloc_string + memcpy
(which doesn't work for OCaml 4.10) and defines a replacement if the
function is missing.

Note this requires configure.ac in libguestfs.git and virt-v2v.git to
define HAVE_CAML_ALLOC_INITIALIZED_STRING.

(cherry picked from commit 398dc56a6cb5d6d01506338fa94ef580e668d5e9)
2020-09-23 12:38:40 +01:00
Richard W.M. Jones
5c5cc8b7bc ocaml: Use caml_alloc_initialized_string instead of memcpy.
See this commit in libguestfs-common:
398dc56a6c

(cherry picked from commit 9f3148c791)
2020-09-23 12:38:40 +01:00
Richard W.M. Jones
3860ab78d9 ocaml: Change calls to caml_named_value() to cope with const value* return.
In OCaml >= 4.09 the return value pointer of caml_named_value is
declared const.

Based on Pino Toscano's original patch to ocaml-augeas.

(cherry picked from commit 9788fa50601ad4f1eab56d0b763591268026e536)
2020-09-23 12:26:14 +01:00
Richard W.M. Jones
524b0c748a caml_named_value returns const value pointer in OCaml 4.09+
(cherry picked from ocaml-augeas
commit 1cf5aef99b26a46529ca797547c0b49627fffe78)
2020-09-23 12:24:53 +01:00
Richard W.M. Jones
a5e8afb4ed daemon, lib: Replace deprecated security_context_t with char *.
This gives deprecation warnings.  It always was simply a char *, and
the recommendation upstream is to replace uses with char *:

9eb9c93275
(cherry picked from commit eb78e990ac)
2020-09-23 12:21:10 +01:00
Richard W.M. Jones
91698a8500 Version 1.40.2. v1.40.2 2019-02-07 14:45:14 +00:00
Pino Toscano
c7b374a757 inspect: revamp icon extraction for *SUSE guests
Newer versions do not have the 24px distributor.png icon; OTOH they have
the 48px version, so look for that one before the 24px one.

Also, bump the size limit to 10K, as newer versions of the icon are
bigger than 3K.

(cherry picked from commit f41a75cea6)
2019-02-07 13:49:59 +00:00
Pino Toscano
8e62f30293 inspect: factor out find_png helper function
Isolate the code for looking for a PNG file among a specified list from
the icon_ubuntu implementation, and switch that function to it.

This is just code refactoring, with no behaviour changes.

(cherry picked from commit 6ff95acc72)
2019-02-07 13:49:56 +00:00
Pino Toscano
178d9d821a inspect: bump size limit for Mageia guests
Newer versions of the logo in Cauldron are almost 3K, so bump the limit
to 10K for now.

(cherry picked from commit 032b8d4c72)
2019-02-07 13:49:53 +00:00
Pino Toscano
cc83aae48d v2v: linux: use NEVR for querying RPM packages (RHBZ#1669395)
Use NEVR when querying RPM for the list of files of a package, instead
of ENVR.  Also, use the epoch only when non-zero, and version of RPM
supports it.

The approach is basically copied from what supermin does in its RPM
package handler.

(cherry picked from commit 5eafd12731)
2019-02-07 13:49:47 +00:00
Richard W.M. Jones
7679706444 build: Reduce -Wformat-overflow=2 to =1.
GCC 9 gives this error:

qemuopts.c: In function 'qemuopts_to_config_channel':
qemuopts.c:987:29: error: '%.*s' directive output between 0 and 2147483647 bytes may exceed minimum required size of 4095 [-Werror=format-overflow=]
  987 |             fprintf (fp, "  %.*s = ", (int) k, values[j]);
      |                             ^~~~
qemuopts.c:987:26: note: assuming directive output of 1 byte
  987 |             fprintf (fp, "  %.*s = ", (int) k, values[j]);
      |                          ^~~~~~~~~~~

See discussion at the following GCC bug:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88993
(cherry picked from commit b26bd778b5)
2019-02-07 13:49:43 +00:00
Pino Toscano
d5dc8fba74 python: change types for RBufferOut/FBuffer with Python 3 (RHBZ#1661871)
So far RBufferOut return values, and FBuffer struct fields are 'str' on
all the versions of Python.  Python 3 distinguishes between 'str'
(unicode strings), and 'bytes', with 'str' no more able to hold
arbitrary data.

For this reason, switch the return value of RBufferOut functions, and
FBuffer struct fields to bytes on Python 3: while this is a potentially
incompatibile change, this is the only way to handle safely sequences
of arbitrary bytes.

(cherry picked from commit 0ee02e0117)
2019-02-07 13:49:23 +00:00
Pino Toscano
c18957e0ea python: fix call of Python handlers of events
Make sure to reference the arguments, to make sure they are kept alive
during the function call; this is visible when setting an event handler
for the CLOSE event, and testing it with Python 3.

This does not seem to create a memory leak e.g. with Python 2.

Also, switch away from the quasi-internal PyEval_CallObject to the
public PyObject_CallObject, which takes care of doing safety checks.

(cherry picked from commit 85235aec83)
2019-02-07 13:49:17 +00:00
Pino Toscano
53a7f2ffec build: integrate ocaml-link.sh with automake silent rules
In case either the silent rules are disabled, or V=1 is set, print the
full command line that is executed.

(cherry picked from commit a8006afaf5)
2019-02-07 13:49:13 +00:00
Richard W.M. Jones
1f026244ba Version 1.40.1. v1.40.1 2019-01-17 12:06:36 +00:00
Richard W.M. Jones
ae2aa14527 valgrind: Add workaround for slow loading of debuginfo by valgrind.
See nbdkit commit
bd32d899ed
and https://bugzilla.redhat.com/show_bug.cgi?id=1662656

(cherry picked from commit ea7c13fed7)
2019-01-17 12:04:54 +00:00
Richard W.M. Jones
1de72f8f00 Version 1.40.0. v1.40.0 2019-01-16 12:04:25 +00:00
Richard W.M. Jones
6151d8694d po: Drop ca and pt_BR from linguas.
Commit 4252a490bb dropped the PO files
for ca (Catalan) and pt_BR (Brazilian Portuguese).  However it did not
drop these languages from the linguas line in the Makefile resulting
in a build failure.
2019-01-16 11:57:57 +00:00
Richard W.M. Jones
d1ff62f3e0 configure: Move remaining detection of p2v features to m4/guestfs-v2v.m4.
./configure output now contains a distinct section for v2v and p2v:

  --- Checking the virt-v2v and virt-p2v dependencies ---
  checking for the nbdkit python plugin name... python3
  checking for --with-gtk option... 2
  checking for GTK... yes
  checking for DBUS... yes
  checking if we can build virt-p2v... yes, with Gtk 2

Thanks: Pino Toscano.
2019-01-16 11:57:57 +00:00
Richard W.M. Jones
61b86bac2e v2v: -o rhv-upload: Allow configure to set the nbdkit Python version.
No functional change, but it does allow downstream distributions to
adjust the nbdkit Python plugin used by virt-v2v -o rhv-upload mode:

./configure --with-virt-v2v-nbdkit-python-plugin=...
2019-01-16 11:57:57 +00:00
Richard W.M. Jones
090f5589e7 po-docs: uk: Fix inconsistent use of \n in translation.
Invalid po file ./uk.po:
./uk.po:90428: 'msgid' and 'msgstr' entries do not both begin with '\n'
msgfmt: found 1 fatal error
2019-01-15 14:44:16 +00:00
Richard W.M. Jones
1db0140428 docs: Finalize release notes for 1.40.
Updates commit 0ce8ecdf66.
2019-01-15 14:44:16 +00:00
Richard W.M. Jones
b8882fed97 website: Update website for 1.40. 2019-01-15 14:44:16 +00:00
Pino Toscano
cf6b527824 inspect: fix inspection of partition-less devices (RHBZ#1661038)
When parsing "xdev"-kind devices, do not assume that the partition
number can be converted to integer: re_xdev accepts an empty part of the
partition number, so just handle as it is, as string.

This fixes a regression due to the conversion of the inspection code to
OCaml, as the old C version did not have this issue.
2019-01-14 17:29:13 +01:00
Pino Toscano
d3ff88c894 OCaml: use the new behaviour of Std_utils.which
Since Std_utils.which can handle relative/absolute paths, remove the
manual checks, and use Std_utils.which directly.
2019-01-14 15:19:32 +01:00
Pino Toscano
ebe2c7b458 mlstdutils: allow relative/absolute paths for Std_utils.which
Make Std_utils.which behave a bit more like which(1), checking the
existance of relative/absolute paths specified.
2019-01-14 15:19:32 +01:00
Pino Toscano
88a754bd07 mlstdutils: add a very simple test for Std_utils.which 2019-01-14 15:19:32 +01:00
Pino Toscano
27cd2888c3 automake2junit.ml: string -> bytes
Make it usable OOTB with OCaml >= 4.02.0.
2019-01-14 15:19:32 +01:00
Yuri Chornoivan
7f97433a3c Fix miscellaneous typos in comments. 2019-01-11 17:14:45 +00:00
Richard W.M. Jones
4040c7de93 Update gnulib to latest version. 2019-01-11 17:14:45 +00:00
Richard W.M. Jones
4252a490bb Update PO files from Zanata. 2019-01-08 18:28:27 +00:00
Richard W.M. Jones
fc028bf57a v2v: -o openstack: Don't echo full commands (RHBZ#1664310).
They can contain passwords or tokens if for example the
‘-oo os-password’ option is used.

Thanks: Tomáš Golembiovský, Brett Thurber.
2019-01-08 14:17:44 +00:00
Richard W.M. Jones
05d4fcb64d Update copyright dates for 2019.
This command run over the source:

perl -pi.bak -e 's/(20[01][0-9])-2018/$1-2019/g' `git ls-files`
2019-01-08 11:58:30 +00:00
Richard W.M. Jones
0ce8ecdf66 Update release notes for 1.40 release. 2019-01-07 20:03:40 +00:00
Richard W.M. Jones
492a945791 Revert "launch: libvirt: Use qemu-bridge-helper to implement a full network (RHBZ#1148012)."
We've been carrying this exact patch in RHEL 7 for several years.  It
reverts the change made in 2014 where we switched to using the virbr0
bridge for libguestfs networking instead of SLIRP.  We thought SLIRP
was going to become unsupported in qemu, but recently there have been
more encouraging signs since it looks like SLIRP will be spun off as a
separate project, running as a modular process and properly secured
and supported.

This reverts commit 224de20b9a.
2019-01-07 15:03:07 +00:00
Pino Toscano
5e5896752e v2v: further doc update for VMware roles
Remove "Allow virtual machine download", added with
commit 37955f14aa, because it does not
seem to be actually needed.

Related: RHBZ#1530967
2019-01-07 12:23:25 +01:00
Pino Toscano
6b80c5fb51 v2v: -o rhv-upload: decouple name of nbdkit python plugin
Do not assume that the Python plugin of nbdkit has the same name of the
Python interpreter.

Use the default upstream name of nbdkit to identify it; downstream
distributions must adjust this variable, in case they rename the Python
plugin of nbdkit.
2018-12-16 16:13:44 +01:00
Richard W.M. Jones
216fe13fcc v2v: windows: Add comment about possibility of removing GPO restrictions.
Although it may not be a good idea because usually they are installed
for a reason.
2018-12-14 13:07:41 +00:00
Pino Toscano
37955f14aa v2v: update docs for VMware roles (RHBZ#1530967)
Update the list of permissions needed for VMware vCenter 6.5.
2018-12-13 14:58:39 +01:00
Richard W.M. Jones
6aa46f4303 Version 1.39.14. v1.39.14 2018-12-12 12:35:30 +00:00
Richard W.M. Jones
52ec462fea lib: direct: Move serial option from -drive to -device.
qemu deprecated and removed this option from the -drive parameter,
resulting in:

  Block format 'raw' does not support the option 'serial'

See also:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg574583.html
2018-12-12 12:29:33 +00:00
Richard W.M. Jones
08a14d9fa7 Version 1.39.13. v1.39.13 2018-12-11 19:40:02 +00:00
Richard W.M. Jones
b38e4eff2b gnulib: Use https URL instead of git.
This is apparently more secure (against MITM attacks), and furthermore
Savannah git: access is broken at the moment.
2018-12-11 19:38:09 +00:00
Richard W.M. Jones
b7cf2dfff8 Version 1.39.12. v1.39.12 2018-12-11 19:15:22 +00:00
Richard W.M. Jones
e62a443165 tests: Provide a way for skipping tests/bigdirs/test-big-dirs.pl.
This test is currently broken because of a kernel bug
(https://bugzilla.redhat.com/show_bug.cgi?id=1657200).
2018-12-11 17:53:29 +00:00
Richard W.M. Jones
d9f5e47f82 tests: Fix console for slow tests on Ubuntu 18.04.
Use the same fix as for Debian and Ubuntu 16.04.
2018-12-11 16:38:55 +00:00