Re: [Libguestfs] [virt-v2v PATCH 2/3] lib/nbdkit: add the "Nbdkit.get_disk_allocated" helper function

2021-12-09 Thread Richard W.M. Jones
On Thu, Dec 09, 2021 at 11:55:49AM +0100, Laszlo Ersek wrote: > On 12/08/21 16:21, Richard W.M. Jones wrote: > > On Wed, Dec 08, 2021 at 01:20:49PM +0100, Laszlo Ersek wrote: > >> Add the "Nbdkit.get_disk_allocated" helper function, which calculates the > >> n

Re: [Libguestfs] [virt-v2v PATCH 1/3] lib/nbdkit: add the "Nbdkit.with_connect_unix" helper function

2021-12-09 Thread Richard W.M. Jones
On Thu, Dec 09, 2021 at 11:47:12AM +0100, Laszlo Ersek wrote: > On 12/08/21 16:18, Richard W.M. Jones wrote: > > On Wed, Dec 08, 2021 at 01:20:48PM +0100, Laszlo Ersek wrote: > >> Connecting to an NBD server temporarily, for a "one-shot" operation, is > >> qui

Re: [Libguestfs] guestfs-tools for *BSD images

2021-12-09 Thread Richard W.M. Jones
So I should add that one-off changes are still possible, albeit they have to be done manually. You could try: $ virt-rescue -a openbsd.img Inside the rescue shell you can mount the disk using the correct ufstype= mount option, eg: > mount -o ufstype=WHATEVER /dev/sda1 /sysroot/ You can also

Re: [Libguestfs] [PATCH common v2] utils: Fix usage of strerror_r

2021-12-09 Thread Richard W.M. Jones
On Thu, Dec 09, 2021 at 09:05:45AM +, Richard W.M. Jones wrote: > diff --git a/utils/guestfs-utils.h b/utils/guestfs-utils.h > index b5f5f3ca4..b1d923e0e 100644 > --- a/utils/guestfs-utils.h > +++ b/utils/guestfs-utils.h > @@ -67,6 +67,7 @@ extern int guestfs_int_is_ln

[Libguestfs] [PATCH v2] lib, lua: Fix usage of strerror_r

2021-12-09 Thread Richard W.M. Jones
$ ./run guestfish -vx add-drive foo "readonly:true" libguestfs: trace: set_pgroup true libguestfs: trace: set_pgroup = 0 libguestfs: trace: add_drive "foo" "readonly:true" libguestfs: error: foo: libguestfs: trace: add_drive = -1 (error) libguestfs: trace: close libguestfs: closing

[Libguestfs] [PATCH common v2] utils: Fix usage of strerror_r

2021-12-09 Thread Richard W.M. Jones
$ ./run guestfish -vx add-drive foo "readonly:true" libguestfs: trace: set_pgroup true libguestfs: trace: set_pgroup = 0 libguestfs: trace: add_drive "foo" "readonly:true" libguestfs: error: foo: libguestfs: trace: add_drive = -1 (error) libguestfs: trace: close libguestfs: closing

[Libguestfs] [PATCH common v2] utils: Fix usage of strerror_r

2021-12-09 Thread Richard W.M. Jones
Slightly modified version of the previous fix, but essentially the same thing. I have put the change into common/utils/utils.c so that I could use the same code to fix the Lua bindings which were also calling strerror_r incorrectly. Rich. ___

[Libguestfs] [PATCH] lib/errors.c: Fix usage of strerror_r

2021-12-08 Thread Richard W.M. Jones
$ ./run guestfish -vx add-drive foo "readonly:true" libguestfs: trace: set_pgroup true libguestfs: trace: set_pgroup = 0 libguestfs: trace: add_drive "foo" "readonly:true" libguestfs: error: foo: libguestfs: trace: add_drive = -1 (error) libguestfs: trace: close libguestfs: closing

Re: [Libguestfs] [virt-v2v PATCH 3/3] lib/create_ovf: populate "actual size" attributes again

2021-12-08 Thread Richard W.M. Jones
On Wed, Dec 08, 2021 at 01:20:50PM +0100, Laszlo Ersek wrote: > Commit 255722cbf39a ("v2v: Modular virt-v2v", 2021-09-07) removed the > following attributes from the OVF output: > > - ovf:Envelope/References/File/@ovf:size > -

Re: [Libguestfs] [virt-v2v PATCH 2/3] lib/nbdkit: add the "Nbdkit.get_disk_allocated" helper function

2021-12-08 Thread Richard W.M. Jones
On Wed, Dec 08, 2021 at 01:20:49PM +0100, Laszlo Ersek wrote: > Add the "Nbdkit.get_disk_allocated" helper function, which calculates the > number of allocated bytes in an output disk image, through a corresponding > NBD server connection. > > Original "NBD.block_status" summation example code by

Re: [Libguestfs] [virt-v2v PATCH 1/3] lib/nbdkit: add the "Nbdkit.with_connect_unix" helper function

2021-12-08 Thread Richard W.M. Jones
On Wed, Dec 08, 2021 at 01:20:48PM +0100, Laszlo Ersek wrote: > Connecting to an NBD server temporarily, for a "one-shot" operation, is > quite similar to "Std_utils.with_open_in" and "Std_utils.with_open_out", > as there are cleanup operations regardless of whether the "one-shot" > operation

Re: [Libguestfs] [PATCH nbdkit] file: Fix implementation of cache=none for writes

2021-12-08 Thread Richard W.M. Jones
On Wed, Dec 08, 2021 at 01:51:40PM +0100, Laszlo Ersek wrote: > On 12/08/21 00:07, Richard W.M. Jones wrote: > > When testing virt-v2v we found that cache=none had very pessimal > > performance in its current implementation when writing. See: > > > > > > https

