Enable '-compat' if requested in qemu.conf and supported by qemu to instruct qemu to crash when a deprecated command is used and stop returning deprecated fields. This setting is meant for libvirt developers and such. --- src/qemu/qemu_command.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6acfc0b19d..5a4769e969 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9801,6 +9801,20 @@ qemuBuildVsockCommandLine(virCommandPtr cmd, } +static void +qemuBuildCompatDeprecatedCommandLine(virCommandPtr cmd, + virQEMUDriverConfigPtr cfg, + virQEMUCapsPtr qemuCaps) +{ + if (!cfg->deprecatedDebug || + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_COMPAT_DEPRECATED)) + return; + + virCommandAddArgList(cmd, "-compat", + "deprecated-input=crash,deprecated-output=hide", NULL); +} + + /* * Constructs a argv suitable for launching qemu with config defined * for a given virtual machine. @@ -9860,6 +9874,8 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, if (qemuBuildNameCommandLine(cmd, cfg, def, qemuCaps) < 0) return NULL; + qemuBuildCompatDeprecatedCommandLine(cmd, cfg, qemuCaps); + if (!standalone) virCommandAddArg(cmd, "-S"); /* freeze CPU */ -- 2.26.2