[libnbd PATCH 0/4] copy: wrap source code at 80 characters
by Laszlo Ersek
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172516
I figured I'd work on the libnbd line wrapping in shorter waves than how
long the nbdkit patch series was.
Laszlo
Laszlo Ersek (4):
copy: rename (LONG|SHORT)_OPTIONS to (LONG|SHORT)_OPTIONS_OPTION
copy: rename <purpose>_OPTION to OPT_<purpose>
copy: fix layout of "long_options" table
copy: rewrap error message about stuck NBD server
copy/main.c | 76 ++++++++++----------
copy/nbd-ops.c | 5 +-
2 files changed, 42 insertions(+), 39 deletions(-)
base-commit: 30d8e6414bdeff079394552e4227d80304b08532
1 year, 7 months
[nbdkit PATCH 00/17] wrap source code at 80 chars
by Laszlo Ersek
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172516
This series wraps the *C-language* *.[ch] source files at 80 characters,
as much as possible.
Some lines are impossible to wrap: those are URLs.
Considering files that contain such lines (URLs), we can form two
classes:
- in the first class of files, we still wrap some other lines, so those
files are modified by this patch series, and the corresponding commit
messages highlight the fact that the total widths of the affected
source files remain above 80 characters;
- in the second class of files, there is nothing else to wrap, so I'm
listing those files only here:
common/replacements/poll.c
common/utils/utils.c
filters/luks/luks-encryption.h
plugins/file/winfile.c
wrapper.c
"It was painful to write and test, it should be painful to review (TM)"
¯\_(ツ)_/¯
Cc: Nolan Leake <nolan(a)sigbus.net>
Thanks!
Laszlo
Laszlo Ersek (17):
common/utils/utils.h: wrap source code at 80 chars
common/utils/windows-compat.h: wrap source code at 80 chars
filters/cache: wrap source code at 80 chars
filters/exportname: wrap source code at 80 chars
filters/ext2: wrap source code at 80 chars
filters/extentlist: wrap source code at 80 chars
filters/noparallel: wrap source code at 80 chars
filters/nozero: wrap source code at 80 chars
filters/partition: wrap source code at 80 chars
include/nbdkit-plugin.h: wrap source code at 80 chars
plugins/floppy: wrap source code at 80 chars
plugins/nbd: wrap source code at 80 chars
plugins/perl: wrap source code at 80 chars
plugins/ruby: wrap source code at 80 chars
plugins/sh: wrap source code at 80 chars
plugins/vddk: wrap source code at 80 chars
server: wrap source code at 80 chars
common/utils/utils.h | 3 +-
common/utils/windows-compat.h | 11 +++---
filters/cache/cache.c | 3 +-
filters/exportname/exportname.c | 17 ++++----
filters/ext2/ext2.c | 6 +--
filters/extentlist/extentlist.c | 13 ++++---
filters/noparallel/noparallel.c | 5 ++-
filters/nozero/nozero.c | 5 ++-
filters/partition/partition.c | 3 +-
include/nbdkit-plugin.h | 3 +-
plugins/floppy/directory-lfn.c | 13 +++++--
plugins/floppy/virtual-floppy.c | 19 ++++++---
plugins/nbd/nbd.c | 41 +++++++++++---------
plugins/perl/perl.c | 2 +-
plugins/ruby/ruby.c | 3 +-
plugins/sh/call.c | 2 +-
plugins/vddk/vddk.c | 12 ++++--
server/filters.c | 2 +-
server/internal.h | 7 +++-
server/main.c | 6 ++-
server/plugins.c | 2 +-
21 files changed, 108 insertions(+), 70 deletions(-)
base-commit: 50f87e4995906bbcd00014932d1837ed16131b8e
1 year, 7 months
[PATCH nbdkit] tests: Add a test of floppy plugin + size parameter
by Richard W.M. Jones
See: https://listman.redhat.com/archives/libguestfs/2023-April/031243.html
Updates: commit c6d6113fa1f38389dbc27f000d06c425cbe912cd
---
tests/Makefile.am | 10 +++++--
tests/test-floppy-size.sh | 61 +++++++++++++++++++++++++++++++++++++++
2 files changed, 69 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9b846d246..a080765f2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -818,8 +818,14 @@ test_file_block_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
test_file_block_LDADD = libtest.la $(LIBGUESTFS_LIBS)
# floppy plugin test.
-TESTS += test-floppy.sh
-EXTRA_DIST += test-floppy.sh
+TESTS += \
+ test-floppy.sh \
+ test-floppy-size.sh \
+ $(NULL)
+EXTRA_DIST += \
+ test-floppy.sh \
+ test-floppy-size.sh \
+ $(NULL)
# full plugin test.
TESTS += test-full.sh
diff --git a/tests/test-floppy-size.sh b/tests/test-floppy-size.sh
new file mode 100755
index 000000000..f59c0edfa
--- /dev/null
+++ b/tests/test-floppy-size.sh
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+# nbdkit
+# Copyright Red Hat
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the name of Red Hat nor the names of its contributors may be
+# used to endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+# Test the floppy / FAT32 plugin with the size= parameter.
+
+source ./functions.sh
+set -e
+
+requires_plugin floppy
+requires guestfish --version
+
+sock=$(mktemp -u /tmp/nbdkit-test-sock.XXXXXX)
+files="floppy-size.pid $sock"
+rm -f $files
+cleanup_fn rm -f $files
+
+# When testing this we need to use a directory which won't change
+# during the test (so not the current directory).
+start_nbdkit -P floppy-size.pid -U $sock \
+ --filter=cow \
+ floppy $srcdir/../plugins/floppy size=2G
+
+# Check the floppy content.
+guestfish --rw --format=raw -a "nbd://?socket=$sock" -m /dev/sda1 <<'EOF'
+ ll /floppy.c
+ ll /nbdkit-floppy-plugin.pod
+
+# Because of size= parameter there should be enough free space
+# to write a large file.
+ df-h
+ fill-pattern hello 100M /fill
+EOF
--
2.39.2
1 year, 7 months
[V2V PATCH v3 0/6] Bring support for virtio-scsi back to Windows
by Andrey Drobyshev
Discussion on v2:
https://listman.redhat.com/archives/libguestfs/2023-March/030987.html
v2 -> v3:
* Patch 2/6 ("convert_windows: add Inject_virtio_win.Virtio_SCSI as a
possible block type"): omit "Inject_virtio_win." prefix in favor of type
inference. Add a short commit message body;
* Add tests/test-v2v-block-driver.sh testing the new "--block-driver"
option.
Discussion on v1:
https://listman.redhat.com/archives/libguestfs/2023-February/030849.html
https://listman.redhat.com/archives/libguestfs/2023-March/030917.html
v1 -> v2:
* Adapt the patch suggested by Richard, splitting it up into 3:
https://listman.redhat.com/archives/libguestfs/2023-March/030975.html
Now we have "--block-driver" command line option which regulates the
order in which block drivers are being searched for (and, as a
consequence, the default driver).
Andrey Drobyshev (3):
Revert "Remove guestcaps_block_type Virtio_SCSI"
convert_windows: add Inject_virtio_win.Virtio_SCSI as a possible block
type
tests: add --block-driver option test
Richard W.M. Jones (3):
convert: introduce "block_driver" convert option
convert_windows: set block driver priority according to block_driver
option
v2v, in-place: introduce --block-driver command line option
convert/convert.ml | 11 ++-
convert/convert.mli | 1 +
convert/convert_linux.ml | 11 ++-
convert/convert_linux.mli | 3 +-
convert/convert_windows.ml | 11 ++-
convert/convert_windows.mli | 3 +-
convert/target_bus_assignment.ml | 1 +
docs/virt-v2v-in-place.pod | 10 ++
docs/virt-v2v.pod | 10 ++
in-place/in_place.ml | 12 ++-
inspector/inspector.ml | 3 +-
lib/create_ovf.ml | 1 +
lib/types.ml | 3 +-
lib/types.mli | 2 +-
output/openstack_image_properties.ml | 7 ++
tests/Makefile.am | 2 +
tests/test-v2v-block-driver.sh | 143 +++++++++++++++++++++++++++
v2v/v2v.ml | 12 ++-
18 files changed, 231 insertions(+), 15 deletions(-)
create mode 100755 tests/test-v2v-block-driver.sh
--
2.31.1
1 year, 7 months
[libguestfs-common PATCH 0/2] detect_kernels: deal with RHEL's kernel-core / kernel-modules-core split
by Laszlo Ersek
https://bugzilla.redhat.com/show_bug.cgi?id=2175703
Vera Wu's testing covered a backport of this series to the virt-v2v
project's rhel-9.2 branch (on top of commit 86517b17be98), where the
"detect_kernels" function is still unique/internal to the virt-v2v
project. The backport / cherry-pick from libguestfs-common to virt-v2v
cannot be automated, but it's not difficult; only file names in the
patch files change.
The first patch is split out only in order not to muddy the second
patch; the second patch requires some eyeballing anyway, so keeping it
focused is good.
Laszlo
Laszlo Ersek (2):
detect_kernels: tighten "try" scope
detect_kernels: deal with RHEL's kernel-core / kernel-modules-core
split
mldrivers/linux_kernels.ml | 26 ++++++++++++++------
1 file changed, 19 insertions(+), 7 deletions(-)
base-commit: 402f7600d7077cc0c60b75cfc72413af93dc4e6e
1 year, 7 months
VM name starting with a dash
by Richard W.M. Jones
13:19 < tgolembi[m]> is there a trick how to convert a VM with name that starts with a dash? It's being confused for virt-v2v argument.
:)
Yes you can do this:
$ virt-v2v -o [etc...] -- vmname
Note all -options need to come before the "--".
For example:
$ virt-builder fedora-35
$ mv fedora-35.img ./-fedora-35.img
$ virt-v2v -i disk -o null -- -fedora-35.img
[ 0.0] Setting up the source: -i disk -fedora-35.img
[etc]
It's quite possible this could hit other corner-cases inside virt-v2v
(eg when running subprocesses), so if you see bugs please file them.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
1 year, 7 months
[PATCH RHEL 8 only, common] RHEL 8: If setfiles fails fall back to autorelabel
by Richard W.M. Jones
SFDC case 03473932, RHEL 8 only.
See discussion in private email thread "Customer case requiring our
assistance" in 2023.
---
mlcustomize/SELinux_relabel.ml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mlcustomize/SELinux_relabel.ml b/mlcustomize/SELinux_relabel.ml
index 5ecf7bd..f0630db 100644
--- a/mlcustomize/SELinux_relabel.ml
+++ b/mlcustomize/SELinux_relabel.ml
@@ -35,11 +35,12 @@ let rec relabel (g : G.guestfs) =
use_setfiles g;
(* That worked, so we don't need to autorelabel. *)
g#rm_f "/.autorelabel"
- with Failure _ ->
+ with Failure _
(* This is the fallback in case something in the setfiles
* method didn't work. That includes the case where a non-SELinux
* host is processing an SELinux guest, and other things.
*)
+ | Guestfs.Error _ -> (* this is for SFDC case 03473932 in RHEL 8 only *)
g#touch "/.autorelabel"
)
--
2.39.1
1 year, 7 months