[v2v PATCH 0/5] Various build cleanups
by Pino Toscano
Brought to you by the "I haven't rebuilt the libguestfs universe in a
while" saga.
Pino Toscano (5):
build: remove extra gnulib submodule
build: remove extra checks and submodules
build: stop using gnulib in test-harness
build: remove unused gnulib modules
Remove extra entries from podfiles
.gitmodules | 3 --
Makefile.am | 2 -
bootstrap | 61 +-------------------------
configure.ac | 2 -
m4/guestfs-c.m4 | 12 -----
m4/guestfs-find-db-tool.m4 | 43 ------------------
m4/guestfs-libraries.m4 | 90 +-------------------------------------
m4/guestfs-perl.m4 | 27 +-----------
m4/guestfs-progs.m4 | 18 --------
po-docs/podfiles | 12 -----
test-harness/Makefile.am | 4 +-
11 files changed, 4 insertions(+), 270 deletions(-)
delete mode 100644 m4/guestfs-find-db-tool.m4
--
2.21.0
5 years
[v2v PATCH v2 0/5] Various build cleanups
by Pino Toscano
Brought to you by the "I haven't rebuilt the libguestfs universe in a
while" saga -- now with working test suite.
Pino Toscano (5):
build: remove extra gnulib submodule
build: remove extra checks and submodules
build: stop using gnulib in test-harness
build: remove unused gnulib modules
Remove extra entries from podfiles
.gitmodules | 3 --
Makefile.am | 2 -
bootstrap | 61 +--------------------------
configure.ac | 2 -
m4/guestfs-c.m4 | 12 ------
m4/guestfs-libraries.m4 | 90 +---------------------------------------
m4/guestfs-perl.m4 | 27 +-----------
m4/guestfs-progs.m4 | 14 +------
po-docs/podfiles | 12 ------
test-harness/Makefile.am | 4 +-
10 files changed, 5 insertions(+), 222 deletions(-)
--
2.21.0
5 years
[PATCH libguestfs 0/3] options: Describe --key SELECTOR in a single file.
by Richard W.M. Jones
The libguestfs part of this change.
Also a virt-v2v part will be needed.
The first patch adds a new feature to podwrapper so that we can use
__INCLUDE:file__ directives within the POD itself (instead of using
--insert, and one day replacing that).
The second patch shows how this change could be used for the included
parts of the guestfish man page, including the non-English pages under
po-docs/$language.
The third patch unifies the --key SELECTOR documentation using this
mechanism. Note this also unifies the translated documentation too,
although because of the way it works no actual changes are needed to
po-docs/
Rich.
5 years
[nbdkit PATCH 0/5] Counterproposal for python v2 interfaces
by Eric Blake
As mentioned in my reviews, I wonder if we should make our python
callbacks look a bit more Pythonic by having kwargs added for each
new flag that we want to expose. The idea was first floated here:
https://www.redhat.com/archives/libguestfs/2018-April/msg00108.html
Note that with my proposal, there is no need for a python script to
expose a global API_VERSION variable; new flags are added using a
Python API that is backwards-compatible. In fact, with introspection,
we can even get away with the user not having to write a
can_fast_zero; the mere presence of support for a fast=... kw
parameter is enough to let us pick the correct default.
However, there are aspects of Rich's proposal that I like better: for
example, by having an explicit API_VERSION variable, we can change the
interface of pread to read directly into a buffer, which my code can't
do. And although mine produces interfaces that feel a bit more
Pythonic, I also note that mine requires more lines of code (and
that's without even implementing the cache/can_cache callback present
in Rich's proposal). Thus, this is an RFC to see which pieces we like
best out of the various proposals, rather than something that should
be applied as-is.
Eric Blake (5):
python: Let zero's may_trim parameter be optional
python: Expose can_zero callback
python: Update internals to plugin API level 2
python: Expose FUA support
python: Add can_fast_zero support
plugins/python/nbdkit-python-plugin.pod | 122 ++++++++--
plugins/python/python.c | 286 ++++++++++++++++++++++--
plugins/python/example.py | 6 +-
tests/test.py | 6 +-
4 files changed, 375 insertions(+), 45 deletions(-)
--
2.21.0
5 years
[PATCH supermin] ext2: Build symbolic links correctly (RHBZ#1770304).
by Richard W.M. Jones
We created symlinks in two steps, by creating the empty inode and then
calling ext2fs_symlink to populate it. This created broken symlinks
where the directory name contained a / character, eg:
lrwxrwxrwx 1 root root 7 Nov 26 08:43 /bin -> usr/bin
lrwxrwxrwx 1 root root 7 Nov 26 08:43 /lib -> usr/lib
lrwxrwxrwx 1 root root 9 Nov 26 08:43 /lib64 -> usr/lib64
lrwxrwxrwx 1 root root 8 Nov 26 08:43 /sbin -> usr/sbin
lrwxrwxrwx 1 root root 7 Nov 26 08:38 bin -> usr/bin
This breaks with Linux >= 5.3.8, most likely because of extra
validation now being done at the VFS layer:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
It's unnecessary to create the empty inode since ext2fs_symlink can
create the inode for us perfectly fine if we simply pass ino == 0, and
it creates them correctly too.
Thanks: Toolybird for identifying the problem and kernel patch.
---
src/ext2fs-c.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/ext2fs-c.c b/src/ext2fs-c.c
index e8ab972..8903f74 100644
--- a/src/ext2fs-c.c
+++ b/src/ext2fs-c.c
@@ -782,12 +782,6 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest)
}
/* Create a symlink. */
else if (S_ISLNK (statbuf.st_mode)) {
- ext2_ino_t ino;
- ext2_empty_inode (data->fs, dir_ino, dirname, basename,
- statbuf.st_mode, statbuf.st_uid, statbuf.st_gid,
- statbuf.st_ctime, statbuf.st_atime, statbuf.st_mtime,
- 0, 0, EXT2_FT_SYMLINK, &ino);
-
char *buf = malloc (statbuf.st_size+1);
if (buf == NULL)
caml_raise_out_of_memory ();
@@ -797,7 +791,7 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest)
if (r > statbuf.st_size)
r = statbuf.st_size;
buf[r] = '\0';
- ext2fs_symlink (data->fs, dir_ino, ino, dest, buf);
+ ext2fs_symlink (data->fs, dir_ino, 0, basename, buf);
free (buf);
}
/* Create directory. */
--
2.23.0
5 years
[PATCH] rhv-upload: Support qcow2 disks
by Nir Soffer
When using oVirt >= 4.3, we can enable the NBD based backend in imageio
by specifying that we transfer raw data when creating a transfer.
With the NBD backend, we can specify qcow2 disk format.
I think we need a way to expose the capabilities of the output to the
user. For example, can we use qcow2 format.
Issues:
- I hacked qemu-img convert command line to always use -O raw instead of
"-O t.target_format" since oVirt always starts qemu-nbd with the actual
disk format. This works for this plugin, but may be wrong for other
plugins.
---
v2v/output_rhv_upload.ml | 5 ++---
v2v/rhv-upload-plugin.py | 19 +++++++++++++++++++
v2v/v2v.ml | 4 +++-
3 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
index 3514714b..481eb482 100644
--- a/v2v/output_rhv_upload.ml
+++ b/v2v/output_rhv_upload.ml
@@ -174,7 +174,7 @@ See also the virt-v2v-output-rhv(1) manual.")
error (f_"nbdkit was compiled without SELinux support. You will have to recompile nbdkit with libselinux-devel installed, or else set SELinux to Permissive mode while doing the conversion.")
in
- (* Output format/sparse must be raw/sparse. We may be able to
+ (* Output sparse must be sparse. We may be able to
* lift this limitation in future, but it requires changes on the
* RHV side. See TODO file for details. XXX
*)
@@ -333,8 +333,7 @@ object
let disk_format =
match target_format with
| "raw" as fmt -> fmt
- | "qcow2" ->
- error_current_limitation "-of raw"
+ | "qcow2" as fmt -> fmt
| _ ->
error (f_"rhv-upload: -of %s: Only output format ‘raw’ or ‘qcow2’ is supported. If the input is in a different format then force one of these output formats by adding either ‘-of raw’ or ‘-of qcow2’ on the command line.")
target_format in
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
index a2d09458..4272a89f 100644
--- a/v2v/rhv-upload-plugin.py
+++ b/v2v/rhv-upload-plugin.py
@@ -17,6 +17,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import builtins
+import inspect
import json
import logging
import socket
@@ -456,6 +457,8 @@ def create_disk(connection):
name = params['disk_name'],
description = "Uploaded by virt-v2v",
format = disk_format,
+ # XXX For qcow2 disk on block storage, we should use the estimated
+ # size, based on qemu-img measure of the overlay.
initial_size = params['disk_size'],
provisioned_size = params['disk_size'],
# XXX Ignores params['output_sparse'].
@@ -497,11 +500,16 @@ def create_transfer(connection, disk, host):
system_service = connection.system_service()
transfers_service = system_service.image_transfers_service()
+ extra = {}
+ if transfer_supports_format():
+ extra["format"] = types.DiskFormat.RAW
+
transfer = transfers_service.add(
types.ImageTransfer(
disk = types.Disk(id = disk.id),
host = host,
inactivity_timeout = 3600,
+ **extra,
)
)
@@ -531,6 +539,17 @@ def create_transfer(connection, disk, host):
return transfer
+def transfer_supports_format():
+ """
+ Return True if transfer supports the "format" argument, enabing the NBD
+ bakend on imageio side, which allows uploading to qcow2 images.
+
+ This feature was added in ovirt 4.3. We assume that the SDK version matches
+ engine version.
+ """
+ sig = inspect.signature(types.ImageTransfer)
+ return "format" in sig.parameters
+
# oVirt imageio operations
def parse_transfer_url(transfer):
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index 03590c9e..58bb06c3 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -739,7 +739,9 @@ and copy_targets cmdline targets input output =
| TargetURI uri -> uri in
[ "qemu-img"; "convert" ] @
(if not (quiet ()) then [ "-p" ] else []) @
- [ "-n"; "-f"; "qcow2"; "-O"; t.target_format ] @
+ (* XXX When using NBD we must use raw format, not the target_format
+ * which is the disk format. commpressed format will also not work. *)
+ [ "-n"; "-f"; "qcow2"; "-O"; "raw" ] @
(if cmdline.compressed then [ "-c" ] else []) @
[ "-S"; "64k" ] @
[ overlay_file; filename ] in
--
2.21.0
5 years
RHEL 7 and guestmount of XFS volumes
by Fabien Dupont
Hi,
I'm experiencing a weird behavior when tried to use guestmount with a XFS
formatted volume. I have created a RHEL 8 virtual machine using libvirt. I
have retrieved the disk image on a RHEL 7.7 server to mount the image root
filesystem and explore it.
The command returns an error message:
# guestmount -a /disks/jamesdream.qcow2 -m /dev/sda1 /mnt/
libguestfs: error: mount_options: mount exited with status 32: mount: wrong
fs type, bad option, bad superblock on /dev/sda1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
guestmount: ‘/dev/sda1’ could not be mounted.
guestmount: Did you mean to mount one of these filesystems?
guestmount: /dev/sda1 (xfs)
guestmount: /dev/rhel/root (xfs)
guestmount: /dev/rhel/swap (swap)
I have also run the same command with -x and -v options and the log is
attached.
Seeing that it's not working on RHEL 7, I've tried the same command on
another RHEL 8.1 machine and it works. Looking at libguestfs-tools package
version, it appears that the package on RHEL 7.7 (1.40.2-5.el7_7.2) is more
recent than on RHEL 8.1 (1.38.4-14.module+el8.1.0+4066+0f1aadab). Is that
normal ?
Thanks for your help.
--
Fabien Dupont, RHCA
Principal Software Engineer
Red Hat - Migration Engineering <https://www.redhat.com>
<https://red.ht/sig>
<https://redhat.com/summit>
5 years