All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-img-cmds.hx: Add example usage for create command
@ 2018-07-31  2:52 John Arbuckle
  2018-07-31 11:57 ` Eric Blake
  0 siblings, 1 reply; 5+ messages in thread
From: John Arbuckle @ 2018-07-31  2:52 UTC (permalink / raw)
  To: kwolf, qemu-block, mreitz, qemu-devel; +Cc: John Arbuckle

Add an example on how to use the create command. I believe this will make qemu-img easier to use.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
---
 qemu-img-cmds.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
index 69758fb6e8..92f7437944 100644
--- a/qemu-img-cmds.hx
+++ b/qemu-img-cmds.hx
@@ -50,7 +50,7 @@ STEXI
 ETEXI
 
 DEF("create", img_create,
-    "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]")
+    "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]\nExample: qemu-img create -f qcow2 WindowsXP.qcow2 10G")
 STEXI
 @item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}]
 ETEXI
-- 
2.14.3 (Apple Git-98)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-img-cmds.hx: Add example usage for create command
  2018-07-31  2:52 [Qemu-devel] [PATCH] qemu-img-cmds.hx: Add example usage for create command John Arbuckle
@ 2018-07-31 11:57 ` Eric Blake
  2018-07-31 12:35   ` Kevin Wolf
  2018-07-31 13:19   ` Programmingkid
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Blake @ 2018-07-31 11:57 UTC (permalink / raw)
  To: John Arbuckle, kwolf, qemu-block, mreitz, qemu-devel

On 07/30/2018 09:52 PM, John Arbuckle wrote:
> Add an example on how to use the create command. I believe this will make qemu-img easier to use.
> 
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> ---
>   qemu-img-cmds.hx | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
> index 69758fb6e8..92f7437944 100644
> --- a/qemu-img-cmds.hx
> +++ b/qemu-img-cmds.hx
> @@ -50,7 +50,7 @@ STEXI
>   ETEXI
>   
>   DEF("create", img_create,
> -    "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]")
> +    "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]\nExample: qemu-img create -f qcow2 WindowsXP.qcow2 10G")

Making a long line longer. It would be worth using C string 
concatenation and splitting this over two lines, at the \n.

Using the name WindowsXP.qcow2 as the guest is somewhat misleading (that 
OS is proprietary, and quickly reaching the point of obsolescence from 
its vendor - furthermore, qemu-img doesn't actually install an OS, but 
rather creates a blank image for a later install process to utilize); 
better would be a generic name that won't go out of date, such 
'image.qcow2'.


>   STEXI
>   @item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}]
>   ETEXI
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-img-cmds.hx: Add example usage for create command
  2018-07-31 11:57 ` Eric Blake
@ 2018-07-31 12:35   ` Kevin Wolf
  2018-07-31 13:14     ` Programmingkid
  2018-07-31 13:19   ` Programmingkid
  1 sibling, 1 reply; 5+ messages in thread
From: Kevin Wolf @ 2018-07-31 12:35 UTC (permalink / raw)
  To: Eric Blake; +Cc: John Arbuckle, qemu-block, mreitz, qemu-devel

Am 31.07.2018 um 13:57 hat Eric Blake geschrieben:
> On 07/30/2018 09:52 PM, John Arbuckle wrote:
> > Add an example on how to use the create command. I believe this will make qemu-img easier to use.
> > 
> > Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> > ---
> >   qemu-img-cmds.hx | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
> > index 69758fb6e8..92f7437944 100644
> > --- a/qemu-img-cmds.hx
> > +++ b/qemu-img-cmds.hx
> > @@ -50,7 +50,7 @@ STEXI
> >   ETEXI
> >   DEF("create", img_create,
> > -    "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]")
> > +    "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]\nExample: qemu-img create -f qcow2 WindowsXP.qcow2 10G")
> 
> Making a long line longer. It would be worth using C string concatenation
> and splitting this over two lines, at the \n.
> 
> Using the name WindowsXP.qcow2 as the guest is somewhat misleading (that OS
> is proprietary, and quickly reaching the point of obsolescence from its
> vendor - furthermore, qemu-img doesn't actually install an OS, but rather
> creates a blank image for a later install process to utilize); better would
> be a generic name that won't go out of date, such 'image.qcow2'.

Also, while I like the idea of adding examples to the man page, I don't
think adding it here would give the right result. The example would
appear in the middle of the subcommand syntax lines.