Re: [Libguestfs] guestfs-tools for *BSD images

2021-12-08 Thread Richard W.M. Jones
On Tue, Dec 07, 2021 at 12:18:30PM -0600, Brady Pratt wrote: > [    1.998352] >>>WARNING<<< Wrong ufstype may corrupt your filesystem, > default > is ufstype=old The problem is this one and it's not easily resolvable. UFS isn't a single filesystem type, it's a clade of filesystems which all

[Libguestfs] [PATCH nbdkit] file: Fix implementation of cache=none for writes

2021-12-07 Thread Richard W.M. Jones
When testing virt-v2v we found that cache=none had very pessimal performance in its current implementation when writing. See: https://github.com/libguestfs/virt-v2v/commit/ac59d3b2310511b1537d408b675b19ec9a5d384e However we know of a much better implementation - the one in nbdcopy. This

[Libguestfs] [PATCH v2v] output: Don't use nbdkit-file-plugin cache=none when writing

2021-12-07 Thread Richard W.M. Jones
I think I'm going to push this because it seems a clear enough problem / fix to me. However I'm CC-ing to you because I think this is a real problem in nbdkit-file-plugin. Rich. ___ Libguestfs mailing list Libguestfs@redhat.com

[Libguestfs] [PATCH v2v] output: Don't use nbdkit-file-plugin cache=none when writing

2021-12-07 Thread Richard W.M. Jones
nbdkit-file-plugin flag cache=none is meant to ensure that the file plugin does not pollute the page cache. However it doesn't yet work very well, especially for writing. As you can see here:

[Libguestfs] [PATCH v2v] input: Disable multi-conn in VDDK input mode

2021-12-06 Thread Richard W.M. Jones
I already pushed this commit, but I'm sending it to the list because it reveals an interesting and unexpected side effect of nbdkit-cow-filter (see commit message). I wonder if we want to add a cow-multi-conn=false flag? Rich. ___ Libguestfs mailing

[Libguestfs] [PATCH v2v] input: Disable multi-conn in VDDK input mode

2021-12-06 Thread Richard W.M. Jones
The cow filter unconditionally enables multi-conn (because it is safe). However this causes an unintended consequence with the VDDK plugin. Multiple VDDK handles are opened (one per multi-conn connection), and for some reason, possibly internal locking, they conflict with each other. This

Re: [Libguestfs] [PATCH libnbd 0/3] generator: Reset line directive after included code in lib/states.c

2021-12-03 Thread Richard W.M. Jones
On Fri, Dec 03, 2021 at 01:56:02PM -0600, Eric Blake wrote: > On Fri, Dec 03, 2021 at 07:38:49PM +0000, Richard W.M. Jones wrote: > > > > Alas, generator/states.c. Here's how I tested. In particular, note > > > that you MUST use an off-by-one #line direct

Re: [Libguestfs] [PATCH libnbd 0/3] generator: Reset line directive after included code in lib/states.c

2021-12-03 Thread Richard W.M. Jones
On Fri, Dec 03, 2021 at 01:36:19PM -0600, Eric Blake wrote: > On Fri, Dec 03, 2021 at 07:11:46PM +0000, Richard W.M. Jones wrote: > > On Fri, Dec 03, 2021 at 07:02:07PM +, Richard W.M. Jones wrote: > > > This restores the #line directives (probably?) The output looks > &g

Re: [Libguestfs] [PATCH libnbd 0/3] generator: Reset line directive after included code in lib/states.c

2021-12-03 Thread Richard W.M. Jones
On Fri, Dec 03, 2021 at 07:02:07PM +, Richard W.M. Jones wrote: > This restores the #line directives (probably?) The output looks > right, but I didn't test it beyond opening it in the editor. Do #line > directives have a way to indicate "current file"? What I mean is tha

Re: [Libguestfs] [libnbd PATCH] maint: Suggest better diff output for API.ml

2021-12-03 Thread Richard W.M. Jones
On Fri, Dec 03, 2021 at 08:44:03AM -0600, Eric Blake wrote: > On Fri, Dec 03, 2021 at 08:35:18AM -0600, Eric Blake wrote: > > Git diff is able to customize the regex used to locate "function > > headers", or the text to output on @@ lines of a patch to make it > > easier to determine which portion

[Libguestfs] [PATCH libnbd 3/3] generator: Reset line directive after included code in lib/states.c

2021-12-03 Thread Richard W.M. Jones
--- TODO | 6 -- generator/state_machine_generator.ml | 2 ++ generator/utils.ml | 2 ++ generator/utils.mli | 1 + 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 3861edc40..39642bc15 100644

[Libguestfs] [PATCH libnbd 1/3] generator: Move location code from State_machine to Utils

2021-12-03 Thread Richard W.M. Jones
Move the type [location] and the values [noloc], [string_of_location] and [line_directive_of_location] to [Utils]. Straightforward code motion, no change in functionality. --- generator/state_machine.ml | 12 +++- generator/state_machine.mli | 7 +-- generator/utils.ml |

[Libguestfs] [PATCH libnbd 2/3] generator: Maintain current line number in output internally

2021-12-03 Thread Richard W.M. Jones
This keeps track of the current line number in the output file internally (counting from 1). It is not used for any purpose in this commit. --- generator/utils.ml | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/generator/utils.ml

[Libguestfs] [PATCH libnbd 0/3] generator: Reset line directive after included code in lib/states.c

