]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
Enhance qemuParseCommandLineKeywords
authorJiri Denemark <jdenemar@redhat.com>
Wed, 13 Jan 2010 15:48:30 +0000 (16:48 +0100)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 19 Jan 2010 10:23:03 +0000 (11:23 +0100)
commit014c9f3196024b9e7fd44479cb72958b63675bfb
treeb4aa9dcb6ead8cd852efba9e2141e444d26fc813
parentb66924148a4ec18a07c76f171ecbec608faf8576
Enhance qemuParseCommandLineKeywords

Current version expects name=value,... list and when an incorrect string
such as "a,b,c=d" would be parsed as "a,b,c" keyword with "d" value
without reporting any error, which is probably not the expected
behavior.

This patch adds an extra argument called allowEmptyValue, which if
non-zero will permit keywords with no value; "a,b=c,,d=" will be parsed
as follows:
    keyword value
    "a"     NULL
    "b"     "c"
    ""      NULL
    "d"     ""

In case allowEmptyValue is zero, the string is required to contain
name=value pairs only; retvalues is guaranteed to contain non-NULL
pointers. Now, "a,b,c=d" will result in an error.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_conf.c