On 2013-11-11 13:41, Andreas Färber wrote:
> Am 11.11.2013 08:44, schrieb Alexey Kardashevskiy:
>> This converts +foo/-foo to "foo=on"/"foo=off" respectively when
>> QEMU parser is used for the command line options.
>>
>> "-cpu" parsers in x86 and other architectures should be unaffected
>> by this change.
>>
>> Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru>
>> ---
>>  util/qemu-option.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/util/qemu-option.c b/util/qemu-option.c
>> index efcb5dc..6c8667c 100644
>> --- a/util/qemu-option.c
>> +++ b/util/qemu-option.c
>> @@ -890,6 +890,12 @@ static int opts_do_parse(QemuOpts *opts, const char 
>> *params,
>>                  if (strncmp(option, "no", 2) == 0) {
>>                      memmove(option, option+2, strlen(option+2)+1);
>>                      pstrcpy(value, sizeof(value), "off");
>> +                } else if (strncmp(option, "-", 1) == 0) {
>> +                    memmove(option, option+1, strlen(option+1)+1);
>> +                    pstrcpy(value, sizeof(value), "off");
>> +                } else if (strncmp(option, "+", 1) == 0) {
>> +                    memmove(option, option+1, strlen(option+1)+1);
>> +                    pstrcpy(value, sizeof(value), "on");
>>                  } else {
>>                      pstrcpy(value, sizeof(value), "on");
>>                  }
> 
> This looks like an interesting idea! However this is much too big a
> change to just CC ppc folks on...
> 
> Jan, I wonder if this might break slirp's hostfwd option?

hostfwd starts with ":" in the simplest case - or what pattern do you
have in mind?

Jan

> 
> Not sure what other options potentially starting with '-' might be
> affected. Test cases would be a helpful way of demonstrating that this
> change does not have undesired side effects.
> 
> Regards,
> Andreas
> 

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

Reply via email to