From patchwork Fri Feb 19 13:27:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 8361061 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 211C6C0553 for ; Fri, 19 Feb 2016 13:28:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8AC9720425 for ; Fri, 19 Feb 2016 13:28:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBB2C2041C for ; Fri, 19 Feb 2016 13:28:09 +0000 (UTC) Received: from localhost ([::1]:52282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWl6P-0004rB-90 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 Feb 2016 08:28:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWl6C-0004qO-0A for qemu-devel@nongnu.org; Fri, 19 Feb 2016 08:27:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWl68-0000HL-QD for qemu-devel@nongnu.org; Fri, 19 Feb 2016 08:27:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWl68-0000HE-L7 for qemu-devel@nongnu.org; Fri, 19 Feb 2016 08:27:52 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 1B325C00DDEA for ; Fri, 19 Feb 2016 13:27:52 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-67.ams2.redhat.com [10.36.116.67]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1JDRoYb011243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Feb 2016 08:27:51 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D52763001103; Fri, 19 Feb 2016 14:27:49 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Fri, 19 Feb 2016 14:27:48 +0100 Message-Id: <1455888469-3206-5-git-send-email-armbru@redhat.com> In-Reply-To: <1455888469-3206-1-git-send-email-armbru@redhat.com> References: <1455888469-3206-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Cc: Eduardo Habkost Subject: [Qemu-devel] [PULL 4/5] vl: Set error location when parsing memory options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eduardo Habkost Set error location so the error_report() calls will show appropriate command-line argument or config file info. Signed-off-by: Eduardo Habkost Message-Id: <1455303747-19776-5-git-send-email-ehabkost@redhat.com> Reviewed-by: Laszlo Ersek Signed-off-by: Markus Armbruster --- vl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vl.c b/vl.c index bf0ef90..8c1a1ff 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)