> This prints a warning on stderr every time a policy violation
> is encountered, but accepts the input.
> 
> Signed-off-by: Daniel P. Berrangé <[email protected]>
> Message-ID: <[email protected]>
> ---
>  qapi/compat.json |  4 +++-
>  qapi/qapi-util.c |  4 ++++
>  qemu-options.hx  | 12 ++++++++----
>  3 files changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/qapi/compat.json b/qapi/compat.json
> index 0f90ea1f5241..dfa3fea05778 100644
> --- a/qapi/compat.json
> +++ b/qapi/compat.json
> @@ -17,10 +17,12 @@
>  #
>  # @crash: abort() the process
>  #
> +# @warn: Accept with a warning printed to stderr (Since: 11.2)
> +#
>  # Since: 6.0
>  ##
>  { 'enum': 'CompatPolicyInput',
> -  'data': [ 'accept', 'reject', 'crash' ] }
> +  'data': [ 'accept', 'reject', 'crash', 'warn' ] }
>  
>  ##
>  # @CompatPolicyOutput:
> diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c
> index 93898f57a055..f81a171a5b16 100644
> --- a/qapi/qapi-util.c
> +++ b/qapi/qapi-util.c
> @@ -28,6 +28,10 @@ static bool compat_policy_input_ok1(CompatPolicyInput 
> policy,
>      switch (policy) {
>      case COMPAT_POLICY_INPUT_ACCEPT:
>          return true;
> +    case COMPAT_POLICY_INPUT_WARN:
> +        warn_report("%s %s %s disabled by policy",

rather: "Deprecated %s.. accepted by policy"?

-- 
Marc-André Lureau <[email protected]>


Reply via email to