[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [v5 12/12] migration: Add commands to set and query par
From: |
Li, Liang Z |
Subject: |
Re: [Qemu-devel] [v5 12/12] migration: Add commands to set and query parameter |
Date: |
Fri, 20 Mar 2015 05:16:05 +0000 |
> > >> The command takes a list of key-value pairs. Looks like this
> > >> (example stolen from your patch to qmp-commands.hx):
> > >>
> > >> { "execute": "migrate-set-parameters",
> > >> "arguments": { "parameters":
> > >> [ { "parameter": "compress-level", "value": 1
> > >> } ] } }
> > >>
> > >> Awkward. I'd very much prefer
> > >>
> > >> { "execute": "migrate-set-parameters",
> > >> "arguments": { "compress-level", 1 } }
> > >>
> > >> I.e. the command simply takes the parameters as optional arguments.
> > >> Simpler, and a natural use of the schema language.
> > >
> > > Yes, it seems complicated. Eric suggested to use this type of
> > > interface, because it can support different type of parameters if
> > > some new parameters will be added.
> >
> > I don't understand.
> >
> > Schema for the three parameters we have now:
> >
> > { 'command': 'migrate-set-parameters',
> > 'data': { '*compression-level': 'int',
> > '*compression-threads': 'int,
> > '*decompression-threads': 'int' } }
> >
> > Let's add a parameter with some other type:
> >
> > { 'command': 'migrate-set-parameters',
> > 'data': { '*compression-level': 'int',
> > '*compression-threads': 'int,
> > '*compression-algorithm': 'CompressionAlgorithm',
> > '*decompression-threads': 'int', } }
> >
> > CompressionAlgorithm could be an enum.
> >
> > Why wouldn't that work?
>
> To be honest, I know very little about QMP and JSON. What should I do to
> make the schema as you described?
>
You have answered me, sorry!