[Libguestfs] [PATCH nbdkit 2/2] server: Avoid modifying argv by saving keys in a list and freeing on exit.

Eric Blake eblake at redhat.com
Tue Feb 18 12:34:44 UTC 2020


On 2/18/20 4:52 AM, Richard W.M. Jones wrote:
> Unfortunately you cannot restore argv by setting *p = '=' :-(
> 
> The reason is we advertize that plugins are allowed to save they
> ‘const char *key’ pointer passed to them in .config, but assigning
> *p = '=' changes the key string from "key" back to "key=value".

D'oh. And my bad for only running the subset of the testsuite that I was 
working on ('make -C tests check TESTS=test-vddk.sh') rather than the 
full suite, or I would have noticed the regression from my one-liner. 
Thanks for fixing it.

> 
> Surprisingly only test-eval.sh actually broke, but other plugins are
> undoubtedly affected.
> 
> My alternate fix is fairly horrible, but passes all the tests and
> valgrind.

It looks right to me - if we can't modify argv[] in place, we have to 
copy off a stable version somewhere.  Your patch is definitely longer 
than my one-liner, but I don't see any way to shorten it.

ACK.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




More information about the Libguestfs mailing list