[PATCH v2 00/30] Configurable policy for handling deprecated interfaces

Peter Krempa pkrempa at redhat.com
Wed Mar 4 11:55:33 UTC 2020


On Tue, Mar 03, 2020 at 17:34:35 +0100, Markus Armbruster wrote:
> Based-on: <20200227144531.24309-1-armbru at redhat.com>
> 
> This series extends QMP introspection to cover deprecation.
> Additionally, new option -compat lets you configure what to do when
> deprecated interfaces get used.  This is intended for testing users of
> the management interfaces.  It is experimental.

I've quickly hacked up support for the 'deprecated' feature in libvirt's
QMP validator. I've found a few uses of deprecated commands but they
might very well be in code paths that are no longer invoked in modern
qemus:

Offenders from qemumonitorjsontest:

44) qemuMonitorJSONSetCPU                                             ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'cpu-add': failed to validate arguments of 'cpu-add' against QAPI schema: ERROR: 'cpu-add' is deprecated
FAILED
46) qemuMonitorJSONChangeMedia                                        ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'change': failed to validate arguments of 'change' against QAPI schema: ERROR: 'change' is deprecated
FAILED
49) qemuMonitorJSONSetMigrationSpeed                                  ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'migrate_set_speed': failed to validate arguments of 'migrate_set_speed' against QAPI schema: ERROR: 'migrate_set_speed' is deprecated
FAILED
50) qemuMonitorJSONSetMigrationDowntime                               ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'migrate_set_downtime': failed to validate arguments of 'migrate_set_downtime' against QAPI schema: ERROR: 'migrate_set_downtime' is deprecated
FAILED
77) qemuMonitorJSONGetMigrationCacheSize                              ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'query-migrate-cache-size': failed to validate arguments of 'query-migrate-cache-size' against QAPI schema: ERROR: 'query-migrate-cache-size' is deprecated
FAILED
83) qemuMonitorJSONQueryCPUs                                          ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'query-cpus': failed to validate arguments of 'query-cpus' against QAPI schema: ERROR: 'query-cpus' is deprecated
FAILED
93) GetCPUInfo(x86-basic-pluggable)                                   ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'query-cpus': failed to validate arguments of 'query-cpus' against QAPI schema: ERROR: 'query-cpus' is deprecated
FAILED
94) GetCPUInfo(x86-full)                                              ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'query-cpus': failed to validate arguments of 'query-cpus' against QAPI schema: ERROR: 'query-cpus' is deprecated
FAILED
95) GetCPUInfo(x86-node-full)                                         ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'query-cpus': failed to validate arguments of 'query-cpus' against QAPI schema: ERROR: 'query-cpus' is deprecated
FAILED
97) GetCPUInfo(ppc64-basic)                                           ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'query-cpus': failed to validate arguments of 'query-cpus' against QAPI schema: ERROR: 'query-cpus' is deprecated
FAILED
98) GetCPUInfo(ppc64-hotplug-1)                                       ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'query-cpus': failed to validate arguments of 'query-cpus' against QAPI schema: ERROR: 'query-cpus' is deprecated
FAILED
99) GetCPUInfo(ppc64-hotplug-2)                                       ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'query-cpus': failed to validate arguments of 'query-cpus' against QAPI schema: ERROR: 'query-cpus' is deprecated
FAILED
100) GetCPUInfo(ppc64-hotplug-4)                                       ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'query-cpus': failed to validate arguments of 'query-cpus' against QAPI schema: ERROR: 'query-cpus' is deprecated
FAILED
101) GetCPUInfo(ppc64-no-threads)                                      ... libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'query-cpus': failed to validate arguments of 'query-cpus' against QAPI schema: ERROR: 'query-cpus' is deprecated
FAILED

Here all commands are tested just for legacy reasons. query-cpus-fast is
used on any live codebase, cpu-add is no longer used, change is not used
with -blockdev. I'm not sure about the migration parameter APIs but I
didn't check either.

The above shows that we can't enable this without thinking even in our
test-suite.

I'll try to come up with a solution where we can enable the reporting of
use of deprecated commands through /etc/qemu.conf so that I as an
developer can always use it.

I'm currently busy but I plan to follow up later.

I've pushed the test change here:

https://gitlab.com/pipo.sk/libvirt/-/commits/qmp-deprecated

The unfortunate part is that we'll need to manually inspect the codebase
for any deprecation in returned values. Our parser is 'artisanaly
handcrafted' so it can't be introspected.




More information about the libvir-list mailing list