@@ -524,6 +524,7 @@ qapi-schema += missing-type.json
qapi-schema += nested-struct-data.json
qapi-schema += non-objects.json
qapi-schema += oob-test.json
+qapi-schema += allowed-in-preconfig-test.json
qapi-schema += pragma-doc-required-crap.json
qapi-schema += pragma-extra-junk.json
qapi-schema += pragma-name-case-whitelist-crap.json
new file mode 100644
@@ -0,0 +1 @@
+tests/qapi-schema/allowed-in-preconfig-test.json:2: 'allowed-in-preconfig' of command 'allowed-in-preconfig-test' should only use true value
new file mode 100644
@@ -0,0 +1 @@
+1
new file mode 100644
@@ -0,0 +1,2 @@
+# Check against allowed-in-preconfig illegal value
+{ 'command': 'allowed-in-preconfig-test', 'allowed-in-preconfig': 'some-string' }
new file mode 100644
@@ -142,6 +142,9 @@
# Smoke test on Out-Of-Band
{ 'command': 'an-oob-command', 'allow-oob': true }
+# test allowed-in-preconfig flag
+{ 'command': 'allowed-in-preconfig-test', 'allowed-in-preconfig': true }
+
# For testing integer range flattening in opts-visitor. The following schema
# corresponds to the option format:
#
@@ -168,6 +168,8 @@ command boxed-union UserDefNativeListUnion -> None
gen=True success_response=True boxed=True oob=False preconfig=False
command an-oob-command None -> None
gen=True success_response=True boxed=False oob=True preconfig=False
+command allowed-in-preconfig-test None -> None
+ gen=True success_response=True boxed=False oob=False preconfig=True
object UserDefOptions
member i64: intList optional=True
member u64: uint64List optional=True
@@ -20,6 +20,10 @@ void qmp_an_oob_command(Error **errp)
{
}
+void qmp_allowed_in_preconfig_test(Error **errp)
+{
+}
+
Empty2 *qmp_user_def_cmd0(Error **errp)
{
return g_new0(Empty2, 1);
make sure the QAPISchema can parse allowed-in-preconfig correctly Signed-off-by: Igor Mammedov <imammedo@redhat.com> --- tests/Makefile.include | 1 + tests/qapi-schema/allowed-in-preconfig-test.err | 1 + tests/qapi-schema/allowed-in-preconfig-test.exit | 1 + tests/qapi-schema/allowed-in-preconfig-test.json | 2 ++ tests/qapi-schema/allowed-in-preconfig-test.out | 0 tests/qapi-schema/qapi-schema-test.json | 3 +++ tests/qapi-schema/qapi-schema-test.out | 2 ++ tests/test-qmp-cmds.c | 4 ++++ 8 files changed, 14 insertions(+) create mode 100644 tests/qapi-schema/allowed-in-preconfig-test.err create mode 100644 tests/qapi-schema/allowed-in-preconfig-test.exit create mode 100644 tests/qapi-schema/allowed-in-preconfig-test.json create mode 100644 tests/qapi-schema/allowed-in-preconfig-test.out