From patchwork Wed May 27 10:02:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 477032 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B0ACB14012C for ; Wed, 27 May 2015 20:03:49 +1000 (AEST) Received: from localhost ([::1]:52840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxYBd-00059P-OA for incoming@patchwork.ozlabs.org; Wed, 27 May 2015 06:03:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxYBA-0004Pd-6S for qemu-devel@nongnu.org; Wed, 27 May 2015 06:03:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxYB8-00025F-Ex for qemu-devel@nongnu.org; Wed, 27 May 2015 06:03:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxYB8-000259-7g for qemu-devel@nongnu.org; Wed, 27 May 2015 06:03:14 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4RA3CpB006040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 27 May 2015 06:03:12 -0400 Received: from localhost (ovpn-112-78.ams2.redhat.com [10.36.112.78]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4RA3BBV012321; Wed, 27 May 2015 06:03:11 -0400 From: Stefan Hajnoczi To: Date: Wed, 27 May 2015 11:02:52 +0100 Message-Id: <1432720988-20200-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1432720988-20200-1-git-send-email-stefanha@redhat.com> References: <1432720988-20200-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Thomas Huth , Stefan Hajnoczi Subject: [Qemu-devel] [PULL 01/17] net: Change help text to list -netdev instead of -net by default X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth Looking at the output of "qemu-system-xxx -help", you easily get the impression that "-net" is the preferred way instead of "-netdev" to specify host network interface, since the "-net" option is omnipresent but the "-netdev" option is only listed as a one-liner at the end. This is ugly since "-net" is considered as legacy and even might be removed one day. Thus, this patch switches the output to explain the host network interfaces with the "-netdev" option instead, moving the old "-net" option into some few lines at the end. Signed-off-by: Thomas Huth Message-id: 1431701904-12230-1-git-send-email-thuth@redhat.com Signed-off-by: Stefan Hajnoczi --- qemu-options.hx | 77 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index ec356f6..88d7661 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1449,25 +1449,25 @@ DEF("smb", HAS_ARG, QEMU_OPTION_smb, "", QEMU_ARCH_ALL) #endif #endif -DEF("net", HAS_ARG, QEMU_OPTION_net, - "-net nic[,vlan=n][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n" - " create a new Network Interface Card and connect it to VLAN 'n'\n" +DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, #ifdef CONFIG_SLIRP - "-net user[,vlan=n][,name=str][,net=addr[/mask]][,host=addr][,restrict=on|off]\n" + "-netdev user,id=str[,net=addr[/mask]][,host=addr][,restrict=on|off]\n" " [,hostname=host][,dhcpstart=addr][,dns=addr][,dnssearch=domain][,tftp=dir]\n" " [,bootfile=f][,hostfwd=rule][,guestfwd=rule]" #ifndef _WIN32 "[,smb=dir[,smbserver=addr]]\n" #endif - " connect the user mode network stack to VLAN 'n', configure its\n" - " DHCP server and enabled optional services\n" + " configure a user mode network backend with ID 'str',\n" + " its DHCP server and optional services\n" #endif #ifdef _WIN32 - "-net tap[,vlan=n][,name=str],ifname=name\n" - " connect the host TAP network interface to VLAN 'n'\n" + "-netdev tap,id=str,ifname=name\n" + " configure a host TAP network backend with ID 'str'\n" #else - "-net tap[,vlan=n][,name=str][,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off][,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n" - " connect the host TAP network interface to VLAN 'n'\n" + "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n" + " [,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n" + " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n" + " configure a host TAP network backend with ID 'str'\n" " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n" " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n" " to deconfigure it\n" @@ -1486,14 +1486,18 @@ DEF("net", HAS_ARG, QEMU_OPTION_net, " use 'vhostfd=h' to connect to an already opened vhost net device\n" " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n" " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n" - "-net bridge[,vlan=n][,name=str][,br=bridge][,helper=helper]\n" - " connects a host TAP network interface to a host bridge device 'br'\n" - " (default=" DEFAULT_BRIDGE_INTERFACE ") using the program 'helper'\n" - " (default=" DEFAULT_BRIDGE_HELPER ")\n" + "-netdev bridge,id=str[,br=bridge][,helper=helper]\n" + " configure a host TAP network backend with ID 'str' that is\n" + " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n" + " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n" #endif #ifdef __linux__ - "-net l2tpv3[,vlan=n][,name=str],src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6=on/off][,udp=on/off][,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]\n" - " connect the VLAN to an Ethernet over L2TPv3 pseudowire\n" + "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n" + " [,rxsession=rxsession],txsession=txsession[,ipv6=on/off][,udp=on/off]\n" + " [,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie]\n" + " [,rxcookie=rxcookie][,offset=offset]\n" + " configure a network backend with ID 'str' connected to\n" + " an Ethernet over L2TPv3 pseudowire.\n" " Linux kernel 3.3+ as well as most routers can talk\n" " L2TPv3. This transport allows connecting a VM to a VM,\n" " VM to a router and even VM to Host. It is a nearly-universal\n" @@ -1514,32 +1518,41 @@ DEF("net", HAS_ARG, QEMU_OPTION_net, " use 'pincounter=on' to work around broken counter handling in peer\n" " use 'offset=X' to add an extra offset between header and data\n" #endif - "-net socket[,vlan=n][,name=str][,fd=h][,listen=[host]:port][,connect=host:port]\n" - " connect the vlan 'n' to another VLAN using a socket connection\n" - "-net socket[,vlan=n][,name=str][,fd=h][,mcast=maddr:port[,localaddr=addr]]\n" - " connect the vlan 'n' to multicast maddr and port\n" + "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n" + " configure a network backend to connect to another network\n" + " using a socket connection\n" + "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n" + " configure a network backend to connect to a multicast maddr and port\n" " use 'localaddr=addr' to specify the host address to send packets from\n" - "-net socket[,vlan=n][,name=str][,fd=h][,udp=host:port][,localaddr=host:port]\n" - " connect the vlan 'n' to another VLAN using an UDP tunnel\n" + "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n" + " configure a network backend to connect to another network\n" + " using an UDP tunnel\n" #ifdef CONFIG_VDE - "-net vde[,vlan=n][,name=str][,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n" - " connect the vlan 'n' to port 'n' of a vde switch running\n" - " on host and listening for incoming connections on 'socketpath'.\n" + "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n" + " configure a network backend to connect to port 'n' of a vde switch\n" + " running on host and listening for incoming connections on 'socketpath'.\n" " Use group 'groupname' and mode 'octalmode' to change default\n" " ownership and permissions for communication port.\n" #endif #ifdef CONFIG_NETMAP - "-net netmap,ifname=name[,devname=nmname]\n" + "-netdev netmap,id=str,ifname=name[,devname=nmname]\n" " attach to the existing netmap-enabled network interface 'name', or to a\n" " VALE port (created on the fly) called 'name' ('nmname' is name of the \n" " netmap device, defaults to '/dev/netmap')\n" #endif + "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n" + " configure a vhost-user network, backed by a chardev 'dev'\n" + "-netdev hubport,id=str,hubid=n\n" + " configure a hub port on QEMU VLAN 'n'\n", QEMU_ARCH_ALL) +DEF("net", HAS_ARG, QEMU_OPTION_net, + "-net nic[,vlan=n][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n" + " old way to create a new NIC and connect it to VLAN 'n'\n" + " (use the '-device devtype,netdev=str' option if possible instead)\n" "-net dump[,vlan=n][,file=f][,len=n]\n" " dump traffic on vlan 'n' to file 'f' (max n bytes per packet)\n" "-net none use it alone to have zero network devices. If no -net option\n" - " is provided, the default is '-net nic -net user'\n", QEMU_ARCH_ALL) -DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, - "-netdev [" + " is provided, the default is '-net nic -net user'\n" + "-net [" #ifdef CONFIG_SLIRP "user|" #endif @@ -1551,9 +1564,9 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, #ifdef CONFIG_NETMAP "netmap|" #endif - "vhost-user|" - "socket|" - "hubport],id=str[,option][,option][,...]\n", QEMU_ARCH_ALL) + "socket][,vlan=n][,option][,option][,...]\n" + " old way to initialize a host network interface\n" + " (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL) STEXI @item -net nic[,vlan=@var{n}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}] @findex -net