mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: New -compat deprecated-input=crash
Policy "crash" calls abort() when deprecated input is received. Bugs in integration tests may mask the error from policy "reject". Provide a larger hammer: crash outright. Masking that seems unlikely. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20210318155519.1224118-12-armbru@redhat.com>
This commit is contained in:
parent
db29164103
commit
dbb675c19a
4 changed files with 7 additions and 2 deletions
|
@ -11,11 +11,12 @@
|
||||||
#
|
#
|
||||||
# @accept: Accept silently
|
# @accept: Accept silently
|
||||||
# @reject: Reject with an error
|
# @reject: Reject with an error
|
||||||
|
# @crash: abort() the process
|
||||||
#
|
#
|
||||||
# Since: 6.0
|
# Since: 6.0
|
||||||
##
|
##
|
||||||
{ 'enum': 'CompatPolicyInput',
|
{ 'enum': 'CompatPolicyInput',
|
||||||
'data': [ 'accept', 'reject' ] }
|
'data': [ 'accept', 'reject', 'crash' ] }
|
||||||
|
|
||||||
##
|
##
|
||||||
# @CompatPolicyOutput:
|
# @CompatPolicyOutput:
|
||||||
|
|
|
@ -185,6 +185,7 @@ QDict *qmp_dispatch(const QmpCommandList *cmds, QObject *request,
|
||||||
"Deprecated command %s disabled by policy",
|
"Deprecated command %s disabled by policy",
|
||||||
command);
|
command);
|
||||||
goto out;
|
goto out;
|
||||||
|
case COMPAT_POLICY_INPUT_CRASH:
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
|
@ -676,6 +676,7 @@ static bool qobject_input_deprecated_accept(Visitor *v, const char *name,
|
||||||
error_setg(errp, "Deprecated parameter '%s' disabled by policy",
|
error_setg(errp, "Deprecated parameter '%s' disabled by policy",
|
||||||
name);
|
name);
|
||||||
return false;
|
return false;
|
||||||
|
case COMPAT_POLICY_INPUT_CRASH:
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3508,7 +3508,7 @@ DEFHEADING()
|
||||||
DEFHEADING(Debug/Expert options:)
|
DEFHEADING(Debug/Expert options:)
|
||||||
|
|
||||||
DEF("compat", HAS_ARG, QEMU_OPTION_compat,
|
DEF("compat", HAS_ARG, QEMU_OPTION_compat,
|
||||||
"-compat [deprecated-input=accept|reject][,deprecated-output=accept|hide]\n"
|
"-compat [deprecated-input=accept|reject|crash][,deprecated-output=accept|hide]\n"
|
||||||
" Policy for handling deprecated management interfaces\n",
|
" Policy for handling deprecated management interfaces\n",
|
||||||
QEMU_ARCH_ALL)
|
QEMU_ARCH_ALL)
|
||||||
SRST
|
SRST
|
||||||
|
@ -3519,6 +3519,8 @@ SRST
|
||||||
Accept deprecated commands and arguments
|
Accept deprecated commands and arguments
|
||||||
``deprecated-input=reject``
|
``deprecated-input=reject``
|
||||||
Reject deprecated commands and arguments
|
Reject deprecated commands and arguments
|
||||||
|
``deprecated-input=crash``
|
||||||
|
Crash on deprecated commands and arguments
|
||||||
``deprecated-output=accept`` (default)
|
``deprecated-output=accept`` (default)
|
||||||
Emit deprecated command results and events
|
Emit deprecated command results and events
|
||||||
``deprecated-output=hide``
|
``deprecated-output=hide``
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue