From: Peter Krempa Date: Wed, 12 Mar 2025 15:28:36 +0000 (+0100) Subject: qemuBuildCompatDeprecatedCommandLine: Assume that QEMU_CAPS_COMPAT_DEPRECATED is... X-Git-Tag: v11.2.0-rc1~166 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57cbe6a56902b8c5b0cccb9e59f264fbeb9db953;p=thirdparty%2Flibvirt.git qemuBuildCompatDeprecatedCommandLine: Assume that QEMU_CAPS_COMPAT_DEPRECATED is supported Bumping minimum version of qemu to 6.2 means that the '-compat' option is now always supported. As we were unable to detect it in any other way we based this capability on QEMU_CAPS_OBJECT_JSON. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 07cdadfd73..2b0e3dd53a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10339,8 +10339,7 @@ VIR_ENUM_IMPL(qemuCommandDeprecationBehavior, static void qemuBuildCompatDeprecatedCommandLine(virCommand *cmd, virQEMUDriverConfig *cfg, - virDomainDef *def, - virQEMUCaps *qemuCaps) + virDomainDef *def) { g_autoptr(virJSONValue) props = NULL; g_autofree char *propsstr = NULL; @@ -10365,13 +10364,6 @@ qemuBuildCompatDeprecatedCommandLine(virCommand *cmd, if (behavior == QEMU_COMMAND_DEPRECATION_BEHAVIOR_NONE) return; - /* we don't try to enable this feature at all if qemu doesn't support it, - * so that a downgrade of qemu version doesn't impact startup of the VM */ - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_COMPAT_DEPRECATED)) { - VIR_DEBUG("-compat not supported for VM '%s'", def->name); - return; - } - switch (behavior) { case QEMU_COMMAND_DEPRECATION_BEHAVIOR_OMIT: case QEMU_COMMAND_DEPRECATION_BEHAVIOR_NONE: @@ -10455,7 +10447,7 @@ qemuBuildCommandLine(virDomainObj *vm, if (qemuBuildNameCommandLine(cmd, cfg, def) < 0) return NULL; - qemuBuildCompatDeprecatedCommandLine(cmd, cfg, def, qemuCaps); + qemuBuildCompatDeprecatedCommandLine(cmd, cfg, def); virCommandAddArg(cmd, "-S"); /* freeze CPUs during startup */