Re: [Libguestfs] [libnbd PATCH 4/4] tests: Add language binding tests for stats reception

2022-09-08 Thread Richard W.M. Jones
On Tue, Sep 06, 2022 at 04:19:40AM -0500, Eric Blake wrote: > > > + assert (cr3 = (Int64.add cr2 fudge)) > > Not so in OCaml, where + isn't even polymorphic to int64, so I have to > break out manual calls to Int64.XXX methods. Here, I went with a > helper variable 'fudge'. No implicit type conv

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Richard W.M. Jones
On Mon, Sep 05, 2022 at 01:25:27PM +0200, Laszlo Ersek wrote: > This concern arises because in the child process, only the one thread > returning from fork() exists, thus if any locks are held by other threads > in the parent process, those will never be released in the child process. > > But such

Re: [Libguestfs] [p2v PATCH 3/6] gui: set row count from a running variable when populating tables

2022-09-08 Thread Richard W.M. Jones
On Mon, Sep 05, 2022 at 01:25:28PM +0200, Laszlo Ersek wrote: > Each call to table_attach() in fact open-codes (row, row + 1), for setting > the top and bottom grid lines of the widget being added to the table. > What's more, within a given table, we add widgets in a left-to-right > first, top-down

Re: [Libguestfs] [p2v PATCH 4/6] gui: offer copying the vCPU topology from the fully populated physical one

