From patchwork Sun Jun 26 11:53:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lin Ma X-Patchwork-Id: 640658 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rcr8H6rPmz9t12 for ; Sun, 26 Jun 2016 21:54:23 +1000 (AEST) Received: from localhost ([::1]:53496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bH8dp-0008Ez-Uw for incoming@patchwork.ozlabs.org; Sun, 26 Jun 2016 07:54:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bH8d9-0007xj-GI for qemu-devel@nongnu.org; Sun, 26 Jun 2016 07:53:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bH8d5-0001HO-BW for qemu-devel@nongnu.org; Sun, 26 Jun 2016 07:53:38 -0400 Received: from prv3-mh.provo.novell.com ([137.65.250.26]:56687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bH8d5-0001HE-5R for qemu-devel@nongnu.org; Sun, 26 Jun 2016 07:53:35 -0400 Received: from localhost.localdomain (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Sun, 26 Jun 2016 05:53:24 -0600 From: Lin Ma To: armbru@redhat.com, eblake@redhat.com, mst@redhat.com, qemu-devel@nongnu.org Date: Sun, 26 Jun 2016 19:53:06 +0800 Message-Id: <1466941986-4587-1-git-send-email-lma@suse.com> X-Mailer: git-send-email 2.8.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 137.65.250.26 Subject: [Qemu-devel] [PATCH] qdev: Workaround for an issue caused by noglob option of shell for -device ? 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If there is any filename in current path matching wildcard ?, This filename will be passed into -device ? while 'pathname expansion' isn't disabled by noglob of shell built-in option, qemu reports error in this case. Signed-off-by: Lin Ma --- qdev-monitor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qdev-monitor.c b/qdev-monitor.c index e19617f..f6443cd 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -257,6 +257,11 @@ int qdev_device_help(QemuOpts *opts) DevicePropertyInfoList *prop; driver = qemu_opt_get(opts, "driver"); + + if (driver && access(driver, F_OK == 0) && strlen(driver) == 1) { + driver = "?"; + } + if (driver && is_help_option(driver)) { qdev_print_devinfos(false); return 1;