From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fT6YZ-0006iB-Nj for mharc-qemu-trivial@gnu.org; Wed, 13 Jun 2018 10:15:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT6YW-0006fo-DL for qemu-trivial@nongnu.org; Wed, 13 Jun 2018 10:15:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fT6YT-0001S1-Ln for qemu-trivial@nongnu.org; Wed, 13 Jun 2018 10:15:24 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:26348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT6YS-0001I1-VA; Wed, 13 Jun 2018 10:15:21 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app12-12012 (RichMail) with SMTP id 2eec5b2126f4a26-52cc4; Wed, 13 Jun 2018 22:15:16 +0800 (CST) X-RM-TRANSID: 2eec5b2126f4a26-52cc4 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.105.0.243]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95b2126f2a53-17e7b; Wed, 13 Jun 2018 22:15:15 +0800 (CST) X-RM-TRANSID: 2ee95b2126f2a53-17e7b Date: Wed, 13 Jun 2018 10:15:10 -0400 From: Yaowei Bai To: Eric Blake Cc: "Emilio G. Cota" , qemu-trivial@nongnu.org, mjt@tls.msk.ru, laurent@vivier.eu, stefanha@redhat.com, qemu-devel@nongnu.org, Markus Armbruster Message-ID: <20180613141510.GA672@byw> Reply-To: baiyaowei@cmss.chinamobile.com References: <1528859749-25286-1-git-send-email-baiyaowei@cmss.chinamobile.com> <20180613035030.GB25430@flamenco> <23a38716-196f-53a0-0a3d-61f269b1dab4@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23a38716-196f-53a0-0a3d-61f269b1dab4@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 221.176.66.81 Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 14:15:25 -0000 On Wed, Jun 13, 2018 at 06:27:49AM -0500, Eric Blake wrote: > On 06/12/2018 10:50 PM, Emilio G. Cota wrote: > >On Tue, Jun 12, 2018 at 23:15:49 -0400, Yaowei Bai wrote: > >>Signed-off-by: Yaowei Bai > >>--- > >> docs/devel/tracing.txt | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >>diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt > >>index 07abbb3..6ab32cc 100644 > >>--- a/docs/devel/tracing.txt > >>+++ b/docs/devel/tracing.txt > >>@@ -18,7 +18,7 @@ for debugging, profiling, and observing execution. > >> 3. Run the virtual machine to produce a trace file: > >>- qemu -trace events=/tmp/events ... # your normal QEMU invocation > >>+ qemu --trace events=/tmp/events ... # your normal QEMU invocation > > > >The second dash is not missing; both '-args' and '--args' work. > > > >'-args' seems to be favoured though; see `qemu -h' or `qemu --h' :-) > > Actually, we're trying to fix that: > https://wiki.qemu.org/BiteSizedTasks#Consistent_option_usage_in_documentation > > The one-vs-two dash usage is only supported in qemu, not in qemu-nbd > or qemu-img (that is, qemu acts as if it uses getopt_long_only(), > while the others use getopt_long() - except that we hand-rolled the > parser in qemu, meaning you might find quirks where it sometimes > doesn't even match getopt_long_only()). > > At any rate, since --trace is an option that is supported across > multiple binaries, we SHOULD favor the double-dash spelling in our > documentation, so that you can consistently reuse the same --trace > invocation without worrying whether the binary parses its arguments Yes, this patch is inspired by this situation when translating DPRINT into trace for a new qemu utility (much like qemu-nbd) following docs/devel/tracing.txt. The utility complains it don't support -trace option. So i sent this patch after confirming this with qemu-nbd,qemu-io utilities. > with getopt_long() (where double is required) or like > getopt_long_only() (where the double is optional but supported). > > So I'm in favor of this patch, although it may need more of a commit > message summarizing the justification I've just pointed you to. Thanks for your nice explaination. If this patch could be merged i will send V2 with a commit message. > > Reviewed-by: Eric Blake Thanks. > > -- > Eric Blake, Principal Software Engineer > Red Hat, Inc. +1-919-301-3266 > Virtualization: qemu.org | libvirt.org From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT6YY-0006hb-UK for qemu-devel@nongnu.org; Wed, 13 Jun 2018 10:15:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fT6YX-0001ag-Rm for qemu-devel@nongnu.org; Wed, 13 Jun 2018 10:15:26 -0400 Date: Wed, 13 Jun 2018 10:15:10 -0400 From: Yaowei Bai Message-ID: <20180613141510.GA672@byw> Reply-To: baiyaowei@cmss.chinamobile.com References: <1528859749-25286-1-git-send-email-baiyaowei@cmss.chinamobile.com> <20180613035030.GB25430@flamenco> <23a38716-196f-53a0-0a3d-61f269b1dab4@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23a38716-196f-53a0-0a3d-61f269b1dab4@redhat.com> Subject: Re: [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: "Emilio G. Cota" , qemu-trivial@nongnu.org, mjt@tls.msk.ru, laurent@vivier.eu, stefanha@redhat.com, qemu-devel@nongnu.org, Markus Armbruster On Wed, Jun 13, 2018 at 06:27:49AM -0500, Eric Blake wrote: > On 06/12/2018 10:50 PM, Emilio G. Cota wrote: > >On Tue, Jun 12, 2018 at 23:15:49 -0400, Yaowei Bai wrote: > >>Signed-off-by: Yaowei Bai > >>--- > >> docs/devel/tracing.txt | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >>diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt > >>index 07abbb3..6ab32cc 100644 > >>--- a/docs/devel/tracing.txt > >>+++ b/docs/devel/tracing.txt > >>@@ -18,7 +18,7 @@ for debugging, profiling, and observing execution. > >> 3. Run the virtual machine to produce a trace file: > >>- qemu -trace events=/tmp/events ... # your normal QEMU invocation > >>+ qemu --trace events=/tmp/events ... # your normal QEMU invocation > > > >The second dash is not missing; both '-args' and '--args' work. > > > >'-args' seems to be favoured though; see `qemu -h' or `qemu --h' :-) > > Actually, we're trying to fix that: > https://wiki.qemu.org/BiteSizedTasks#Consistent_option_usage_in_documentation > > The one-vs-two dash usage is only supported in qemu, not in qemu-nbd > or qemu-img (that is, qemu acts as if it uses getopt_long_only(), > while the others use getopt_long() - except that we hand-rolled the > parser in qemu, meaning you might find quirks where it sometimes > doesn't even match getopt_long_only()). > > At any rate, since --trace is an option that is supported across > multiple binaries, we SHOULD favor the double-dash spelling in our > documentation, so that you can consistently reuse the same --trace > invocation without worrying whether the binary parses its arguments Yes, this patch is inspired by this situation when translating DPRINT into trace for a new qemu utility (much like qemu-nbd) following docs/devel/tracing.txt. The utility complains it don't support -trace option. So i sent this patch after confirming this with qemu-nbd,qemu-io utilities. > with getopt_long() (where double is required) or like > getopt_long_only() (where the double is optional but supported). > > So I'm in favor of this patch, although it may need more of a commit > message summarizing the justification I've just pointed you to. Thanks for your nice explaination. If this patch could be merged i will send V2 with a commit message. > > Reviewed-by: Eric Blake Thanks. > > -- > Eric Blake, Principal Software Engineer > Red Hat, Inc. +1-919-301-3266 > Virtualization: qemu.org | libvirt.org