aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-02-18 19:48:33 +0100
committerMarkus Armbruster <armbru@redhat.com>2010-03-16 16:58:32 +0100
commitcf5a65aaaf3e9382e50df550ba049a1c8691a5dd (patch)
treecefb10d2cab499ba0d7c76682503a309c187dc4a /vl.c
parent65abca0a3441fb47024553e7676f6f3eef685a32 (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.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/vl.c b/vl.c
index c3abeeff2e..a83ed553f4 100644
--- a/vl.c
+++ b/vl.c
@@ -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);