On 05/30/2013 03:55 AM, Dongxu Wang wrote: > From: Dong Xu Wang <wdon...@linux.vnet.ibm.com> > > This patch will move the default value entirely to QemuOptDesc. > > When getting the value of an option that hasn't been set, and > QemuOptDesc has a default value, return that. Else, behave as > before. > > Example: qemu_opt_get_number(opts, "foo", 42) > > If "foo" has been set in opts, return its value. > > Else, if opt's QemuOptDesc has a default value for "foo", return > that. > > Else, return 42. > > Note that the last argument is useless when QemuOptDesc has a > default value. Ugly. If it bothers us, we could assert. > > Example: qemu_opt_get(opts, "bar") > > If "bar" has been set in opts, return its value. > > Else, if opt's QemuOptDesc has a default value for "bar", return > that. > > Else, return NULL. > > Signed-off-by: Dong Xu Wang <wdon...@linux.vnet.ibm.com> > > v13->v14: > 1) change code style. > 2) assert errors. > Signed-off-by: Dongxu Wang <wdon...@linux.vnet.ibm.com>
Again, a bit of a mess at the tail of the commit message. > --- > util/qemu-option.c | 66 > ++++++++++++++++++++++++++++++++++++++++-------------- > 1 file changed, 49 insertions(+), 17 deletions(-) > Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature