On Mon, 1 Jul 2019 10:20:43 +0200
Cornelia Huck <cohuck(a)redhat.com> wrote:
On Fri, 28 Jun 2019 11:05:46 -0600
Alex Williamson <alex.williamson(a)redhat.com> wrote:
> On Fri, 28 Jun 2019 11:06:48 +0200
> Cornelia Huck <cohuck(a)redhat.com> wrote:
> > What do you think of a way to specify JSON for the attributes directly
> > on the command line? Or would it be better to just edit the config
> > files directly?
>
> Supplying json on the command like seems difficult, even doing so with
> with jq requires escaping quotes. It's not a very friendly
> experience. Maybe something more like how virsh allows snippets of xml
> to be included, we could use jq to validate a json snippet provided
> as a file and add it to the attributes... of course if we need to allow
> libvirt to modify the json config files directly, the user could do
> that as well. Is there a use case you're thinking of? Maybe we could
> augment the 'list' command to take a --uuid and --dumpjson option and
> the 'define' command to accept a --jsonfile. Maybe the 'start'
command
> could accept the same, so a transient device could define attributes
> w/o excessive command line options. Thanks,
>
> Alex
I was mostly thinking about complex configurations where writing a JSON
config would be simpler than adding a lot of command line options.
Something like dumping a JSON file and allowing to refer to a JSON file
as you suggested could be useful; but then, those very complex use
cases are probably already covered by editing the config file directly.
Not sure if it is worth the effort; maybe just leave it as it is for
now.
Well, I already did it. It seems useful for creating transient devices
with attribute specifications. If it's too ugly we can drop it.
Thanks,
Alex