From nobody Sun Apr 28 09:08:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552934080447392.8232827761626; Mon, 18 Mar 2019 11:34:40 -0700 (PDT) Received: from localhost ([127.0.0.1]:45832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5x5q-0005SB-DS for importer@patchew.org; Mon, 18 Mar 2019 14:34:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5x4w-00056b-Lh for qemu-devel@nongnu.org; Mon, 18 Mar 2019 14:33:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5x4u-0000I7-C7 for qemu-devel@nongnu.org; Mon, 18 Mar 2019 14:33:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50572) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h5x4r-00005h-5H for qemu-devel@nongnu.org; Mon, 18 Mar 2019 14:33:37 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1714B3024552 for ; Mon, 18 Mar 2019 18:33:14 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D8467272B3; Mon, 18 Mar 2019 18:33:13 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6221111385E4; Mon, 18 Mar 2019 19:33:12 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Mar 2019 19:33:12 +0100 Message-Id: <20190318183312.4684-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 18 Mar 2019 18:33:14 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] vl: Fix error location of positional arguments X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We blame badness in positional arguments on the last option argument: $ qemu-system-x86_64 -vnc :1 bad.img qemu-system-x86_64: -vnc :1: Could not open 'foo': No such file or dire= ctory I believe we've done this ever since we reported locations. Fix it to qemu-system-x86_64: bad.img: Could not open 'bad.img': No such file or = directory Reported-by: Daniel P. Berrang=C3=A9 Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefano Garzarella --- vl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vl.c b/vl.c index c1d5484e12..9b215341a3 100644 --- a/vl.c +++ b/vl.c @@ -3119,6 +3119,7 @@ int main(int argc, char **argv, char **envp) if (optind >=3D argc) break; if (argv[optind][0] !=3D '-') { + loc_set_cmdline(argv, optind, 1); drive_add(IF_DEFAULT, 0, argv[optind++], HD_OPTS); } else { const QEMUOption *popt; --=20 2.17.2