2021-12-03 Thread Richard W.M. Jones
This restores the #line directives (probably?) The output looks right, but I didn't test it beyond opening it in the editor. Do #line directives have a way to indicate "current file"? Rich. ___ Libguestfs mailing list Libguestfs@redhat.com

Re: [Libguestfs] [PATCH libnbd] golang: make-dist.sh: Use strict ISO 8601 format

2021-12-03 Thread Richard W.M. Jones
On Fri, Dec 03, 2021 at 12:18:27AM +0200, Nir Soffer wrote: > Go fail to parse the short date format (2021-11-30) from the @latest and > .info file. Replace with %cI - strict ISO 8601 format. > > Signed-off-by: Nir Soffer > --- > golang/make-dist.sh | 4 +++- > 1 file changed, 3 insertions(+),

Re: [Libguestfs] [guestfs-tools PATCH] sysprep: remove system-local NetworkManager connection profiles (keyfiles)

2021-12-02 Thread Richard W.M. Jones
On Thu, Dec 02, 2021 at 02:10:06PM +0100, Laszlo Ersek wrote: > Add a simple (default) operation to remove > > /etc/NetworkManager/system-connections/*.nmconnection > > which arguably carry stale information after the initial creation of the > system disk image. > > Note: no side effect

Re: [Libguestfs] [virt-v2v wave 2 PATCH v2 00/16] replace QXL (and Cirrus) with standard VGA

2021-12-02 Thread Richard W.M. Jones
On Thu, Dec 02, 2021 at 10:13:29AM +, Richard W.M. Jones wrote: > On Thu, Dec 02, 2021 at 11:09:15AM +0100, Laszlo Ersek wrote: > > On 12/02/21 10:46, Laszlo Ersek wrote: > > > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1961107 > > > v1: >

Re: [Libguestfs] [virt-v2v wave 2 PATCH v2 00/16] replace QXL (and Cirrus) with standard VGA

2021-12-02 Thread Richard W.M. Jones
On Thu, Dec 02, 2021 at 11:09:15AM +0100, Laszlo Ersek wrote: > On 12/02/21 10:46, Laszlo Ersek wrote: > > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1961107 > > v1: > > https://listman.redhat.com/archives/libguestfs/2021-November/msg00150.html > > > > Please see the v2 changes

Re: [Libguestfs] [libnbd PATCH v2] python: Fix more callback memory leaks

2021-11-30 Thread Richard W.M. Jones
ACK, thanks. We likely need this in RHEL 9 ... I'll take care of that once it's been pushed. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests

Re: [Libguestfs] [nbdkit PATCH v3 3/3] common/include/checked-overflow: provide fallback

2021-11-30 Thread Richard W.M. Jones
On Tue, Nov 30, 2021 at 01:12:06PM +0100, Laszlo Ersek wrote: > On 11/28/21 14:58, Laszlo Ersek wrote: > > On 11/26/21 16:47, Richard W.M. Jones wrote: > >> > >> Series looks great now, thanks. > >> > >> ACK > > > > Commit range 370ecb711c2

Re: [Libguestfs] [PATCH libnbd] podwrapper.pl.in: Use short commit date

2021-11-29 Thread Richard W.M. Jones
On Mon, Nov 29, 2021 at 03:37:47PM +0200, Nir Soffer wrote: > On Mon, Nov 29, 2021 at 3:12 PM Richard W.M. Jones wrote: > > > > On Mon, Nov 08, 2021 at 06:06:40PM +0000, Richard W.M. Jones wrote: > > > On Mon, Nov 08, 2021 at 07:55:51PM +0200, Nir Soffer wrote: > > &

Re: [Libguestfs] [PATCH libnbd] podwrapper.pl.in: Use short commit date

2021-11-29 Thread Richard W.M. Jones
On Mon, Nov 08, 2021 at 06:06:40PM +, Richard W.M. Jones wrote: > On Mon, Nov 08, 2021 at 07:55:51PM +0200, Nir Soffer wrote: > > We can use git short commit date format $cs. Maybe it was not available > > when podwrapper.pl was create. > > > >

Re: [Libguestfs] [nbdkit PATCH v3 3/3] common/include/checked-overflow: provide fallback

2021-11-26 Thread Richard W.M. Jones
Series looks great now, thanks. ACK Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual

Re: [Libguestfs] [PATCH nbdkit v2 follow-up 2/4] Add __attribute__((__unused__))

2021-11-25 Thread Richard W.M. Jones
On Thu, Nov 25, 2021 at 04:55:25PM +0100, Laszlo Ersek wrote: > On 11/25/21 16:30, Richard W.M. Jones wrote: > > ../../common/include/checked-overflow.h:164:18: error: typedef > > 'x_has_uint_type' locally defined but not used > > [-Werror=unused-local-typedefs]

Re: [Libguestfs] [PATCH v3 4/5] daemon/parted: work around part table type misreporting by "parted"

2021-11-25 Thread Richard W.M. Jones
On Thu, Nov 25, 2021 at 04:27:42PM +0100, Laszlo Ersek wrote: > It provides the following examples, and states that they are equivalent: > > let sum = fun i j -> i + j;; > let sum = (fun i -> (fun j -> i + j));; > let sum i j = i + j;; > > Why is the usage of "fun" awkward here? They are

[Libguestfs] [PATCH nbdkit v2 follow-up 0/4] Miscellaneous fixes

2021-11-25 Thread Richard W.M. Jones
Follow-up to this patch: https://listman.redhat.com/archives/libguestfs/2021-November/msg00251.html Patches 1-3 are probably down to over-active warnings in the old version of GCC. Patch 3 in particular is bogus, but needed to get around the warning. Patch 4 moves the test so it's next to the

[Libguestfs] [PATCH nbdkit v2 follow-up 3/4] Avoid shadowed declaration

2021-11-25 Thread Richard W.M. Jones
In file included from test-checked-overflow.c:38:0: ../../common/include/checked-overflow.h:146:10: error: declaration of ‘overflow’ shadows a previous local [-Werror=shadow] bool overflow; \ ^ ---

[Libguestfs] [PATCH nbdkit v2 follow-up 4/4] Move test binary to common/include

2021-11-25 Thread Richard W.M. Jones
So it is next to the header file which it tests. --- common/include/Makefile.am| 5 + common/utils/Makefile.am | 8 ++-- common/{utils => include}/test-checked-overflow.c | 0 .gitignore| 1 + 4 files

[Libguestfs] [PATCH nbdkit v2 follow-up 2/4] Add __attribute__((__unused__))

2021-11-25 Thread Richard W.M. Jones
../../common/include/checked-overflow.h:164:18: error: typedef 'x_has_uint_type' locally defined but not used [-Werror=unused-local-typedefs] typedef char x_has_uint_type[(typeof (x))-1 > 0 ? 1 : -1]; \ ^ --- common/include/checked-overflow.h | 2 +- 1 file changed, 1

[Libguestfs] [PATCH nbdkit v2 follow-up 1/4] Add parentheses where suggested by RHEL 7 GCC 4.8.5

2021-11-25 Thread Richard W.M. Jones
In file included from vector.c:39:0: ../../common/include/checked-overflow.h: In function 'check_mul_overflow': ../../common/include/checked-overflow.h:191:45: error: suggest parentheses around '&&' within '||' [-Werror=parentheses] in_range = b == 0 || a <= UINTMAX_MAX / b && *r <= max;

Re: [Libguestfs] [nbdkit PATCH v2 2/2] common/include/checked-overflow: provide fallback

2021-11-25 Thread Richard W.M. Jones
I had a few issues when compiling on RHEL 7, will send a patch series on top of this in a moment. (You might as well fold those into patch 2 before pushing.) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog:

Re: [Libguestfs] [PATCH v3 4/5] daemon/parted: work around part table type misreporting by "parted"

2021-11-25 Thread Richard W.M. Jones
e forced up to and including 255MB disk size. > > Add the helper function "has_bogus_mbr" to the Utils module; we'll use it > elsewhere too. > > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1931821 > Signed-off-by: Laszlo Ersek > Acked-by: Ri

Re: [Libguestfs] [PATCH v2 4/5] daemon/parted: work around part table type misreporting by "parted"

2021-11-25 Thread Richard W.M. Jones
On Thu, Nov 25, 2021 at 09:54:30AM +0100, Laszlo Ersek wrote: > On 11/24/21 17:47, Richard W.M. Jones wrote: > > On Wed, Nov 24, 2021 at 11:37:46AM +0100, Laszlo Ersek wrote: > >> +let has_bogus_mbr device = > >> + try > >> +with_openfile de

Re: [Libguestfs] [PATCH v2 4/5] daemon/parted: work around part table type misreporting by "parted"

2021-11-25 Thread Richard W.M. Jones
On Thu, Nov 25, 2021 at 09:40:29AM +0100, Laszlo Ersek wrote: > On 11/24/21 17:45, Richard W.M. Jones wrote: > > On Wed, Nov 24, 2021 at 11:37:46AM +0100, Laszlo Ersek wrote: > >> "parted" incorrectly reports "loop" rather than "msdos" for the part

Re: [Libguestfs] [PATCH v2 5/5] daemon/listfs: don't call "sgdisk -i" on bogus MBR partition table entry

2021-11-24 Thread Richard W.M. Jones
On Wed, Nov 24, 2021 at 11:37:47AM +0100, Laszlo Ersek wrote: > The "is_partition_can_hold_filesystem" function calls > "Parted.part_get_gpt_type" on the partition if: > - the partition table type is GPT, > - or the partition table type is MBR, and the partition is primary or > logical. > > The

Re: [Libguestfs] [PATCH v2 4/5] daemon/parted: work around part table type misreporting by "parted"

2021-11-24 Thread Richard W.M. Jones
On Wed, Nov 24, 2021 at 11:37:46AM +0100, Laszlo Ersek wrote: > +let has_bogus_mbr device = > + try > +with_openfile device [O_RDONLY; O_CLOEXEC] 0 (fun fd -> > + let sec0size = 0x200 > + and sigofs = 0x1FE > + and sysidofs = 0x003 and sysidsize = 0x008 > + and pte1ofs =

Re: [Libguestfs] [PATCH v2 4/5] daemon/parted: work around part table type misreporting by "parted"

2021-11-24 Thread Richard W.M. Jones
On Wed, Nov 24, 2021 at 11:37:46AM +0100, Laszlo Ersek wrote: > "parted" incorrectly reports "loop" rather than "msdos" for the partition > table type, when the (fake) partition table comes from the "--mbr" option > of "mkfs.fat" (in dosfstools-4.2+), and the FAT variant in question is > FAT16 or

Re: [Libguestfs] [PATCH v2 3/5] daemon/parted: simplify print_partition_table() prototype

2021-11-24 Thread Richard W.M. Jones
On Wed, Nov 24, 2021 at 11:43:08AM +0100, Laszlo Ersek wrote: > On 11/24/21 11:37, Laszlo Ersek wrote: > > Since commit 994ca1f8ebcc ("daemon: Reimplement 'part_get_mbr_part_type' > > API in OCaml.", 2018-05-02), we've not had any calls to > > print_partition_table() that would pass a "true"

Re: [Libguestfs] [PATCH nbdkit 2/2] common/include/checked-overflow.h: Provide fallback

2021-11-23 Thread Richard W.M. Jones
On Tue, Nov 23, 2021 at 04:19:08PM +0100, Laszlo Ersek wrote: > On 11/23/21 11:44, Laszlo Ersek wrote: > > So: the fallbacks need to be available (= built) in the source code > > unconditionally, so they can be directly called by the test suite. The > > actual "falling back" to them must be

Re: [Libguestfs] [PATCH nbdkit 2/2] common/include/checked-overflow.h: Provide fallback

2021-11-23 Thread Richard W.M. Jones
On Tue, Nov 23, 2021 at 11:44:06AM +0100, Laszlo Ersek wrote: > On 11/22/21 23:31, Richard W.M. Jones wrote: > > My only other thought is that a simple set of tests could be good. > > However it's not worth having tests that only test if __builtin* > > functions are c

Re: [Libguestfs] [PATCH] daemon/mkfs: disable creation of fake MBR partition table with "mkfs.fat"

2021-11-23 Thread Richard W.M. Jones
, "vfat") || > + STREQ (fstype, "msdos")) { > +if (fat_mbr_option == FMO_UNCHECKED) { > + CLEANUP_FREE char *usage_err = NULL; > + > + fat_mbr_option = FMO_DOESNT_EXIST; > + /* Invoking either version 3 of version 4 of mkfs.fat without

Re: [Libguestfs] [PATCH] xfs: Document lazy-counters setting cannot be changed in XFS version 5

2021-11-23 Thread Richard W.M. Jones
On Tue, Nov 23, 2021 at 01:29:14PM +0100, Laszlo Ersek wrote: > On 11/22/21 16:11, Richard W.M. Jones wrote: > > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2024022 > > --- > > generator/actions_core.ml | 5 - > > 1 file changed, 4 insertions(+), 1 dele

Re: [Libguestfs] [PATCH nbdkit 2/2] common/include/checked-overflow.h: Provide fallback

2021-11-22 Thread Richard W.M. Jones
(Catching up ...) The maths looked reasonable. Did you have a version of the patch for review? My only other thought is that a simple set of tests could be good. However it's not worth having tests that only test if __builtin* functions are correct (hopefully GCC is already testing that). So

[Libguestfs] [PATCH] xfs: Document lazy-counters setting cannot be changed in XFS version 5

2021-11-22 Thread Richard W.M. Jones
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2024022 --- generator/actions_core.ml | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generator/actions_core.ml b/generator/actions_core.ml index 5933282dcf..226fb860a0 100644 --- a/generator/actions_core.ml +++

Re: [Libguestfs] [PATCH nbdkit 2/2] common/include/checked-overflow.h: Provide fallback

2021-11-19 Thread Richard W.M. Jones
On Fri, Nov 19, 2021 at 03:35:48PM +0100, Laszlo Ersek wrote: > (1) What is the usual style in nbdkit to highlight parameters of > functions and function-like macros in documentation (comments)? Here I > used parentheses. Normally I use quotes "". We don't have one, so quotes are fine. > (2) In

Re: [Libguestfs] [PATCH nbdkit 2/2] common/include/checked-overflow.h: Provide fallback

2021-11-17 Thread Richard W.M. Jones
On Mon, Nov 15, 2021 at 02:11:01PM +0100, Laszlo Ersek wrote: > (2) Should nbdkit continue building on RHEL7? In the OCaml upgrade > thread > > I thought we practically abandoned RHEL7 for the v2v projects. If I sound

[Libguestfs] [PATCH nbdkit v2 1/2] tests: Use compound literal array for nbd_connect_command parameter

2021-11-17 Thread Richard W.M. Jones
Instead of having a separate char *args[] local variable, we can use a compound literal array (C99 feature). This change is just refactoring. --- tests/README.tests | 7 --- tests/test-connect.c| 8 tests/test-curl-cookie-script.c | 21

Re: [Libguestfs] [PATCH nbdkit 1/2] ocaml: Simplify NBDKit.set_error

2021-11-17 Thread Richard W.M. Jones
On Mon, Nov 15, 2021 at 02:00:25PM +0100, Laszlo Ersek wrote: > On 11/15/21 13:14, Richard W.M. Jones wrote: > > (aren't you on PTO?) Eh hem .. > > -# This is somewhat different from the other tests because we have > > -# to build an actual plugin here. > > (1) I

[Libguestfs] [PATCH nbdkit v2 2/2] ocaml: Simplify NBDKit.set_error

2021-11-17 Thread Richard W.M. Jones
Using the function code_of_unix_error from we can greatly simplify this function. code_of_unix_error was added in OCaml 4.01 which is ≤ 4.03 that we currently require. See also: https://github.com/ocaml/ocaml/issues/4812 This does require a small change ot how OCaml plugins are linked -- we

[Libguestfs] [PATCH nbdkit v2 0/2] ocaml: Simplify NBDKit.set_error

2021-11-17 Thread Richard W.M. Jones
v1 was here: https://listman.redhat.com/archives/libguestfs/2021-November/msg00176.html This version addresses all or very nearly all of the feedback. I already posted v2 1/2, but including it again here since it is necessary for the 2/2 to make sense. Rich.

[Libguestfs] [PATCH nbdkit 2/2] common/include/checked-overflow.h: Provide fallback

2021-11-15 Thread Richard W.M. Jones
On RHEL 7 (GCC 4.8.5) we don't have __builtin_add_overflow and similar functions. They were first added in GCC 5. Provide a fallback path for these older compilers. Note that the fallback path does not actually implement overflow detection. --- configure.ac | 6 ++

[Libguestfs] [PATCH nbdkit 1/2] ocaml: Simplify NBDKit.set_error

2021-11-15 Thread Richard W.M. Jones
Using the function code_of_unix_error from we can greatly simplify this function. This function was added in OCaml 4.01 which is ≤ 4.03 that we currently require, and also ≤ 4.02.2 that was the minimum version supported since the OCaml plugin was added in 2014. See:

Re: [Libguestfs] [PATCH libnbd 0/6] Enhance synch-parallel test

2021-11-14 Thread Richard W.M. Jones
I'm lukewarm of this series, but I've got a few comments on it as well as some questions below. - In nbdkit we have a function tvdiff_usec (see common/include/tvdiff.h). Maybe we should use that instead of microtime? - Rather than having a single test that does multiple runs (and so runs

Re: [Libguestfs] libguestfs build failure

2021-11-12 Thread Richard W.M. Jones
It should work now with: libguestfs: https://github.com/libguestfs/libguestfs/commit/9fda9110e6a7afc1d418665f8f3538d87b5c8a5b guestfs-tools: https://github.com/rwmjones/guestfs-tools/commit/05946b64f896b334a337f6982033e0e98545207b virt-v2v:

Re: [Libguestfs] libguestfs build failure

2021-11-12 Thread Richard W.M. Jones
On Fri, Nov 12, 2021 at 02:50:00PM +0100, Laszlo Ersek wrote: > Hi, > > commit b536c61a6df3 ("m4: Remove test for OCaml Bytes module", > 2021-11-09) removed AM_CONDITIONAL([HAVE_BYTES_COMPAT_ML ... from > "m4/guestfs-ocaml.m4". However, in the common submodule, > "mlstdutils/Makefile.am" still

Re: [Libguestfs] [PATCH v2v v2] convert/convert_windows.ml: Handle date formats with dots instead of /

2021-11-12 Thread Richard W.M. Jones
v2 was slightly broken because of mismatched parentheses. Xiaodai Wang and myself iterated on this patch and came up with a final version that was tested on Windows and works: https://github.com/libguestfs/virt-v2v/commit/d9dc6c42ae64ba92993dbd9477f003ba73fcfa2f Rich. -- Richard Jones,

Re: [Libguestfs] [libguestfs/libguestfs] Provide a new "appliance" build based on 1.45.x (Issue #74)

2021-11-12 Thread Richard W.M. Jones
On Fri, Nov 12, 2021 at 01:51:39AM -0800, Cédric Jeanneret wrote: > Hello there, > > It would be really nice getting a new appliance build in order to > support newest CentOS Stream 9 virtual machines running on CentOS > Stream 8. Currently, there are issues with the filesystem - the same > kind

[Libguestfs] [PATCH v2v v2] convert/convert_windows.ml: Handle date formats with dots instead of /

2021-11-12 Thread Richard W.M. Jones
If the ShortDatePattern is yy.M.d (as can happen for US locale) we may not always reformat the date for schtasks.exe correctly. For explanation and testing see: https://bugzilla.redhat.com/show_bug.cgi?id=1895323#c46 (- #c50) Thanks: Xiaodai Wang for testing and bug fix suggestions Fixes:

[Libguestfs] [PATCH v2v] convert/convert_windows.ml: Handle date formats with dots instead of /

2021-11-12 Thread Richard W.M. Jones
If the ShortDatePattern is yy.M.d (as can happen for US locale) we may not always reformat the date for schtasks.exe correctly. For explanation and testing see: https://bugzilla.redhat.com/show_bug.cgi?id=1895323#c46 https://bugzilla.redhat.com/show_bug.cgi?id=1895323#c47

Re: [Libguestfs] [PATCH libnbd] common/include/checked-overflow.h: Simplify

2021-11-10 Thread Richard W.M. Jones
On Wed, Nov 10, 2021 at 12:56:26PM -0600, Eric Blake wrote: > On Wed, Nov 10, 2021 at 08:49:27PM +0200, Nir Soffer wrote: > > We don't need separate macros for size_t and uint64_t since the compiler > > builtins are generic. If we need to port to a complier that does not have > > generic builtins,

Re: [Libguestfs] libguestfs language bindings for CentOS/RHEL 9

2021-11-10 Thread Richard W.M. Jones
On Wed, Nov 10, 2021 at 11:08:09AM -0500, Neal Gompa wrote: > On Wed, Nov 10, 2021 at 9:00 AM Richard W.M. Jones wrote: > For PHP, the bindings are currently broken upstream.  Patches > welcome etc ... > > Is there a particular report indicating what's broken upstream th

Re: [Libguestfs] [PATCH libnbd] common/utils/vector.c: Improve whitespace

2021-11-10 Thread Richard W.M. Jones
On Wed, Nov 10, 2021 at 06:00:17PM +0200, Nir Soffer wrote: > - Indent the pseudo code to separate it from the comment text > - Add missing blank line after return to make the flow more clear > > Signed-off-by: Nir Soffer > --- > common/utils/vector.c | 9 + > 1 file changed, 5

Re: [Libguestfs] libguestfs language bindings for CentOS/RHEL 9

2021-11-10 Thread Richard W.M. Jones
On Wed, Nov 10, 2021 at 08:46:06AM -0500, Neal Gompa wrote: > Hey Richard, > > I'm looking to use the libguestfs Python, PHP, and Go bindings on > CentOS Stream 9, but it seems that these are not available right > now. Could they be made available in CentOS/RHEL 9, if not, what was > the reason

Re: [Libguestfs] [PATCH nbdkit 2/2] common: Add checked-overflow macros and use for safe vector extension

2021-11-10 Thread Richard W.M. Jones
On Wed, Nov 10, 2021 at 02:36:18PM +0100, Laszlo Ersek wrote: > How about: > > if (ADD_SIZE_T_OVERFLOW (v->cap, 1, ) || > ADD_SIZE_T_OVERFLOW (v->cap, newcap / 2, ) || > MUL_SIZE_T_OVERFLOW (newcap, itemsize, ) || > newbytes < reqbytes) { > > /* If that either overflows

Re: [Libguestfs] [PATCH nbdkit 2/2] common: Add checked-overflow macros and use for safe vector extension

2021-11-09 Thread Richard W.M. Jones
On Tue, Nov 09, 2021 at 07:27:12PM +, Richard W.M. Jones wrote: > On Tue, Nov 09, 2021 at 08:53:28PM +0200, Nir Soffer wrote: > > I would try to extract the code to compute the new capacity into a helper > > function: > > > >if (next_capacity(v-cap, n, itemsi

Re: [Libguestfs] [PATCH nbdkit 2/2] common: Add checked-overflow macros and use for safe vector extension

2021-11-09 Thread Richard W.M. Jones
On Tue, Nov 09, 2021 at 08:53:28PM +0200, Nir Soffer wrote: > On Tue, Nov 9, 2021 at 7:49 PM Richard W.M. Jones wrote: > > > > --- > > common/include/Makefile.am| 1 + > > common/utils/Makefile.am | 3 +- > > commo

[Libguestfs] [PATCH nbdkit 2/2] common: Add checked-overflow macros and use for safe vector extension

2021-11-09 Thread Richard W.M. Jones
--- common/include/Makefile.am| 1 + common/utils/Makefile.am | 3 +- common/include/checked-overflow.h | 61 +++ common/utils/vector.c | 26 + 4 files changed, 82 insertions(+), 9 deletions(-) diff --git

[Libguestfs] [PATCH nbdkit 1/2] common/utils/vector: Add comments to generic_vector_reserve

2021-11-09 Thread Richard W.M. Jones
This commit makes no changes, it simply adds comments and breaks out the multiplcation into a local variable. --- common/utils/vector.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/common/utils/vector.c b/common/utils/vector.c index d7120399..dff051e9

[Libguestfs] [PATCH nbdkit 0/2] common: Add checked-overflow macros

2021-11-09 Thread Richard W.M. Jones
In common/vector/vector.c use GCC/Clang built-in overflow operators. The first patch is a neutral change which adds comments. The second patch is the actual change. Add a new header "checked-overflow.h" which has the purpose of isolating the use of the built-ins to one file (in case we need to

Re: [Libguestfs] [libnbd PATCH] common/utils/vector: Better overflow handling

2021-11-09 Thread Richard W.M. Jones
On Tue, Nov 09, 2021 at 02:39:38PM +, Richard W.M. Jones wrote: > clang also implements these, but from what I'm reading online it seems > they were buggy in at least earlier versions. Actually the clang bug doesn't look that bad, it seems like an obscure corner case that we're un

Re: [Libguestfs] [libnbd PATCH] common/utils/vector: Better overflow handling

2021-11-09 Thread Richard W.M. Jones
On Tue, Nov 09, 2021 at 02:15:03PM +0100, Laszlo Ersek wrote: > On 11/08/21 20:56, Eric Blake wrote: > > Check newcap * itemsize for overflow prior to calling realloc, so that > > we don't accidentally truncate an existing array. Set errno to ENOMEM > > on all failure paths, rather than leaving

Re: [Libguestfs] [virt-v2v RFC wave 2 03/10] convert/windows_virtio: restrict the warning with virtio-win.iso absent

2021-11-09 Thread Richard W.M. Jones
On Tue, Nov 09, 2021 at 11:18:01AM +, Daniel P. Berrangé wrote: > On Tue, Nov 09, 2021 at 11:55:32AM +0100, Laszlo Ersek wrote: > > I'm asking now because these simplifications look technically possible > > even before I start investigating the "OVF video device" topic. I expect > > the latter

Re: [Libguestfs] Minimum OCaml compiler version (2021/2022 edition)

2021-11-09 Thread Richard W.M. Jones
On Tue, Nov 09, 2021 at 01:18:44PM +0100, Laszlo Ersek wrote: > On 11/09/21 10:04, Richard W.M. Jones wrote: > > Previously: > > https://listman.redhat.com/archives/libguestfs/2020-March/msg00063.html > > https://listman.redhat.com/archives/libguestfs/2017-September/msg00

Re: [Libguestfs] [virt-v2v RFC wave 2 03/10] convert/windows_virtio: restrict the warning with virtio-win.iso absent

2021-11-09 Thread Richard W.M. Jones
On Tue, Nov 09, 2021 at 11:55:32AM +0100, Laszlo Ersek wrote: > On 11/06/21 18:40, Richard W.M. Jones wrote: > > On Sat, Nov 06, 2021 at 04:45:33PM +0100, Laszlo Ersek wrote: > >> On 11/02/21 09:52, Richard W.M. Jones wrote: > >>> I hesitate to submit patches for p

Re: [Libguestfs] Minimum OCaml compiler version (2021/2022 edition)

2021-11-09 Thread Richard W.M. Jones
On Tue, Nov 09, 2021 at 09:04:40AM +, Richard W.M. Jones wrote: > Previously: > https://listman.redhat.com/archives/libguestfs/2020-March/msg00063.html > https://listman.redhat.com/archives/libguestfs/2017-September/msg00203.html > > Our current minimum version across p

[Libguestfs] Minimum OCaml compiler version (2021/2022 edition)

2021-11-09 Thread Richard W.M. Jones
Previously: https://listman.redhat.com/archives/libguestfs/2020-March/msg00063.html https://listman.redhat.com/archives/libguestfs/2017-September/msg00203.html Our current minimum version across projects is 4.03. We still use "noalloc" in a few places which causes this warning: ocamlopt.opt

Re: [Libguestfs] [libnbd PATCH] common/utils/vector: Better overflow handling

2021-11-08 Thread Richard W.M. Jones
On Mon, Nov 08, 2021 at 10:08:59PM +0200, Nir Soffer wrote: > On Mon, Nov 8, 2021 at 9:56 PM Eric Blake wrote: > > > > Check newcap * itemsize for overflow prior to calling realloc, so that > > we don't accidentally truncate an existing array. Set errno to ENOMEM > > on all failure paths, rather

Re: [Libguestfs] [PATCH libnbd 1/2] golang: Create distribution for a proxy server

2021-11-08 Thread Richard W.M. Jones
On Mon, Nov 08, 2021 at 09:55:56PM +0200, Nir Soffer wrote: > On Mon, Nov 8, 2021 at 9:46 PM Eric Blake wrote: > > > > On Sun, Nov 07, 2021 at 06:35:50PM +0200, Nir Soffer wrote: > > > Add make-dist.sh script, creating a distribution tree for a proxy > > > server[1]. The created tree must be

Re: [Libguestfs] [PATCH libnbd] golang/make-disst.sh: Remove the @v/list file

2021-11-08 Thread Richard W.M. Jones
On Mon, Nov 08, 2021 at 08:28:38PM +0200, Nir Soffer wrote: > This file must list all the version on the server, not latest version. > It should be created on the server after uploading a new release. > > Signed-off-by: Nir Soffer > --- > golang/make-dist.sh | 17 +++-- > 1 file

Re: [Libguestfs] [PATCH libnbd] podwrapper.pl.in: Use short commit date

2021-11-08 Thread Richard W.M. Jones
On Mon, Nov 08, 2021 at 07:55:51PM +0200, Nir Soffer wrote: > We can use git short commit date format $cs. Maybe it was not available > when podwrapper.pl was create. > > Signed-off-by: Nir Soffer > --- > podwrapper.pl.in | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git

Re: [Libguestfs] [PATCH libnbd v2] golang/make-dist.sh: Add module release time

2021-11-08 Thread Richard W.M. Jones
On Mon, Nov 08, 2021 at 07:59:38PM +0200, Nir Soffer wrote: > Add the optional Time key to the vx.y.z.info file. This should help > https://pkg.go.dev/libguestfs.org/libnbd to show the "Published" date. > > Using the commit date so rebuilding the tarball will created identical > metadata. > > $

Re: [Libguestfs] [PATCH libnbd v2] tests: Test nbd_connect_systemd_socket_activation

2021-11-08 Thread Richard W.M. Jones
On Mon, Nov 08, 2021 at 06:26:56PM +0200, Nir Soffer wrote: > Add trivial test connecting via systemd socket activation. > > Signed-off-by: Nir Soffer > --- > > Changes in v2: > - Skip test if nbdkit or nbdkit memory plugin are not available (Richard) > - Use single connection, supporting

Re: [Libguestfs] [PATCH v2v 1/2] Remove requested_guestcaps / rcaps

2021-11-08 Thread Richard W.M. Jones
On Mon, Nov 08, 2021 at 12:19:15PM +0100, Laszlo Ersek wrote: > On 11/08/21 10:12, Richard W.M. Jones wrote: > > This was part of the old in-place support. When we add new in-place > > support we'll do something else, but currently this is dead code so > > remove it comp

Re: [Libguestfs] [PATCH libnbd 0/2] Publish the Go binding via a proxy server

2021-11-08 Thread Richard W.M. Jones
I'll grab you on IRC today and we can try option (3) to see if it works. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with

Re: [Libguestfs] [PATCH libnbd 1/2] golang: Create distribution for a proxy server

2021-11-08 Thread Richard W.M. Jones
On Sun, Nov 07, 2021 at 06:35:50PM +0200, Nir Soffer wrote: > Add make-dist.sh script, creating a distribution tree for a proxy > server[1]. The created tree must be served by the web server serving the > libnbd module, for example: > > https://download.libguestfs.org/libnbd-golang > > The

Re: [Libguestfs] [PATCH libnbd 1/2] tests: Test nbd_connect_systemd_socket_activation

2021-11-08 Thread Richard W.M. Jones
I had a think about this. nbd_connect_systemd_socket_activation uses SSA to pass in a listening socket (not a connected socket), so it is expected that the child calls accept(2) at least once on the socket passed in, and presumably anticipated that the child could call accept(2) multiple times.

[Libguestfs] [PATCH v2v 2/2] Remove guestcaps_block_type Virtio_SCSI

2021-11-08 Thread Richard W.M. Jones
Since we no longer support requesting virtio-scsi, this constructor was never used. --- convert/convert.ml | 2 +- convert/convert_linux.ml | 9 ++--- convert/target_bus_assignment.ml | 1 - lib/create_ovf.ml| 1 - lib/types.ml

[Libguestfs] [PATCH v2v 1/2] Remove requested_guestcaps / rcaps

2021-11-08 Thread Richard W.M. Jones
This was part of the old in-place support. When we add new in-place support we'll do something else, but currently this is dead code so remove it completely. Note this removes the code for installing the virtio-scsi driver (only ever using virtio-blk). This was also dead code in the current

<    13   14   15   16   17   18   19   20   21   22   >