From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHQ3a-0001ph-9L for qemu-devel@nongnu.org; Mon, 27 Jun 2016 02:30:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHQ3U-0008Ny-Vv for qemu-devel@nongnu.org; Mon, 27 Jun 2016 02:30:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHQ3U-0008N0-PU for qemu-devel@nongnu.org; Mon, 27 Jun 2016 02:30:00 -0400 From: Markus Armbruster References: <1466941986-4587-1-git-send-email-lma@suse.com> Date: Mon, 27 Jun 2016 08:29:57 +0200 In-Reply-To: <1466941986-4587-1-git-send-email-lma@suse.com> (Lin Ma's message of "Sun, 26 Jun 2016 19:53:06 +0800") Message-ID: <8760svcffe.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] qdev: Workaround for an issue caused by noglob option of shell for -device ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lin Ma Cc: eblake@redhat.com, mst@redhat.com, qemu-devel@nongnu.org Lin Ma writes: > 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; I'm afraid this would silently interpret any one-character driver name as a request for help when a file with this name exists. Not a good idea. Example: "-device .". "-device ?" and similar use of "?" elsewhere is deprecated. Please use "-device help".