[PATCH] ocaml: add handling for errno ENOSPC
by Pino Toscano
---
generator/OCaml.ml | 1 +
1 file changed, 1 insertion(+)
diff --git a/generator/OCaml.ml b/generator/OCaml.ml
index 92a913015..363aa5232 100644
--- a/generator/OCaml.ml
+++ b/generator/OCaml.ml
@@ -41,6 +41,7 @@ let ocaml_errnos = [
"ESRCH";
"ENOENT";
"EROFS";
+ "ENOSPC";
]
(* Generate the OCaml bindings interface. *)
--
2.21.0
4 years, 12 months
[PATCH 0/1] Allow UUIDs for --key identifiers.
by Pino Toscano
This combined patch series enables to decrypt LUKS devices on inspection
by allowing the UUID of the LUKS device with the --key syntax.
I opted for reusing the option instead of adding another one, as I think
that device names and UUIDs are different enough that can be properly
distinguished.
A test for this (patch #4) can be applied only when the patches for
common are applied, and the submodule updated.
Pino Toscano (1):
New API: luks_uuid
daemon/luks.c | 25 +++++++++++++++++++++++++
generator/actions_core.ml | 8 ++++++++
generator/proc_nr.ml | 1 +
lib/MAX_PROC_NR | 2 +-
4 files changed, 35 insertions(+), 1 deletion(-)
--
2.21.0
4 years, 12 months
[PATCH] tests: rhv-upload: Require nbdkit python plugin
by Nir Soffer
With recent nbdkit the skip test fails the rhv-upload test skip:
$ nbdkit python3 --version
nbdkit: error: cannot open plugin 'python3':
/usr/local/lib/nbdkit/plugins/nbdkit-python3-plugin.so: cannot open
shared object file: No such file or directory
It seems that the python plugin is always installed as
nbdkit-python-plugin.so, so the correct test now is:
nbdkit python --version
This may not work with older version of nbdkit, but I'm not sure this is
relevant now.
---
tests/test-v2v-o-rhv-upload.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test-v2v-o-rhv-upload.sh b/tests/test-v2v-o-rhv-upload.sh
index a2f5b0d5..fe0a4d94 100755
--- a/tests/test-v2v-o-rhv-upload.sh
+++ b/tests/test-v2v-o-rhv-upload.sh
@@ -29,7 +29,7 @@ $TEST_FUNCTIONS
skip_if_skipped
skip_if_backend uml
skip_unless python3 --version
-skip_unless nbdkit python3 --version
+skip_unless nbdkit python --version
skip_unless_phony_guest windows.img
libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml"
--
2.21.0
4 years, 12 months
[v2v PATCH v2] v2v: require 100 available inodes on each filesystem
by Pino Toscano
Enough free space in a filesystem does not imply available inodes to
create/modify files on that filesystem. Hence, require at least 100
available inodes on filesystems that can provide inode counts.
Related to: RHBZ#1764569
---
docs/virt-v2v.pod | 3 +++
v2v/v2v.ml | 13 +++++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
index 6d677a45..1c884616 100644
--- a/docs/virt-v2v.pod
+++ b/docs/virt-v2v.pod
@@ -1353,6 +1353,9 @@ Minimum free space: 10 MB
=back
+In addition to the actual free space, each filesystem is required to
+have at least 100 available inodes.
+
=head3 Minimum free space check in the host
You must have sufficient free space in the host directory used to
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index f9d81460..dc1dedd7 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -375,6 +375,8 @@ and print_mpstat chan { mp_dev = dev; mp_path = path;
(* Conversion can fail if there is no space on the guest filesystems
* (RHBZ#1139543). To avoid this situation, check there is some
* headroom. Mainly we care about the root filesystem.
+ *
+ * Also make sure filesystems have available inodes. (RHBZ#1764569)
*)
and check_guest_free_space mpstats =
message (f_"Checking for sufficient free disk space in the guest");
@@ -399,14 +401,21 @@ and check_guest_free_space mpstats =
10_000_000L
in
+ (* Reasonable headroom for conversion operations. *)
+ let needed_inodes = 100L in
+
List.iter (
- fun { mp_path; mp_statvfs = { G.bfree; bsize } } ->
+ fun { mp_path; mp_statvfs = { G.bfree; bsize; files; ffree } } ->
(* bfree = free blocks for root user *)
let free_bytes = bfree *^ bsize in
let needed_bytes = needed_bytes_for_mp mp_path in
if free_bytes < needed_bytes then
error (f_"not enough free space for conversion on filesystem ‘%s’. %Ld bytes free < %Ld bytes needed")
- mp_path free_bytes needed_bytes
+ mp_path free_bytes needed_bytes;
+ (* Not all the filesystems have inode counts. *)
+ if files > 0L && ffree < needed_inodes then
+ error (f_"not enough available inodes for conversion on filesystem ‘%s’. %Ld inodes available < %Ld inodes needed")
+ mp_path ffree needed_inodes
) mpstats
(* Perform the fstrim. *)
--
2.21.0
4 years, 12 months
[PATCH common] options: Describe --key SELECTOR in a single file.
by Richard W.M. Jones
This is a patch series against common and libguestfs which unifies all
the documentation about --key SELECTOR so it only appears in a single
file, but is included in all the other POD documentation.
The overall effect of the change should be completely neutral.
Rich.
4 years, 12 months
[PATCH v2 0/3] rhv-upload: Support import to qcow2 disk
by Nir Soffer
Add support for qcow2 disk format, enabled by imageio NBD backend in RHV 4.3.
To use this feature manually, you can run virt-v2v with "-of qcow2".
Here is example run:
Source disk:
$ qemu-img info /var/tmp/fedora-30.img
image: /var/tmp/fedora-30.img
file format: raw
virtual size: 6 GiB (6442450944 bytes)
disk size: 1.15 GiB
virt-v2v:
$ ./run virt-v2v \
-v \
-i disk /var/tmp/fedora-30.img \
-o rhv-upload \
-oc https://engine/ovirt-engine/api \
-op /var/tmp/engine-password \
-on v2v \
-os nfs1-export2 \
-of qcow2 \
-oa sparse \
-oo rhv-cafile=/etc/pki/vdsm/certs/cacert.pem \
-oo rhv-cluster=fc30 \
-oo rhv-direct=true
...
[ 71.2] Copying disk 1/1 to qemu URI json:{ "file.driver": "nbd", "file.path": "/home/nsoffer/src/virt-v2v/tmp/rhvupload.6EmoNE/nbdkit0.sock", "file.export": "/" } (qcow2)
overlay file: /home/nsoffer/src/virt-v2v/tmp/v2vovl7fefa6.qcow2
overlay device name: sda
overlay virtual disk size: 6442450944
overlay source qemu URI: /var/tmp/fedora-30.img
target estimated size: 2456662831
target actual size: None
target file: [qemu] json:{ "file.driver": "nbd", "file.path": "/home/nsoffer/src/virt-v2v/tmp/rhvupload.6EmoNE/nbdkit0.sock", "file.export": "/" }
target format: qcow2
...
qemu-img 'convert' '-p' '-n' '-f' 'qcow2' '-O' 'raw' '-S' '64k' '/home/nsoffer/src/virt-v2v/tmp/v2vovl7fefa6.qcow2' 'json:{ "file.driver": "nbd", "file.path": "/home/nsoffer/src/virt-v2v/tmp/rhvupload.6EmoNE/nbdkit0.sock", "file.export": "/" }'
...
Target disk:
$ qemu-img info /rhev/data-center/82a445b6-b5e0-43c3-b761-cc6ef972e163/55255570-983a-4d82-907a-19b964abf7ed/images/f5325b5a-22e4-4a80-ad15-f68378c42dde/ab4587de-3ddf-4178-8cc0-1a09449c970d
image: /rhev/data-center/82a445b6-b5e0-43c3-b761-cc6ef972e163/55255570-983a-4d82-907a-19b964abf7ed/images/f5325b5a-22e4-4a80-ad15-f68378c42dde/ab4587de-3ddf-4178-8cc0-1a09449c970d
file format: qcow2
virtual size: 6 GiB (6442450944 bytes)
disk size: 1.17 GiB
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
Nir Soffer (3):
rhv-upload: Log params for easier debugging
v2v: Add output#tranfer_format method
rhv-upload: Support qcow2 disk format
v2v/output_rhv_upload.ml | 7 ++++---
v2v/rhv-upload-plugin.py | 20 ++++++++++++++++++++
v2v/types.ml | 1 +
v2v/types.mli | 4 ++++
v2v/v2v.ml | 2 +-
5 files changed, 30 insertions(+), 4 deletions(-)
--
2.21.0
4 years, 12 months
[v2v PATCH] v2v: require 100 availabe inodes on each filesystem (RHBZ#1764569)
by Pino Toscano
Enough free space in a filesystem does not imply available inodes to
create/modify files on that filesystem. Hence, require at least 100
available inodes on filesystems that can provide inode counts.
---
v2v/v2v.ml | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index 03590c9e..b5b2da08 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -375,6 +375,8 @@ and print_mpstat chan { mp_dev = dev; mp_path = path;
(* Conversion can fail if there is no space on the guest filesystems
* (RHBZ#1139543). To avoid this situation, check there is some
* headroom. Mainly we care about the root filesystem.
+ *
+ * Also make sure filesystems have available inodes. (RHBZ#1764569)
*)
and check_guest_free_space mpstats =
message (f_"Checking for sufficient free disk space in the guest");
@@ -399,14 +401,21 @@ and check_guest_free_space mpstats =
10_000_000L
in
+ (* Reasonable headroom for conversion operations. *)
+ let needed_inodes = 100L in
+
List.iter (
- fun { mp_path; mp_statvfs = { G.bfree; bsize } } ->
+ fun { mp_path; mp_statvfs = { G.bfree; bsize; files; ffree } } ->
(* bfree = free blocks for root user *)
let free_bytes = bfree *^ bsize in
let needed_bytes = needed_bytes_for_mp mp_path in
if free_bytes < needed_bytes then
error (f_"not enough free space for conversion on filesystem ‘%s’. %Ld bytes free < %Ld bytes needed")
- mp_path free_bytes needed_bytes
+ mp_path free_bytes needed_bytes;
+ (* Not all the filesystems have inode counts. *)
+ if files > 0L && ffree < needed_inodes then
+ error (f_"not enough available inodes for conversion on filesystem ‘%s’. %Ld inodes available < %Ld inodes needed")
+ mp_path ffree needed_inodes
) mpstats
(* Perform the fstrim. *)
--
2.21.0
4 years, 12 months
[PATCH v3 0/6] remove unused build stuff
by Pino Toscano
This is an extended version of:
https://www.redhat.com/archives/libguestfs/2019-September/msg00288.html
Apparently I forgot it on my tree, so I'm posting that series again,
adding an extra cleanup more due to the v2v/common splits.
Pino Toscano (6):
tests: switch away from xgetcwd
daemon: move read_whole_file to common utils
daemon: switch from read_file to read_whole_file
daemon: remove unused include
build: remove unused gnulib modules
build: ignore unused submodules
Makefile.am | 4 ---
bootstrap | 17 ---------
configure.ac | 2 --
daemon/9p.c | 58 +-----------------------------
daemon/Makefile.am | 4 ---
daemon/cpio.c | 2 --
daemon/daemon.h | 1 +
daemon/ntfsclone.c | 4 +--
daemon/tar.c | 4 +--
daemon/utils.c | 58 ++++++++++++++++++++++++++++++
lib/Makefile.am | 5 ---
m4/.gitignore | 52 ---------------------------
tests/c-api/test-add-libvirt-dom.c | 10 +++---
13 files changed, 66 insertions(+), 155 deletions(-)
--
2.21.0
4 years, 12 months