[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 27/34] qemu-options: New -compat to set policy for depreca
From: |
Eric Blake |
Subject: |
Re: [PATCH v4 27/34] qemu-options: New -compat to set policy for deprecated interfaces |
Date: |
Tue, 17 Mar 2020 16:05:47 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 3/17/20 6:54 AM, Markus Armbruster wrote:
Policy is separate for input and output.
Input policy can be "accept" (accept silently), or "reject" (reject
the request with an error).
Output policy can be "accept" (pass on unchanged), or "hide" (filter
out the deprecated parts).
Default is "accept". Policies other than "accept" are implemented
later in this series.
For now, -compat covers only syntactic aspects of QMP, i.e. stuff
tagged with feature 'deprecated'. We may want to extend it to cover
semantic aspects, CLI, and experimental features.
The option is experimental.
On IRC, we decided that it's probably not worth shoe-horning this (and
the rest of the series) into 5.0, given the experimental nature. Still,
I'll go ahead and review, so we can settle on things early in 5.1.
Signed-off-by: Markus Armbruster <address@hidden>
---
+++ b/qapi/compat.json
@@ -0,0 +1,51 @@
+# -*- Mode: Python -*-
+
+##
+# = Compatibility policy
+##
+
+##
+# @CompatPolicyInput:
+#
+# Policy for handling "funny" input.
+#
+# @accept: Accept silently
+# @reject: Reject with an error
+#
+# Since: 5.0
Of course, now that we're slipping this, you'll have to s/5.0/5.1/g over
the remaining patches. I won't point it out further.
+##
+# @CompatPolicy:
+#
+# Policy for handling deprecated management interfaces.
+#
+# This is intended for testing users of the management interfaces.
+#
+# Limitation: covers only syntactic aspects of QMP, i.e. stuff tagged
+# with feature 'deprecated'. We may want to extend it to cover
+# semantic aspects, CLI, and experimental features.
Hiding/rejecting x- interfaces is probably the easiest of these, but I
agree that leaving this open-ended to add further coverage (or even
additional modes) is still reasonable.
+#
+# @deprecated-input: how to handle deprecated input (default 'accept')
+# @deprecated-output: how to handle deprecated output (default 'accept')
+#
+# Since: 5.0
+##
+{ 'struct': 'CompatPolicy',
+ 'data': { '*deprecated-input': 'CompatPolicyInput',
+ '*deprecated-output': 'CompatPolicyOutput' } }
For example, adding
'*experimental-input': 'CompatPolicyInput'
would make it easy to hard-code failure on attempt to use x-* commands.
+++ b/include/qapi/compat-policy.h
@@ -0,0 +1,20 @@
+/*
+ * Policy for handling "funny" management interfaces
+ *
+ * Copyright (C) 2019 Red Hat, Inc.
You've had this in-tree for a while. I'll leave it up to you if you want
to add 2020.
+ *
+ * Authors:
+ * Markus Armbruster <address@hidden>,
+ *
Ending with a comma is odd. Is the Authors: snippet even necessary, or
are we better off relying on git history (which tends to be more
accurate anyway)?
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later. See the COPYING file in the top-level directory.
+ */
Are we trying to use SPDX tags in more files?
+++ b/qemu-options.hx
@@ -3357,6 +3357,26 @@ DEFHEADING()
DEFHEADING(Debug/Expert options:)
+DEF("compat", HAS_ARG, QEMU_OPTION_compat,
+ "-compat
[deprecated-input=accept|reject][,deprecated-output=accept|hide]\n"
+ " Policy for handling deprecated management interfaces\n",
+ QEMU_ARCH_ALL)
+SRST
+``-compat
[deprecated-input=@var{input-policy}][,deprecated-output=@var{output-policy}]``
+ Set policy for handling deprecated management interfaces (experimental):
We'll eventually want to drop (experimental), especially if we get all
the rest of this into 5.1.
But for now this looks like a good start.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
- [PATCH v4 11/34] qapi/schema: Clean up around QAPISchemaEntity.connect_doc(), (continued)
- [PATCH v4 11/34] qapi/schema: Clean up around QAPISchemaEntity.connect_doc(), Markus Armbruster, 2020/03/17
- [PATCH v4 24/34] qapi: Replace qmp_dispatch()'s TODO comment by an explanation, Markus Armbruster, 2020/03/17
- [PATCH v4 30/34] qapi: Implement deprecated-output=hide for QMP event data, Markus Armbruster, 2020/03/17
- [PATCH v4 22/34] qapi: Simplify how qmp_dispatch() deals with QCO_NO_SUCCESS_RESP, Markus Armbruster, 2020/03/17
- [PATCH v4 10/34] tests/test-qmp-event: Check event is actually emitted, Markus Armbruster, 2020/03/17
- [PATCH v4 18/34] qapi/schema: Rename QAPISchemaObjectType{Variant, Variants}, Markus Armbruster, 2020/03/17
- [PATCH v4 27/34] qemu-options: New -compat to set policy for deprecated interfaces, Markus Armbruster, 2020/03/17
- Re: [PATCH v4 27/34] qemu-options: New -compat to set policy for deprecated interfaces,
Eric Blake <=
- [PATCH v4 21/34] qapi: Inline do_qmp_dispatch() into qmp_dispatch(), Markus Armbruster, 2020/03/17
- [PATCH v4 32/34] qapi: Implement deprecated-input=reject for QMP commands, Markus Armbruster, 2020/03/17
- [PATCH v4 28/34] qapi: Implement deprecated-output=hide for QMP command results, Markus Armbruster, 2020/03/17
- [PATCH v4 25/34] qapi: New special feature flag "deprecated", Markus Armbruster, 2020/03/17
- [PATCH v4 13/34] qapi: Consistently put @features parameter right after @ifcond, Markus Armbruster, 2020/03/17