Re: [Qemu-devel] [PATCH V18 02/25] qemu-option: avoid duplication of default value in QemuOpts

2013-08-28 Thread Dong Xu Wang
On 2013/8/28 20:57, Eric Blake wrote: On 08/12/2013 10:31 PM, Dong Xu Wang wrote: This patch moves 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. ... Else, ret

Re: [Qemu-devel] [PATCH V18 02/25] qemu-option: avoid duplication of default value in QemuOpts

2013-08-28 Thread Eric Blake
On 08/12/2013 10:31 PM, Dong Xu Wang wrote: > This patch moves 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. > ... >Else, return NULL. > > Signed-off-by:

[Qemu-devel] [PATCH V18 02/25] qemu-option: avoid duplication of default value in QemuOpts

2013-08-12 Thread Dong Xu Wang
This patch moves 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. E