1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2025-03-12 16:28:36 +01:00
parent 67d2787807
commit 57cbe6a569

View File

@ -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 */