Commit Graph

11177 Commits

Author SHA1 Message Date
Richard W.M. Jones
52c7e787d2 rust: Add README.md to EXTRA_DIST.
Fixes previous commit.
2019-08-12 20:36:28 +01:00
Hiroyuki Katsura
212f1a5f71 Rust bindings: Make it able to publish this crate
I added
- data required to publish this crate to `crates.io`.
- README.md which contains the details of how to publish this crate.
2019-08-12 20:34:47 +01:00
Richard W.M. Jones
dcfa382b27 v2v: Remove double space.
Tiny whitespace-only fix.
2019-08-09 12:51:10 +01:00
Richard W.M. Jones
4f30db5ae4 Update gnulib to latest version.
This fixes some test breakage I was experiencing with recent
kernel/glibc.
2019-08-08 13:17:37 +01:00
Richard W.M. Jones
7692c31494 v2v: -i vmx: Use scp -T option if available to unbreak scp (RHBZ#1733168).
Tested using:

cd v2v
LIBGUESTFS_BACKEND=direct ../run virt-v2v -i vmx -it ssh "ssh://localhost/$PWD/test-v2v-i-vmx-1.vmx" -o null -v -x

and manually examining the debug output.

Thanks: Ming Xie, Jakub Jelen.
2019-08-08 12:08:17 +01:00
Hiroyuki Katsura
3f7ff1b068 Rust bindings: Implement callback handlers
This patch includes:

- Event callback handlers
- Tests related to events(410-430)

src/bin/event.rs and src/bin/event_leak.rs
are the PoCs that Boxes related to callbacks are
not leaked.
2019-08-06 14:54:04 +01:00
Hiroyuki Katsura
bb0cb3e730 Rust bindings: Add Event structs, Clarify Handle lifetime
Without clarifying handle's lifetime, it is unable
to see how long the callbacks which the handle
owns will live. Then, Rust compiler will infer
that the callbacks have 'static lifetime. It is
not convenient for users.
2019-08-06 14:54:04 +01:00
Richard W.M. Jones
ab09bc25c7 build: Update miscellaneous files.
BUGS
docs/C_SOURCE_FILES
po/POTFILES
po/POTFILES-ml

These files are normally updated by ‘make dist’ but as we've not had a
release in a while they had not been updated for some time.
2019-07-29 12:57:24 +01:00
Richard W.M. Jones
b81c252e44 p2v: Add .gitignore to EXTRA_DIST.
Fixes commit 9fe175cd76.
2019-07-29 12:55:22 +01:00
Richard W.M. Jones
34a0a724c0 v2v: Fix EXTRA_DIST.
Fixes commit a27748d700.
2019-07-29 12:54:11 +01:00
Richard W.M. Jones
97e2be01b5 common/mltools: Fix EXTRA_DIST.
Fixes commit f79129b8dc.
2019-07-29 12:53:14 +01:00
Richard W.M. Jones
9a6d162852 rust: Add missing file to EXTRA_DIST. 2019-07-29 12:22:20 +01:00
Richard W.M. Jones
94f20e2511 rust: Remove rust/.gitignore from EXTRA_DIST.
Fixes commit b484ca4da1.
2019-07-29 12:18:17 +01:00
Richard W.M. Jones
45e66a567d generator: Use ~copyrights shorthand for ~copyrights:copyrights 2019-07-29 12:15:32 +01:00
Richard W.M. Jones
e6f5ec35cc generator: copywrites -> copyrights 2019-07-29 12:14:23 +01:00
Richard W.M. Jones
b484ca4da1 rust: Move .gitignore to top level file and add extra files. 2019-07-29 12:12:14 +01:00
Hiroyuki_Katsura
3bbd00c83e Rust bindings: Add Rust bindings
This patch includes Actions and their tests. Missing:

- Events
- Examples

Rust bindings: Add create / close functions

Rust bindings: Add 4 bindings tests

Rust bindings: Add generator of structs

Rust bindings: Add generator of structs for optional arguments

Rust bindings: Add generator of function signatures

Rust bindings: Complete actions

Rust bindings: Fix memory management

Rust bindings: Add bindtests

Rust bindings: Add additional 4 bindings tests

Rust bindings: Format test files

Rust bindings: Incorporate bindings to build system
2019-07-29 10:28:31 +01:00
Pino Toscano
6d251e3828 v2v: remove extra nbdkit bit from documentation (RHBZ#1723305)
Since there is no more need to build nbdkit from sources, then there is
no need to set $PATH with a custom build of nbdkit.

Followup of commit 0704d8eb0b.
2019-07-18 15:38:53 +02:00
Pino Toscano
730d2122c4 p2v: split appliance tests in own variable
This way they can be properly shipped also when creating a distribution
tarball ('make dist') from a build configured with --disable-appliance.
2019-07-08 18:58:19 +02:00
Pino Toscano
99cec3c1e7 p2v: fix tests with srcdir!=builddir
Point to files in the source directory using the right variables, so
they are found also when the build directory is different than the
source directory.
2019-07-08 18:56:06 +02:00
Pino Toscano
c5db961cf1 p2v: consider p2v-config.h as generated source
While it is generated at configure time for dependency reasons, consider
it a generated source nevertheless: after the first run, there will be
dependency rules available, so automake will trigger the proper rule to
generate it again using generate-p2v-config.pl.
2019-07-08 17:58:23 +02:00
Pino Toscano
31e8ae38d9 p2v: clean also the test images
Followup of commit ea4d9bd157, and
commit f02c0cb552.
2019-07-08 17:57:41 +02:00
Richard W.M. Jones
c22a8b68fe v2v: Allow Windows virtio ISO to be a block device as well as a regular file.
Thanks: Steven Rosenberg
2019-07-04 22:23:52 +01:00
Pino Toscano
f30840e01b p2v: stop including guestfs.h
It is no more needed, guestfs-utils.h is enough these days.
2019-07-03 12:41:02 +02:00
Pino Toscano
498f940419 contrib: move p2v files within p2v 2019-07-03 12:41:02 +02:00
Pino Toscano
fe96e24001 p2v: generate C about data authors from AUTHORS file
Create a small Perl script to generate about-authors.c from the p2v
AUTHORS file at build time, instead of generating in the generator
at dist time.
2019-07-03 12:41:02 +02:00
Pino Toscano
e7a550c2d8 p2v: ship generate-p2v-config.pl
Fixes commit 796ce74f31.
2019-07-03 12:41:02 +02:00
Pino Toscano
1fe60aabdf p2v: remove non-author credits
Soon only the virt-p2v authors will be available, so remove all the
other roles.  This leaves only in the virt-p2v about dialog, which is a
mild regression compared to the current situation, although it is just
for user information.
2019-07-03 12:40:52 +02:00
Pino Toscano
7ad6afc222 p2v: generate an AUTHORS file
Create a simple AUTHORS file for virt-p2v, so it is easier to
extract or use it later on.
2019-07-02 15:40:39 +02:00
Pino Toscano
f02c0cb552 p2v: tests: use a local blank-part disk image
Instead of using the "global" blank-part test image, use a local version
of it created with guestfish.
2019-07-01 18:47:18 +02:00
Pino Toscano
ea4d9bd157 p2v: tests: switch windows image with local fedora one
Instead of using the "global" Windows test image, use a local Fedora
image created with virt-builder.
2019-07-01 18:44:30 +02:00
Pino Toscano
9fe175cd76 p2v: split gitignore
Move (or copy the general ones) all the p2v entries in the top-level
.gitignore file to a new file specific for p2v.  This will make it
easier to keep them when splitting p2v.
2019-07-01 18:38:09 +02:00
Pino Toscano
35916b6030 generator: remove p2v_config
No more used now, as this configuration is generated within p2v itself
at build time.
2019-07-01 14:26:44 +02:00
Pino Toscano
180290ff74 p2v: move kernel config POD docs to perl script
Copy from generator/p2v_config.ml also the bits for POD documentation,
adding them to generate-p2v-config.pl; this way,
virt-p2v-kernel-config.pod can be generated at build time directly,
instead of statically shipped as generator output.
2019-07-01 14:14:56 +02:00
Pino Toscano
796ce74f31 p2v: move kernel config to perl script
Instead of generating the p2v kernel config using the OCaml generator,
create a Perl script to do this job, mostly at build time.  This is done
to rely less on the generator for p2v, and because the generation of
these sources is quick enough that it can be done at build time (instead
of shipping the generated sources in dist tarballs).

The generate-p2v-config.pl mimics what generator/p2v_config.ml --
namings, and general structure are kept close to that for comparison.

The two C sources are created at build time by the script; however, the
p2v-config.h header is generated at configure time: this is done because
p2v-config.h is included by p2v.h (another header), which in turn is
included by all the p2v C sources -- automake is not able to properly
resolve the dependency, and thus it would not be generated properly.
2019-07-01 13:58:13 +02:00
Richard W.M. Jones
c4638739d6 python: PYTHON_LIBS is not set in Python 3.8 (RHBZ#1705482).
Python 3.8 no longer links C extensions to -lpython, instead relying
on the fact that the python binary itself already contains those
symbols.  This means $PYTHON_LIBS is empty and so the Python bindings
are not built.

Use a different test to see if the python module is available.
2019-05-31 13:07:25 +01:00
Pino Toscano
ca8f8afcc5 Revert "daemon: implement OptString for OCaml APIs"
This causes the build to fail, as Val_optstring is still not used by any
generated C glue function.

This reverts commit 8e51e9078f.
2019-05-30 09:45:40 +02:00
Pino Toscano
8e51e9078f daemon: implement OptString for OCaml APIs
It is already considered as string option, so create an option string
value in the C glue for OptString parameters.
2019-05-30 09:12:32 +02:00
Pino Toscano
8eb696f827 appliance: remove custom Shadow augeas lens
Now that augeas 1.2.0 is required, assume the Shadow lens is available
there, and thus drop the local copy.
2019-05-30 09:12:32 +02:00
Pino Toscano
31d72dc463 build: raise augeas requirement to 1.2.0
It is widely available also on older distributions.
2019-05-30 09:12:32 +02:00
Richard W.M. Jones
2bb6be333e appliance: Remove /etc/dhcp/dhclient-enter-hooks.d/resolved.
Workaround for Ubuntu which uses this script to try to start a systemd
service.  That won't work because systemd is not used inside the
appliance.  See:

https://bugs.launchpad.net/ubuntu/+source/supermin/+bug/1824236

Thanks: Ioanna Alifieraki
2019-05-29 17:54:52 +01:00
Pino Toscano
0cafcc0e88 build: build C sources using OCaml API with CAML_NAME_SPACE
This way no non-namespaced OCaml C symbols are used, reducing the risk
of clashes with other code.

The only exception is ocaml-augeas, which does not build with
CAML_NAME_SPACE; it will be fixed upstream, and it affects only
ocaml-augeas itself.
2019-05-28 11:39:20 +02:00
Martin Kletzander
c2918b8b74 Use proper label for nbdkit sockets
While svirt_t can be used for sockets it does not always guarantee that it will
be accessible from a virtual machine.  The VM might be running under svirt_tcg_t
context which will need a svirt_tcg_t label on the socket in order to access it.

There is, however, another label, svirt_socket_t, which is accessible from
virt_domain:

  # sesearch -A -s svirt_t -c unix_stream_socket -p connectto
  ...
  allow virt_domain svirt_socket_t:unix_stream_socket { ... connectto ... };
  ...

And virt_domain is a type attribute of both svirt_t and svirt_tcg_t:

  # seinfo -x -a virt_domain
  Type Attributes: 1
     attribute virt_domain;
          svirt_t
          svirt_tcg_t

Resolves: https://bugzilla.redhat.com/1698437

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2019-05-28 10:14:37 +01:00
Pino Toscano
2ad84a080d tests: import importlib.util directly
It seems that on older Python 3 versions importlib.util is not imported
automatically when importlib is imported; as solution, import
importlib.util directly (as it is what is used, anyway).

Fixes commit f79129b8dc.
2019-05-24 14:49:05 +02:00
Pino Toscano
c9543de73d launch: libvirt: fix custom hypervisor check
Previously, is_custom_hv() used to compare the QEMU executable found
during configure to the hypervisor set to check whether it is a custom
one; however, the QEMU found at configure time can be different than
what libvirt was configured with.

This fixes the libvirt backend when libguestfs is configured with a
different QEMU, that now will be specified as emulator overriding the
libvirt one.
2019-05-24 14:49:05 +02:00
Pino Toscano
797925cc3c launch: libvirt: get default QEMU from domcapabilities
Parse the libvirt domain capabilities for the default emulator
capabilities, and get the path to the default QEMU executable.
2019-05-24 14:49:05 +02:00
Pino Toscano
8d453fe9cc build: stop looking for ocaml-libvirt
We ship our own copy of it, so we do not need the external version.
(Also, the latest upstream version of ocaml-libvirt was already not
usable to build the test harness of v2v.)
2019-05-20 13:40:19 +02:00
Pino Toscano
5c4bd181b6 v2v: test-harness: stop using the external ocaml-libvirt
Use the embedded copy.
2019-05-20 13:40:19 +02:00
Pino Toscano
3e89a1d44f v2v: -o libvirt: switch away from virsh
Now that we have a proper libvirt connection object, use it directly to
refresh the storage pool, and define the final guest.  This avoids
spawning a new virsh process twice, with no possibility to even share a
possible authentication required.
2019-05-20 13:40:19 +02:00
Pino Toscano
e8f9ea2f67 v2v: -o libvirt: use a Lazy for the connection
Store the Libvirt.Connect.t object as instance variable, so it can be
used also outside of prepare_targets.  Use a private method to access
it, so there is no need to directly use the Lazy object.
2019-05-20 13:40:19 +02:00