2022-09-08 Thread Richard W.M. Jones
On Mon, Sep 05, 2022 at 01:25:29PM +0200, Laszlo Ersek wrote: > Introduce a checkbox that lets the user choose between options (a) and > (b), as outlined in one of the previous patches in this series. When the > checkbox is ticked -- that is, the fully populated physical topology is > copied --, ma

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Richard W.M. Jones
On Mon, Sep 05, 2022 at 01:25:27PM +0200, Laszlo Ersek wrote: > + "p2v.vcpu.dense_topo" => manual_entry->new( > +shortopt => "", # ignored for booleans > +description => " > +Copy the physical machine's CPU topology, densely populated, to the > +guest. Disabled by default. If disabled, t

Re: [Libguestfs] [p2v PATCH 6/6] Makefile.am: set vCPU topology to 1*2*2 in the "p2v in a VM" tests

2022-09-08 Thread Richard W.M. Jones
On Mon, Sep 05, 2022 at 01:25:31PM +0200, Laszlo Ersek wrote: > This lets us exercise both states of the "p2v.vcpu.dense_topo" switch > sensibly via the in-VM GUI. > > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1590721 > Signed-off-by: Laszlo Ersek > --- > Makefile.am | 2 ++ > 1 file

Re: [Libguestfs] [libnbd PATCH v2 04/12] api: Add nbd_set_request_meta_context()

2022-09-08 Thread Laszlo Ersek
On 09/06/22 11:38, Eric Blake wrote: > On Mon, Sep 05, 2022 at 04:35:28PM +0200, Laszlo Ersek wrote: >> Now, in case I'm wrong, and we enter this code with a *third* >> "h->opt_current" value, then we have: >> >> - opt = SET, and >> >> - "h->opt_current" differing from both SET and LIST. >> >> The

Re: [Libguestfs] [libnbd PATCH 2/4] generator: Add RUInt64 for 64-bit counters without error

2022-09-08 Thread Laszlo Ersek
On 09/06/22 11:08, Eric Blake wrote: > On Mon, Sep 05, 2022 at 02:00:22PM +0200, Laszlo Ersek wrote: > We could further compress things to have: > > pr "debug (h, \"leave: ret=\""; > (match ret with > | RBool -> pr "%%d\", ret" > > and so on, to get rid of yet another spurious pair of "" in

Re: [Libguestfs] [libnbd PATCH 4/4] tests: Add language binding tests for stats reception

2022-09-08 Thread Laszlo Ersek
On 09/06/22 11:19, Eric Blake wrote: > On Mon, Sep 05, 2022 at 02:10:36PM +0200, Laszlo Ersek wrote: >> On 09/03/22 00:14, Eric Blake wrote: >>> This proves that the stat counters increment as desired, as well as >>> proving that our RUInt32 generator type works. >> >> How is this related to RUint3

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Laszlo Ersek
On 09/08/22 10:03, Richard W.M. Jones wrote: > On Mon, Sep 05, 2022 at 01:25:27PM +0200, Laszlo Ersek wrote: >> + "p2v.vcpu.dense_topo" => manual_entry->new( >> +shortopt => "", # ignored for booleans >> +description => " >> +Copy the physical machine's CPU topology, densely populated, to

Re: [Libguestfs] [p2v PATCH 3/6] gui: set row count from a running variable when populating tables

2022-09-08 Thread Laszlo Ersek
On 09/08/22 09:57, Richard W.M. Jones wrote: > On Mon, Sep 05, 2022 at 01:25:28PM +0200, Laszlo Ersek wrote: >> Each call to table_attach() in fact open-codes (row, row + 1), for setting >> the top and bottom grid lines of the widget being added to the table. >> What's more, within a given table, w

Re: [Libguestfs] [p2v PATCH 6/6] Makefile.am: set vCPU topology to 1*2*2 in the "p2v in a VM" tests

2022-09-08 Thread Laszlo Ersek
On 09/08/22 10:04, Richard W.M. Jones wrote: > On Mon, Sep 05, 2022 at 01:25:31PM +0200, Laszlo Ersek wrote: >> This lets us exercise both states of the "p2v.vcpu.dense_topo" switch >> sensibly via the in-VM GUI. >> >> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1590721 >> Signed-off-by:

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Richard W.M. Jones
(Adding Dan for input) On Thu, Sep 08, 2022 at 03:23:41PM +0200, Laszlo Ersek wrote: > On 09/08/22 10:03, Richard W.M. Jones wrote: > > On Mon, Sep 05, 2022 at 01:25:27PM +0200, Laszlo Ersek wrote: > >> + "p2v.vcpu.dense_topo" => manual_entry->new( > >> +shortopt => "", # ignored for booleans

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Laszlo Ersek
On 09/08/22 15:36, Richard W.M. Jones wrote: > (Adding Dan for input) > > On Thu, Sep 08, 2022 at 03:23:41PM +0200, Laszlo Ersek wrote: >> On 09/08/22 10:03, Richard W.M. Jones wrote: >>> On Mon, Sep 05, 2022 at 01:25:27PM +0200, Laszlo Ersek wrote: + "p2v.vcpu.dense_topo" => manual_entry->n

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Daniel P . Berrangé
On Mon, Sep 05, 2022 at 01:25:27PM +0200, Laszlo Ersek wrote: > Currently, the CPU topology for the converted domain is determined as > follows: > > (1) main() [main.c] > > (2) set_config_defaults() [main.c] > vcpus <-- sy

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Daniel P . Berrangé
On Thu, Sep 08, 2022 at 02:36:15PM +0100, Richard W.M. Jones wrote: > (Adding Dan for input) > > On Thu, Sep 08, 2022 at 03:23:41PM +0200, Laszlo Ersek wrote: > > On 09/08/22 10:03, Richard W.M. Jones wrote: > > > On Mon, Sep 05, 2022 at 01:25:27PM +0200, Laszlo Ersek wrote: > > >> + "p2v.vcpu.de

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Laszlo Ersek
On 09/08/22 16:37, Daniel P. Berrangé wrote: > On Mon, Sep 05, 2022 at 01:25:27PM +0200, Laszlo Ersek wrote: >> Currently, the CPU topology for the converted domain is determined as >> follows: >> >> (1) main() [main.c] >> >> (2) set_config_defaults()

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Laszlo Ersek
On 09/08/22 16:39, Daniel P. Berrangé wrote: > On Thu, Sep 08, 2022 at 02:36:15PM +0100, Richard W.M. Jones wrote: >> (Adding Dan for input) >> >> On Thu, Sep 08, 2022 at 03:23:41PM +0200, Laszlo Ersek wrote: >>> On 09/08/22 10:03, Richard W.M. Jones wrote: On Mon, Sep 05, 2022 at 01:25:27PM +

[Libguestfs] [p2v PATCH v2 0/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Laszlo Ersek
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1590721 v1: https://listman.redhat.com/archives/libguestfs/2022-September/029806.html Please see the Notes section on each patch for the updates in this version (addressing v1 feedback). Patch #5 is a candidate for dropping in particular

[Libguestfs] [p2v PATCH v2 4/6] gui: offer copying the vCPU topology from the fully populated physical one

2022-09-08 Thread Laszlo Ersek
Introduce a checkbox that lets the user choose between options (a) and (b), as outlined in one of the previous patches in this series. When the checkbox is ticked -- that is, the fully populated physical topology is copied --, make the VCPU count text entry insensitive, and overwrite its contents w

[Libguestfs] [p2v PATCH v2 1/6] gui: check VCPU & memory limits upon showing the conversion dialog

2022-09-08 Thread Laszlo Ersek
show_conversion_dialog() hides the VCPU and memory limit warning signs unconditionally. The warning signs and the associated label text(s) can only be displayed later, when the VCPUs or the memory entry changes, and vcpus_or_memory_check_callback() is called. This is incorrect: we may initialize e

[Libguestfs] [p2v PATCH v2 3/6] gui: set row count from a running variable when populating tables

2022-09-08 Thread Laszlo Ersek
Each call to table_attach() in fact open-codes (row, row + 1), for setting the top and bottom grid lines of the widget being added to the table. What's more, within a given table, we add widgets in a left-to-right first, top-down second fashion, so "row" only ever increases within a particular tabl

[Libguestfs] [p2v PATCH v2 6/6] Makefile.am: set vCPU topology to 1*2*2 in the "p2v in a VM" tests

2022-09-08 Thread Laszlo Ersek
This lets us exercise both states of the "p2v.vcpu.phys_topo" switch sensibly via the in-VM GUI. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1590721 Signed-off-by: Laszlo Ersek Acked-by: Richard W.M. Jones --- Notes: v2: - pick up Rich's A-b - s/dense_topo/phys_t

[Libguestfs] [p2v PATCH v2 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Laszlo Ersek
Currently, the CPU topology for the converted domain is determined as follows: (1) main() [main.c] (2) set_config_defaults() [main.c] vcpus <-- sysconf (_SC_NPROCESSORS_ONLN) get_cpu_config()

[Libguestfs] [p2v PATCH v2 5/6] copy fully populated vCPU topology by default

2022-09-08 Thread Laszlo Ersek
Such a default seems reasonable for most phys-to-virt conversions. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1590721 Signed-off-by: Laszlo Ersek Acked-by: Richard W.M. Jones --- Notes: v2: - pick up Rich's A-b - resolve rebase conflicts due to dense_topo -> phy

Re: [Libguestfs] [libnbd PATCH 2/4] generator: Add RUInt64 for 64-bit counters without error

2022-09-08 Thread Eric Blake
On Thu, Sep 08, 2022 at 02:53:21PM +0200, Laszlo Ersek wrote: > On 09/06/22 11:08, Eric Blake wrote: > > On Mon, Sep 05, 2022 at 02:00:22PM +0200, Laszlo Ersek wrote: > > > We could further compress things to have: > > > > pr "debug (h, \"leave: ret=\""; > > (match ret with > > | RBool -> pr

Re: [Libguestfs] [libnbd PATCH v2 05/12] tests: Language port of nbd_set_request_meta_context() tests

2022-09-08 Thread Laszlo Ersek
On 08/31/22 16:39, Eric Blake wrote: > As promised in the previous patch, also test the new > nbd_set_request_meta_context() API in Python, OCaml, and Golang. No > direct C counterpart in tests/, but it's always good to check that our > language bindings are complete. > --- > python/t/110-default

Re: [Libguestfs] [libnbd PATCH v2 06/12] info: Explicitly skip NBD_OPT_SET_META_CONTEXT in --list mode

2022-09-08 Thread Laszlo Ersek
On 08/31/22 16:39, Eric Blake wrote: > When listing information about an export, we do not use > nbd_block_status() or nbd_can_meta_context(), because we were already > utilizing the callback to nbd_opt_list_meta_context() to collect > supported context names. In practice, because we also never ca

Re: [Libguestfs] [libnbd PATCH v2 07/12] api: Make nbd_opt_list_meta_context stateless

2022-09-08 Thread Laszlo Ersek
On 09/01/22 17:08, Eric Blake wrote: > On Wed, Aug 31, 2022 at 09:39:23AM -0500, Eric Blake wrote: >> Since NBD_OPT_LIST_META_CONTEXTS is stateless from the server's point >> of view, there is no reason to make it clear state on the client's >> side. Since we do not otherwise modify h->meta_contex

Re: [Libguestfs] [libnbd PATCH v2 08/12] tests: Add coverage for stateless nbd_opt_list_meta_context

2022-09-08 Thread Laszlo Ersek
On 08/31/22 16:39, Eric Blake wrote: > Add test coverage for the previous patch not wiping state during > nbd_opt_list_meta_context. The change is logically identical in each > language that has the same unit test. > --- > python/t/240-opt-list-meta.py | 29 +- > ocaml/tests/tes

Re: [Libguestfs] [libnbd PATCH v2 09/12] api: Reset state on changed nbd_set_export_name()

2022-09-08 Thread Laszlo Ersek
On 08/31/22 16:39, Eric Blake wrote: > The documentation for nbd_internal_reset_size_and_flags() claims we > should wipe all knowledge of a previously-negotiated export when > swapping export names. However, we weren't actually doing that, which > could lead to a user calling nbd_opt_info() for on