aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2016-02-12 17:02:27 -0200
committerMarkus Armbruster <armbru@redhat.com>2016-02-19 13:46:44 +0100
commitbbe2d25c8f89db4f0075a1321b1911b42d97e436 (patch)
tree7dcd99454007d68f27f81c2ac3f20d3528da49c5 /vl.c
parent890ad5508e0e450272faa4b38611b9df5bab871a (diff)
vl: Set error location when parsing memory options
Set error location so the error_report() calls will show appropriate command-line argument or config file info. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <1455303747-19776-5-git-send-email-ehabkost@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index bf0ef90cf9..8c1a1ffbc5 100644
--- a/vl.c
+++ b/vl.c
@@ -2863,6 +2863,10 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
const char *maxmem_str, *slots_str;
const ram_addr_t default_ram_size = mc->default_ram_size;
QemuOpts *opts = qemu_find_opts_singleton("memory");
+ Location loc;
+
+ loc_push_none(&loc);
+ qemu_opts_loc_restore(opts);
sz = 0;
mem_str = qemu_opt_get(opts, "size");
@@ -2937,6 +2941,8 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
"'%s' option", slots_str ? "maxmem" : "slots");
exit(EXIT_FAILURE);
}
+
+ loc_pop(&loc);
}
int main(int argc, char **argv, char **envp)