diff options
author | Markus Armbruster <armbru@redhat.com> | 2010-02-18 19:48:33 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2010-03-16 16:58:32 +0100 |
commit | cf5a65aaaf3e9382e50df550ba049a1c8691a5dd (patch) | |
tree | cefb10d2cab499ba0d7c76682503a309c187dc4a /vl.c | |
parent | 65abca0a3441fb47024553e7676f6f3eef685a32 (diff) |
error: Track locations in configuration files
New LOC_FILE. Use it for tracking file name and line number in
qemu_config_parse(). We now report errors like
qemu:foo.conf:42: Did not find I2C bus for smbus-eeprom
In particular, gems like this message:
-device: no driver specified
become almost nice now:
qemu:foo.conf:44: -device: no driver specified
(A later commit will get rid of the bogus -device:)
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -4941,18 +4941,22 @@ int main(int argc, char **argv, char **envp) } if (defconfig) { + const char *fname; FILE *fp; - fp = fopen(CONFIG_QEMU_CONFDIR "/qemu.conf", "r"); + + fname = CONFIG_QEMU_CONFDIR "/qemu.conf"; + fp = fopen(fname, "r"); if (fp) { - if (qemu_config_parse(fp) != 0) { + if (qemu_config_parse(fp, fname) != 0) { exit(1); } fclose(fp); } - fp = fopen(CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", "r"); + fname = CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf"; + fp = fopen(fname, "r"); if (fp) { - if (qemu_config_parse(fp) != 0) { + if (qemu_config_parse(fp, fname) != 0) { exit(1); } fclose(fp); @@ -5633,7 +5637,7 @@ int main(int argc, char **argv, char **envp) fprintf(stderr, "open %s: %s\n", optarg, strerror(errno)); exit(1); } - if (qemu_config_parse(fp) != 0) { + if (qemu_config_parse(fp, optarg) != 0) { exit(1); } fclose(fp); |