On Thu, Apr 30, 2026 at 13:43:50 +0200, Peter Krempa via Devel wrote:
> From: Peter Krempa <[email protected]>
>
> Extract information about typed parameters from calls to
> 'virTypedParamsValidate'/'virTypedParamsValidateTemplate' and expose
> them in the introspection XML:
>
> <api name='virDomainMigrate3'>
> <flags dec='2097151' hex='0x1fffff'/>
> <typed-parameters type='input' name='params'>
> <param name='migrate_uri' type='string'/>
> <param name='destination_name' type='string'/>
> <param name='destination_xml' type='string'/>
> <param name='bandwidth' type='ullong'/>
> <param name='graphics_uri' type='string'/>
> <param name='listen_address' type='string'/>
> <param name='migrate_disks' type='string' multiple='yes'/>
> <param name='migrate_disks_detect_zeroes' type='string'
> multiple='yes'/>
> <param name='migrate_disks_target_zero' type='string' multiple='yes'/>
> <param name='disks_port' type='int'/>
> <param name='compression' type='string' multiple='yes'/>
> <param name='compression.mt.level' type='int'/>
> <param name='compression.mt.threads' type='int'/>
> <param name='compression.mt.dthreads' type='int'/>
> <param name='compression.xbzrle.cache' type='ullong'/>
> <param name='persistent_xml' type='string'/>
> <param name='auto_converge.initial' type='int'/>
> <param name='auto_converge.increment' type='int'/>
> <param name='bandwidth.postcopy' type='ullong'/>
> <param name='parallel.connections' type='int'/>
> <param name='compression.zlib.level' type='int'/>
> <param name='compression.zstd.level' type='int'/>
> <param name='tls.destination' type='string'/>
> <param name='disks_uri' type='string'/>
> <param name='bandwidth.avail.switchover' type='ullong'/>
> </typed-parameters>
> </api>
>
> Migration APIs once again required special handling as some typed params
> are supported even if the backing APIs using typed parameters arend
> supported because they can be converted to legacy parameters for the
> lesser APIs.
>
> Signed-off-by: Peter Krempa <[email protected]>
> ---
> scripts/genintrospection.py | 127 ++++++++++++++++++++++++++++++++++++
> src/util/virintrospection.c | 45 +++++++++++++
> src/util/virintrospection.h | 3 +
> 3 files changed, 175 insertions(+)
Consider this squashed in to fix the script with older python versions:
diff --git a/scripts/genintrospection.py b/scripts/genintrospection.py
index 13b1322746..95469fc15a 100755
--- a/scripts/genintrospection.py
+++ b/scripts/genintrospection.py
@@ -313,12 +313,10 @@ static const virIntrospectionData
driver_api_introspection[] =
if data.get("input_params_supported", None) is not None:
outfile.write(
- f" .input_params =
{data["callback"]}InputParamValidation,\n"
+ f" .input_params =
{data['callback']}InputParamValidation,\n"
)
elif data.get("input_params_template", None) is not None:
- outfile.write(f" .input_params =
{data["input_params_template"]},\n")
- else:
- outfile.write(" .input_params = NULL,\n")
+ outfile.write(f" .input_params =
{data['input_params_template']},\n")
outfile.write(" },\n")
@@ -340,7 +338,7 @@ for api, data in introspection.items():
and data.get("input_params_template", None) is None
):
print(
- f"failed to parse typed params for '{api}' in
'{data.get("callback", "")}'"
+ f"failed to parse typed params for '{api}' in
'{data.get('callback', '')}'"
)
fail = True
if fail: