diff options
author | Paolo Bonzini | 2021-02-26 18:08:16 +0100 |
---|---|---|
committer | Paolo Bonzini | 2021-03-06 11:41:54 +0100 |
commit | f7544edcd32e602af1aae86714dc7c32350d5d7c (patch) | |
tree | 22185cf2eae0045437bd608fcb3d367a7a8a4162 /include/qemu | |
parent | x86/pvh: extract only 4 bytes of start address for 32 bit kernels (diff) | |
download | qemu-f7544edcd32e602af1aae86714dc7c32350d5d7c.tar.gz qemu-f7544edcd32e602af1aae86714dc7c32350d5d7c.tar.xz qemu-f7544edcd32e602af1aae86714dc7c32350d5d7c.zip |
qemu-config: add error propagation to qemu_config_parse
This enables some simplification of vl.c via error_fatal, and improves
error messages. Before:
$ ./qemu-system-x86_64 -readconfig .
qemu-system-x86_64: error reading file
qemu-system-x86_64: -readconfig .: read config .: Invalid argument
$ /usr/libexec/qemu-kvm -readconfig foo
qemu-kvm: -readconfig foo: read config foo: No such file or directory
After:
$ ./qemu-system-x86_64 -readconfig .
qemu-system-x86_64: -readconfig .: Cannot read config file: Is a directory
$ ./qemu-system-x86_64 -readconfig foo
qemu-system-x86_64: -readconfig foo: Could not open 'foo': No such file or directory
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210226170816.231173-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r-- | include/qemu/config-file.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/qemu/config-file.h b/include/qemu/config-file.h index 29226107bd..8d3e53ae4d 100644 --- a/include/qemu/config-file.h +++ b/include/qemu/config-file.h @@ -11,9 +11,10 @@ void qemu_add_drive_opts(QemuOptsList *list); int qemu_global_option(const char *str); void qemu_config_write(FILE *fp); -int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname); +int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname, + Error **errp); -int qemu_read_config_file(const char *filename); +int qemu_read_config_file(const char *filename, Error **errp); /* Parse QDict options as a replacement for a config file (allowing multiple enumerated (0..(n-1)) configuration "sections") */ |