aboutsummaryrefslogtreecommitdiff
path: root/qemu-config.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2012-03-20 15:51:57 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2012-06-04 13:49:34 -0300
commit8be7e7e4c72c048b90e3482557954a24bba43ba7 (patch)
tree97a7ff98cd36cb4d158162fbda0d94dcbf57d056 /qemu-config.c
parent783e9b4826b95e53e33c42db6b4bd7d89bdff147 (diff)
qemu-option: qemu_opts_create(): use error_set()
This commit converts qemu_opts_create() from qerror_report() to error_set(). Currently, most calls to qemu_opts_create() can't fail, so most callers don't need any changes. The two cases where code checks for qemu_opts_create() erros are: 1. Initialization code in vl.c. All of them print their own error messages directly to stderr, no need to pass the Error object 2. The functions opts_parse(), qemu_opts_from_qdict() and qemu_chr_parse_compat() make use of the error information and they can be called from HMP or QMP. In this case, to allow for incremental conversion, we propagate the error up using qerror_report_err(), which keeps the QError semantics Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-By: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'qemu-config.c')
-rw-r--r--qemu-config.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/qemu-config.c b/qemu-config.c
index be84a0347c..f8766468bb 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -709,7 +709,7 @@ int qemu_global_option(const char *str)
return -1;
}
- opts = qemu_opts_create(&qemu_global_opts, NULL, 0);
+ opts = qemu_opts_create(&qemu_global_opts, NULL, 0, NULL);
qemu_opt_set(opts, "driver", driver);
qemu_opt_set(opts, "property", property);
qemu_opt_set(opts, "value", str+offset+1);
@@ -781,7 +781,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
list = find_list(lists, group);
if (list == NULL)
goto out;
- opts = qemu_opts_create(list, id, 1);
+ opts = qemu_opts_create(list, id, 1, NULL);
continue;
}
if (sscanf(line, "[%63[^]]]", group) == 1) {
@@ -789,7 +789,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
list = find_list(lists, group);
if (list == NULL)
goto out;
- opts = qemu_opts_create(list, NULL, 0);
+ opts = qemu_opts_create(list, NULL, 0, NULL);
continue;
}
if (sscanf(line, " %63s = \"%1023[^\"]\"", arg, value) == 2) {