qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Eric Blake <eblake@redhat.com>,
	qemu-devel@nongnu.org, Jason Wang <jasowang@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] qemu-doc: Rework the network options chapter to make "-net" less prominent
Date: Fri, 9 Mar 2018 18:41:05 +0100	[thread overview]
Message-ID: <5df712f0-4388-9351-f5e5-f88a8d569cb6@redhat.com> (raw)
In-Reply-To: <92dfc791-1fe6-f421-000b-6d103235417a@redhat.com>

On 09.03.2018 15:36, Eric Blake wrote:
> On 03/09/2018 12:13 AM, Thomas Huth wrote:
>> "-net" is clearly a legacy option. Yet we still use it in almost all
>> examples in the qemu documentation, and many other spots in the network
>> chapter. We should make it less prominent that users are not lured into
>> using it so often anymore. So instead of starting the network chapter
>> with
>> "-net nic" and documenting "-net <backend>" below "-netdev <backend>"
>> everywhere, all the "-net" related documentation is now moved to the end
>> of the chapter. The new "--nic" option is moved to the beginning of the
>> chapter instead, with a new example that should demonstrate how "--nic"
>> can be used to shortcut "--device" with "--netdev".
>> And the examples in this chapter are changed to use the "--device" and
>> "--netdev" options or "--nic" instead of "-net nic -net <backend>".
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>   qemu-options.hx | 210
>> ++++++++++++++++++++++++++++----------------------------
>>   1 file changed, 105 insertions(+), 105 deletions(-)
>>
> 
>> -@item -netdev user,id=@var{id}[,@var{option}][,@var{option}][,...]
>> -@findex -netdev
>> -@item -net user[,@var{option}][,@var{option}][,...]
>> -Use the user mode network stack which requires no administrator
>> +@item --nic
>> [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]
>>
>> +
>> +This option is a shortcut for configuring both, the on-board
>> (default) guest
> 
> s/both,/both/
> 
>> +NIC hardware and the host network backend in one go. The host backend
>> options
>> +are the same as with the corresponding @option{--netdev} options below.
>> +The guest NIC model can be set with @option{model=@var{modelname}}.
>> +Use @option{model=help} to list the available device types.
>> +The hardware MAC address can be set with @option{mac=@var{macaddr}}.
>> +
>> +The following two example do exactly the same, to show how
>> @option{--nic} can
>> +be used to shorten the command line length (note that the e1000 is
>> the default
>> +on i386, so the @option{model=e1000} parameter could even be omitted
>> here, too):
>> +@example
>> +qemu-system-i386 --netdev user,id=n1,ipv6=off
>> --device=e1000,netdev=n1,mac=52:54:98:76:54:32
>> +qemu-system-i386 --nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32
>> +@end example
> 
> Nice example.

... but looks like I even got it wrong - it should be "--device e1000",
without "=". Will fix it.

>> +
>> +@item --nic none
>> +Indicate that no network devices should be configured. It is used to
>> override
>> +the default configuration (default NIC with @option{--net user}
>> backend) which
>> +is activated if no other networking options are provided.
>> +
>> +@item --netdev user,id=@var{id}[,@var{option}][,@var{option}][,...]
>> +@findex --netdev
>> +Configure user mode host network backend which requires no administrator
>>   privilege to run. Valid options are:
>> @@ -2166,8 +2166,6 @@ or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS}
>> (Windows NT/2000).
>>   Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
>>     Note that a SAMBA server must be installed on the host OS.
>> -QEMU was tested successfully with smbd versions from Red Hat 9,
>> -Fedora Core 3 and OpenSUSE 11.x.
>>   
> 
> This change makes sense, but is somewhat unrelated to -net.  Worth
> splitting the patch?

Not sure whether it's really worth the effort ... I think I'll just
mention it in the patch description, ok?

>>   @item
>> hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
>>
>>   Redirect incoming TCP or UDP connections to the host port
>> @var{hostport} to
>> @@ -2182,7 +2180,7 @@ screen 0, use the following:
>>     @example
>>   # on the host
>> -qemu-system-i386 -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...]
>> +qemu-system-i386 --nic user,hostfwd=tcp:127.0.0.1:6001-:6000
> 
> The trailing [...] makes sense here, why did you drop it?

Since we're incredibly inconsistent with that. Some examples do have
that "[...]", many others don't have it. Since the amount of examples
without it is larger than the amount of examples with it, I think it's
more consistent to drop it here.

I guess I should mention this in the commit message, too.

>> +@item -net
>> nic[,vlan=@var{n}][,netdev=@var{nd}][,macaddr=@var{mac}][,model=@var{type}]
>> [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
> 
> Worth spelling this --net instead of -net?

Yes, that's more consistent.

>> +@findex -net
> 
> We can have multiple @findex listings; should we list both @findex -net
> and @findex --net?

I think we should finally also use double dashes for all @findex entries
(if the option is longer than just one letter).

 Thomas

  reply	other threads:[~2018-03-09 17:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09  6:13 [Qemu-devel] [PATCH] qemu-doc: Rework the network options chapter to make "-net" less prominent Thomas Huth
2018-03-09 14:36 ` Eric Blake
2018-03-09 17:41   ` Thomas Huth [this message]
2018-03-09 19:00     ` Eric Blake
2018-03-09 22:07       ` Thomas Huth
2018-03-09 22:33         ` Eric Blake
2018-03-09 14:41 ` Paolo Bonzini
2018-03-09 17:20   ` Thomas Huth

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=5df712f0-4388-9351-f5e5-f88a8d569cb6@redhat.com \
    --to=thuth@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@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).