I'd rather add a whole new section "EXAMPLES" in the man page.

Kevin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-img-cmds.hx: Add example usage for create command
  2018-07-31 12:35   ` Kevin Wolf
@ 2018-07-31 13:14     ` Programmingkid
  0 siblings, 0 replies; 5+ messages in thread
From: Programmingkid @ 2018-07-31 13:14 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Eric Blake, qemu-block, mreitz, qemu-devel


> On Jul 31, 2018, at 8:35 AM, Kevin Wolf <kwolf@redhat.com> wrote:
> 
> Am 31.07.2018 um 13:57 hat Eric Blake geschrieben:
>> On 07/30/2018 09:52 PM, John Arbuckle wrote:
>>> Add an example on how to use the create command. I believe this will make qemu-img easier to use.
>>> 
>>> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>>> ---
>>>  qemu-img-cmds.hx | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
>>> index 69758fb6e8..92f7437944 100644
>>> --- a/qemu-img-cmds.hx
>>> +++ b/qemu-img-cmds.hx
>>> @@ -50,7 +50,7 @@ STEXI
>>>  ETEXI
>>>  DEF("create", img_create,
>>> -    "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]")
>>> +    "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]\nExample: qemu-img create -f qcow2 WindowsXP.qcow2 10G")
>> 
>> Making a long line longer. It would be worth using C string concatenation
>> and splitting this over two lines, at the \n.
>> 
>> Using the name WindowsXP.qcow2 as the guest is somewhat misleading (that OS
>> is proprietary, and quickly reaching the point of obsolescence from its
>> vendor - furthermore, qemu-img doesn't actually install an OS, but rather
>> creates a blank image for a later install process to utilize); better would
>> be a generic name that won't go out of date, such 'image.qcow2'.
> 
> Also, while I like the idea of adding examples to the man page, I don't
> think adding it here would give the right result. The example would
> appear in the middle of the subcommand syntax lines.

As it reads now I don't feel its easy for the user to decipher. Having an
example near by would help the user understand how to use it.

> I'd rather add a whole new section "EXAMPLES" in the man page.

That is a good idea. I would like to have examples in both documents. 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-img-cmds.hx: Add example usage for create command
  2018-07-31 11:57 ` Eric Blake
  2018-07-31 12:35   ` Kevin Wolf
@ 2018-07-31 13:19   ` Programmingkid
  1 sibling, 0 replies; 5+ messages in thread
From: Programmingkid @ 2018-07-31 13:19 UTC (permalink / raw)
  To: Eric Blake; +Cc: kwolf, qemu-block, mreitz, qemu-devel


> On Jul 31, 2018, at 7:57 AM, Eric Blake <eblake@redhat.com> wrote:
> 
> On 07/30/2018 09:52 PM, John Arbuckle wrote:
>> Add an example on how to use the create command. I believe this will make qemu-img easier to use.
>> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>> ---
>>  qemu-img-cmds.hx | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
>> index 69758fb6e8..92f7437944 100644
>> --- a/qemu-img-cmds.hx
>> +++ b/qemu-img-cmds.hx
>> @@ -50,7 +50,7 @@ STEXI
>>  ETEXI
>>    DEF("create", img_create,
>> -    "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]")
>> +    "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]\nExample: qemu-img create -f qcow2 WindowsXP.qcow2 10G")
> 
> Making a long line longer. It would be worth using C string concatenation and splitting this over two lines, at the \n.

Sounds like a good idea.

> Using the name WindowsXP.qcow2 as the guest is somewhat misleading (that OS is proprietary, and quickly reaching the point of obsolescence from its vendor - furthermore, qemu-img doesn't actually install an OS, but rather creates a blank image for a later install process to utilize); better would be a generic name that won't go out of date, such 'image.qcow2'.

I always felt a concrete example was easier to understand rather than a generic example. What about this: 

Example: qemu-img create -f qcow2 <HD image name>.qcow2 10G

> 
>>  STEXI
>>  @item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}]
>>  ETEXI
> 
> -- 
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-31 13:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31  2:52 [Qemu-devel] [PATCH] qemu-img-cmds.hx: Add example usage for create command John Arbuckle
2018-07-31 11:57 ` Eric Blake
2018-07-31 12:35   ` Kevin Wolf
2018-07-31 13:14     ` Programmingkid
2018-07-31 13:19   ` Programmingkid

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.