From a6444c80195f6b9ad4fe49a6826376c163a02fa5 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 15 Mar 2021 15:06:29 +0100 Subject: [PATCH] qemu: Add per-VM control of deprecation behavior Similar to the qemu.conf knob 'deprecation_behavior' add a per-VM knob in the QEMU namespace: Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- docs/drvqemu.rst | 48 +++++++++++++++++++ docs/schemas/domaincommon.rng | 16 +++++++ src/qemu/qemu_domain.c | 10 +++- src/qemu/qemu_domain.h | 5 ++ tests/qemuxml2argvdata/qemu-ns.xml | 1 + .../qemu-ns.x86_64-latest.xml | 1 + 6 files changed, 80 insertions(+), 1 deletion(-) diff --git a/docs/drvqemu.rst b/docs/drvqemu.rst index 0f8fd9e47d..12e3369e5d 100644 --- a/docs/drvqemu.rst +++ b/docs/drvqemu.rst @@ -523,6 +523,54 @@ Example: +Control of QEMU deprecation warnings +------------------------------------ + +The following knob controls how QEMU behaves towards deprecated commands and +arguments used by libvirt: + +:: + + + testvm + + [...] + + + +This setting is meant for developers and CI efforts to make it obvious when +libvirt relies on fields which are deprecated so that it can be fixes as soon +as possible. + +Possible options are: + +``none`` + (default) qemu is supposed to accept and output deprecated fields and commands + +``omit`` + qemu is instructed to omit deprecated fields on output, behaviour towards + fields and commands from libvirtd is not changed + +``reject`` + qemu is instructed to report an error if a deprecated command or field is + used by libvirtd + +``crash`` + qemu crashes when an deprecated command or field is used by libvirtd + +For both "reject" and "crash" qemu is instructed to omit any deprecated fields +on output. + +The "reject" option is less harsh towards the VMs but some code paths ignore +errors reported by qemu and thus it may not be obvious that a deprecated +command/field was used, thus it's suggested to use the "crash" option instead. + +In cases when qemu doesn't support configuring the behaviour this setting is +silently ignored to allow testing older qemu versions without having to +reconfigure libvirtd. + +*DO NOT* use in production. + Example domain XML config ------------------------- diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 2ff7862539..73ce253821 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -77,6 +77,9 @@ + + + @@ -7270,6 +7273,19 @@ + + + + + none + omit + reject + crash + + + + +