]> git.proxmox.com Git - mirror_qemu.git/commit - util/qemu-option.c
QemuOpts: add def_value_str to QemuOptDesc
authorChunyan Liu <cyliu@suse.com>
Thu, 5 Jun 2014 09:20:42 +0000 (17:20 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 16 Jun 2014 09:23:20 +0000 (17:23 +0800)
commit09722032e15669e653991923613761602c745fa0
treec25f90910ebc8f4a1c2bed88c8ee280b3253a669
parente67905426bf3cf811d31c87789c1c7e986849d66
QemuOpts: add def_value_str to QemuOptDesc

Add def_value_str (default value) to QemuOptDesc, to replace function of the
default value in QEMUOptionParameter.

Improve qemu_opts_get_* functions: if find opt, return opt->str; otherwise,
if desc->def_value_str is set, return desc->def_value_str; otherwise, return
input defval.

Improve qemu_opts_print: if option is set, print opt->str; otherwise, if
desc->def_value_str is set, print it.

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
include/qemu/option.h
util/qemu-option.c