On Fri, Sep 20, 2024 at 15:24:03 +0400, Marc-André Lureau wrote: > Hi > > On Thu, Sep 19, 2024 at 10:05 PM Stefan Berger <stefanb@xxxxxxxxxxxxx> wrote: > > > > Extend the schema for the TPM emulator profile node. Require that > > the profile the user provides looks like a JSON map that at least > > starts with '{' and ends with '}'. > > > > Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxxxxx> > > --- > > src/conf/schemas/basictypes.rng | 6 ++++++ > > src/conf/schemas/domaincommon.rng | 17 +++++++++++++++++ > > 2 files changed, 23 insertions(+) > > > > diff --git a/src/conf/schemas/basictypes.rng b/src/conf/schemas/basictypes.rng > > index 2931e316b7..06df0fe67e 100644 > > --- a/src/conf/schemas/basictypes.rng > > +++ b/src/conf/schemas/basictypes.rng > > @@ -677,4 +677,10 @@ > > </element> > > </define> > > > > + <define name="JSONMap"> > > + <data type="string"> > > + <param name="pattern">\{.*\}</param> > > + </data> > > + </define> > > It's unfortunate, but I think this should rather be XML and converted > to JSON internally (after all, that's part of what libvirt does with > QEMU configuration, somehow) Yeah, having arbitrary JSON is weird and also bypasses the philosophy that libvirt should express in the schema only what we really support (E.g. no raw arbitrary value passthrough, unless explicitly marked as without guarantees) > > if there is a precedent for such mixing of languages, and it's > acceptable I am okay with it too We don't have anything like that.