v2:
- possibility to query flags for every API at once
A comment in v1 suggested that polling flags one by one is
ineffective. It was also limited to virDomainBlockResize.
This version adds an API 'virConnectGetIntrospection' which allows
to probe for every flag of every API at once via the introspection
XML which also informs users about supported typed parameters.
Patches 1-34 are new in the series. Patch 35 is adapted to use the new
introspection API.
This is partially a RFC:
- documentation and schema for the new XML will be contributed later
- I've contemplated adding typed parameters as input for the new API if
we'd want to extend it to e.g. allow probing supported stuff for e.g.
a hypervisor version
Breakdown of patches:
Semi-unrelated refactors/fixes:
remote_protocol-structs: fix mis-aligned
'remote_domain_set_throttle_group_args'
qemu: driver: Unify coding style
util: typedparam: Convert VIR_TYPED_PARAM_CHECK_TYPE into a function
util: virTypedParamValidateType: Don't report unknown typed parameter
type as '(null)'
util: Replace open-coded internals of VIR_TYPED_PARAMS_DEBUG with
'virTypedParamDebugstr'
util: typedparam: Unexport
virTypedParameterTypeFromString/virTypedParameterTypeToString
util: typedparam: Refactor and fix typed param validation
scripts: check-symfile: Allow also symbols in 'readonly' section
virHostCPUGet(Map|Stats): Remove unused 'flags'
virHostMemGet(Stats|Parameters): Remove unused 'flags'
virNodeSuspend: Remove unused 'flags'
Changes to allow the introspection script to parse flags:
qemu: backup: Move 'virCheckFlags' to top level functions
qemu: attach/detach device: Move 'virCheckFlags' to top level
functions
qemu: dump: Move 'virCheckFlags' to top level functions
qemu: checkpoint: Move 'virCheckFlags' to top level functions
qemuDomainRestore(Flags|Params): Refactor flag checking
qemu: snapshot: Move flag checks to top level functions
qemuDomainGetLaunchSecurityInfo: Move flag check to top level
qemuDomainDetachDeviceAlias: Move 'flags' validation to top level
qemuDomainManagedSaveDefineXML: Add top-level flag validation
qemuDomainQemuMonitorCommand: Add top-level flag validation
qemuConnectDomainQemuMonitorEventRegister: Add top-level flag
validation
qemuDomainGetMetadata: Add top-level flag validation
API addition and implementation of the introspection api supporting flag
introspection:
API: Introduce 'virConnectGetIntrospection'
virsh: Introduce 'introspection' command which uses
'virConnectGetIntrospection'
scripts: Introduce 'getintrospection' script
qemu: Implement 'virConnectGetIntrospection'
Cleanups needed in order to support typed parameter introspection
util: typedparam: Introduce 'virTypedParamsValidateTemplate'
qemu: migration: Use 'virTypedParamsValidateTemplate' for migration
params
qemu: Reimplement 'qemuDomainValidateBlockIoTune' using
'virTypedParamsValidateTemplate'
util: hostmem: Make parameters for 'virHostMemSetParameters'
introspectable
qemuDomainSetSchedulerParameters: Make typed parameters introspectable
qemuDomainSetIOThreadParams: Move typed parameter validation to top
level
Implementation of typed parameter introspection:
introspection: Add introspection of input typed parameters
Original patch to prevent shrink in virsh:
virsh: blockresize: Use VIR_DOMAIN_BLOCK_RESIZE_EXTEND when available
and introduce --allow-shrink
docs/manpages/virsh.rst | 30 +-
include/libvirt/libvirt-host.h | 3 +
scripts/check-symfile.py | 2 +-
scripts/genintrospection.py | 347 ++++++++++++++++++++
scripts/meson.build | 1 +
src/bhyve/bhyve_driver.c | 20 +-
src/ch/ch_driver.c | 11 +-
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 4 +
src/conf/domain_event.c | 4 +-
src/conf/domain_event.h | 5 +
src/driver-hypervisor.h | 5 +
src/libvirt-host.c | 40 +++
src/libvirt_private.syms | 10 +-
src/libvirt_public.syms | 5 +
src/lxc/lxc_driver.c | 24 +-
src/openvz/openvz_driver.c | 12 +-
src/qemu/meson.build | 18 ++
src/qemu/qemu_backup.c | 8 +-
src/qemu/qemu_backup.h | 3 +-
src/qemu/qemu_checkpoint.c | 11 -
src/qemu/qemu_driver.c | 543 ++++++++++++++++++++------------
src/qemu/qemu_migration.c | 29 ++
src/qemu/qemu_migration.h | 32 +-
src/qemu/qemu_snapshot.c | 27 --
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 15 +-
src/remote_protocol-structs | 21 +-
src/util/meson.build | 1 +
src/util/virhostcpu.c | 10 +-
src/util/virhostcpu.h | 6 +-
src/util/virhostmem.c | 53 ++--
src/util/virhostmem.h | 11 +-
src/util/virintrospection.c | 82 +++++
src/util/virintrospection.h | 20 ++
src/util/virnodesuspend.c | 5 +-
src/util/virnodesuspend.h | 3 +-
src/util/virtypedparam-public.c | 54 ++--
src/util/virtypedparam.c | 222 +++++++++----
src/util/virtypedparam.h | 26 +-
src/vz/vz_driver.c | 12 +-
tests/virhostcputest.c | 2 +-
tools/virsh-domain.c | 59 ++++
tools/virsh-host.c | 43 +++
44 files changed, 1384 insertions(+), 459 deletions(-)
create mode 100644 scripts/genintrospection.py
create mode 100644 src/util/virintrospection.c
create mode 100644 src/util/virintrospection.h
--
2.54.0