From f7544edcd32e602af1aae86714dc7c32350d5d7c Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 26 Feb 2021 12:08:16 -0500 Subject: qemu-config: add error propagation to qemu_config_parse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster Message-Id: <20210226170816.231173-1-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- block/blkdebug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'block') diff --git a/block/blkdebug.c b/block/blkdebug.c index 5fe6172da9..7eaa8a28bf 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -279,9 +279,8 @@ static int read_config(BDRVBlkdebugState *s, const char *filename, return -errno; } - ret = qemu_config_parse(f, config_groups, filename); + ret = qemu_config_parse(f, config_groups, filename, errp); if (ret < 0) { - error_setg(errp, "Could not parse blkdebug config file"); goto fail; } } -- cgit v1.2.3