[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Writing a C library to generate qemu command lines and
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] Writing a C library to generate qemu command lines and configuration files |
Date: |
Tue, 2 May 2017 17:54:44 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 02/05/2017 16:59, Richard W.M. Jones wrote:
>> To answer your question: you have to double comma after '=', or else it
>> terminates the value. There is no other quoting.
>
> Hmm, is that really right? It seems to me that any comma must be
> doubled. For example:
>
> $ qemu-system-x86_64 -name foo,bar -writeconfig - -hda die
> qemu-system-x86_64: -name foo,bar: Invalid parameter 'bar'
That's because, as you found out, "-name" is not a simple option but a
compound one; "-name foo" is short for "-name guest=foo" (compare
"-device e1000").
The grammar mentioned in util/keyval.c says that you have to double
comma in a value, *and* comma is completely invalid in a key.
If you have '=', you have to double commas after it and cannot use it
before.
If you have no '=' at all, then you have to double comma too.
Paolo
> $ qemu-system-x86_64 -name foo,,bar -writeconfig - -hda die
> # qemu config file
>
> [name]
> guest = "foo,bar"