On 12/15/2016 12:32 AM, Paolo Bonzini wrote: >>>> In other words: this fixes the mb_add_cmdline(kcmdline) case, and >>>> doesn't break comma escaping on the initrd case (because it was >>>> already broken). I don't see a problem with this patch. >>> ... there is one case of comma escaping that wasn't broken: >>> >>> $ qemu-system-x86_64 -kernel foo -initrd '/tmp/one >>> arg,,with,,commas,/tmp/another arg,,with,,commas' >>> >> Oh, I didn't notice the whitespace-based split for initrd >> arguments. So that's how it works :-) >> This is messier than I thought. Maybe the simplest solution is to >> inline mb_add_cmdline() at both callers, and change the kcmdline >> one to use memcpy(). >
OK, I have a new version that does with memcpy for the cmdline, with get_opt_value() for the modules and also unescapes the filename for get_image_size()/load_image() . You still can't have spaces in filenames, so maybe a new scheme should be devised for this. Regards, Vlad