aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qemu-config.c12
-rw-r--r--vl.c4
2 files changed, 10 insertions, 6 deletions
diff --git a/qemu-config.c b/qemu-config.c
index d5008851cb..aa376d450a 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -521,14 +521,18 @@ out:
int qemu_read_config_file(const char *filename)
{
FILE *f = fopen(filename, "r");
+ int ret;
+
if (f == NULL) {
return -errno;
}
- if (qemu_config_parse(f, vm_config_groups, filename) != 0) {
- return -EINVAL;
- }
+ ret = qemu_config_parse(f, vm_config_groups, filename);
fclose(f);
- return 0;
+ if (ret == 0) {
+ return 0;
+ } else {
+ return -EINVAL;
+ }
}
diff --git a/vl.c b/vl.c
index 8c818f0d24..328395e3dd 100644
--- a/vl.c
+++ b/vl.c
@@ -2662,12 +2662,12 @@ int main(int argc, char **argv, char **envp)
int ret;
ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/qemu.conf");
- if (ret == -EINVAL) {
+ if (ret < 0 && ret != -ENOENT) {
exit(1);
}
ret = qemu_read_config_file(arch_config_name);
- if (ret == -EINVAL) {
+ if (ret < 0 && ret != -ENOENT) {
exit(1);
}
}