From patchwork Fri Feb 12 19:02:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 8295451 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DB1C59F1E0 for ; Fri, 12 Feb 2016 19:04:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55E4420445 for ; Fri, 12 Feb 2016 19:04:14 +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 A723720450 for ; Fri, 12 Feb 2016 19:04:13 +0000 (UTC) Received: from localhost ([::1]:35490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUJ0n-0004u4-2M for patchwork-qemu-devel@patchwork.kernel.org; Fri, 12 Feb 2016 14:04:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUIzG-0002FB-EZ for qemu-devel@nongnu.org; Fri, 12 Feb 2016 14:02:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUIzF-00081C-KE for qemu-devel@nongnu.org; Fri, 12 Feb 2016 14:02:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUIzF-000818-Eo for qemu-devel@nongnu.org; Fri, 12 Feb 2016 14:02:37 -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 12B56C0C2377 for ; Fri, 12 Feb 2016 19:02:37 +0000 (UTC) Received: from localhost (vpn1-7-162.gru2.redhat.com [10.97.7.162]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1CJ2ZoE005763; Fri, 12 Feb 2016 14:02:36 -0500 From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Fri, 12 Feb 2016 17:02:26 -0200 Message-Id: <1455303747-19776-4-git-send-email-ehabkost@redhat.com> In-Reply-To: <1455303747-19776-1-git-send-email-ehabkost@redhat.com> References: <1455303747-19776-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Marcel Apfelbaum , Paolo Bonzini , lersek@redhat.com, armbru@redhat.com Subject: [Qemu-devel] [PATCH v2 3/4] replay: Set error location properly when parsing 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 Set error location so the error_report() calls will show appropriate command-line argument or config file info. Signed-off-by: Eduardo Habkost Reviewed-by: Marcel Apfelbaum --- replay/replay.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/replay/replay.c b/replay/replay.c index 9cac178..f8739c2 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -262,6 +262,14 @@ void replay_configure(QemuOpts *opts) const char *fname; const char *rr; ReplayMode mode = REPLAY_MODE_NONE; + Location loc; + + if (!opts) { + return; + } + + loc_push_none(&loc); + qemu_opts_loc_restore(opts); rr = qemu_opt_get(opts, "rr"); if (!rr) { @@ -283,6 +291,8 @@ void replay_configure(QemuOpts *opts) } replay_enable(fname, mode); + + loc_pop(&loc); } void replay_start(void)