qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Programmingkid <programmingkidx@gmail.com>
To: Eric Blake <eblake@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
	Qemu-block <qemu-block@nongnu.org>,
	Qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-img.c: increase spacing between commands in documentation
Date: Fri, 17 Aug 2018 15:28:17 -0400	[thread overview]
Message-ID: <D1319041-4F97-49CD-A53C-BFFA6D39BC16@gmail.com> (raw)
In-Reply-To: <c1f8aba9-4a63-4dfa-cf0b-9521c869c9ff@redhat.com>


> On Aug 17, 2018, at 9:44 AM, Eric Blake <eblake@redhat.com> wrote:
> 
> On 08/16/2018 08:27 PM, Programmingkid wrote:
> 
>> I am by no means an expert at qemu-img. But I did try my best to create what I think should be the new output for qemu-img <command> --help. This is just the text I plan on using in a future patch. It is easier to read right now than it will be in patch form, so please let me know if there are any errors in this documentation. Thank you.
>> <amend>
> 
> Just reviewing the first for now, to give you a feel for what to consider.
> 
>> usage: qemu-img amend [--object objectdef] [--image-opts] [-p] [-q] [-f fmt]
>> [-t cache] -o options filename
>> Command parameters:
>>  -f             'fmt' is the disk image format. It is guessed automatically
>>                 in most cases.
> 
> Bad advice. We WANT users to use -f (if you don't, and the automatic guessing sees something that is not raw, but your image SHOULD have been -f raw, then you have a security hole: the guest can write anything into a raw image to make the host access files it shouldn't based on interpreting the raw file as something else).  I'd drop the last sentence, and use just the first.

Ok. 

> 
>> --image-opts    Treat filename as a set of image options, instead of a plain
>>                 filename.
>>  -o             Used with a comma separated list of format specific options in a
>>                 name=value format. Use "-o ?" for an overview of the options
> 
> Please spell that "-o help", not "-o ?".   Otherwise, the user has to quote the ? to avoid it globbing into any single-byte file lying around in the current directory.

"-o ?" and "-o help" does not appear to work for this command. Maybe it should be removed.
This is what I tried:
	qemu-img amend -o help
	qemu-img amend -o ?

This is what I see in both instances: qemu-img: Expecting one image file name

> 
>>                 supported by the used format
>> --object        'objectdef' is a QEMU user creatable object definition. See the
>>                 qemu(1) manual page for a description of the object properties.
>>                 The most common object type is a 'secret', which is used to
>>                 supply passwords and/or encryption keys.
>>  -p             Display progress bar. If the -p option is not used for a command
>>                 that supports it, the progress is reported when the process
>>                 receives a "SIGUSR1" signal.
>>  -q             Quiet mode - do not print any output (except errors). There's no
>>                 progress bar in case both -q and -p options are used.
> 
> Not your fault, but I don't like it when interfaces take mutually exclusive operations but the last one does not win.  Either '-p -q' should behave like '-q', and '-q -p' behave like '-p' (because we accept the mutual exclusion but last one wins), or both forms should error (because they are incompatible).  But having both forms silently behave like '-q' is evil.  So, as long as you're willing to patch up interfaces, that's a project to consider.
> 
>>  -t             Specifies the cache mode that should be used with the
>>                 destination file.
> 
> And what are those modes?  If you're going to be wordy, then give the user enough information to be useful.  Otherwise, being terse in --help is fine (and let the man page be wordy instead).

I don't know what the modes are. Anyone care to fill us in? 


>> Example:
>>     qemu-img amend -o compat=0.10 -f qcow2 image.qcow2
> 
> Where's an example with --image-opts and --object secret?

I prefer examples that I think a user would actually use. The --image-opts and -object options are not necessary to use this command.

> We're trying to move away from compat=0.10 (also spelled compat=v2), and instead start encouraging compat=v3.

So you want this: qemu-img amend -o compat=v3 -f qcow2 image.qcow2

Thank you for reviewing my documentation.

  reply	other threads:[~2018-08-17 19:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180730212249.16418-1-programmingkidx@gmail.com>
2018-07-31  0:55 ` [Qemu-devel] [PATCH] qemu-img.c: increase spacing between commands in documentation Programmingkid
2018-08-13 16:56 ` Max Reitz
2018-08-13 18:19   ` Eric Blake
2018-08-14  8:40     ` Kevin Wolf
2018-08-14 12:55       ` Eric Blake
2018-08-14 17:59         ` Programmingkid
2018-08-17  1:27       ` Programmingkid
2018-08-17 13:44         ` Eric Blake
2018-08-17 19:28           ` Programmingkid [this message]
2018-08-17 20:59             ` Eric Blake
2018-08-18 16:48               ` Programmingkid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D1319041-4F97-49CD-A53C-BFFA6D39BC16@gmail.com \
    --to=programmingkidx@gmail.com \
    --cc=Qemu-devel@nongnu.org \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).