From owner-svn-src-head@freebsd.org Thu Feb 1 17:59:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AEDCEE1B55; Thu, 1 Feb 2018 17:59:15 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1DBA7A7E0; Thu, 1 Feb 2018 17:59:14 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACC5B104FF; Thu, 1 Feb 2018 17:59:14 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11HxEPx064046; Thu, 1 Feb 2018 17:59:14 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11HxE5T064045; Thu, 1 Feb 2018 17:59:14 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201802011759.w11HxE5T064045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Thu, 1 Feb 2018 17:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328695 - head/share/examples/bhyve X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/share/examples/bhyve X-SVN-Commit-Revision: 328695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 17:59:15 -0000 Author: rgrimes Date: Thu Feb 1 17:59:14 2018 New Revision: 328695 URL: https://svnweb.freebsd.org/changeset/base/328695 Log: Add option '-n' network device emulation type which has a default of virtio-net PR: 225558 Submitted by: Johannes Lundberg Approved by: grehan (mentor) MFC after: 3 days Modified: head/share/examples/bhyve/vmrun.sh Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Thu Feb 1 17:32:45 2018 (r328694) +++ head/share/examples/bhyve/vmrun.sh Thu Feb 1 17:59:14 2018 (r328695) @@ -38,6 +38,7 @@ DEFAULT_CPUS=2 DEFAULT_TAPDEV=tap0 DEFAULT_CONSOLE=stdio +DEFAULT_NIC=virtio-net DEFAULT_VIRTIO_DISK="./diskdev" DEFAULT_ISOFILE="./release.iso" @@ -72,6 +73,7 @@ usage() { echo " -l: the OS loader to use (default is /boot/userboot.so)" echo " -L: IP address for UEFI GOP VNC server (default: 127.0.0.1)" echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" + echo " -n: network adapter emulation type (default is ${DEFAULT_NIC})" echo " -p: pass-through a host PCI device at bus/slot/func (e.g. 10/0/0)" echo " -P: UEFI GOP VNC port (default: 5900)" echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" @@ -100,6 +102,7 @@ isofile=${DEFAULT_ISOFILE} memsize=${DEFAULT_MEMSIZE} console=${DEFAULT_CONSOLE} cpus=${DEFAULT_CPUS} +nic=${DEFAULT_NIC} tap_total=0 disk_total=0 disk_emulation="virtio-blk" @@ -117,7 +120,7 @@ vncport=5900 fbsize="w=1024,h=768" tablet="" -while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c ; do +while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:n:p:P:t:Tuvw c ; do case $c in a) bhyverun_opt="${bhyverun_opt} -a" @@ -171,6 +174,9 @@ while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c m) memsize=${OPTARG} ;; + n) + nic=${OPTARG} + ;; p) eval "pass_dev${pass_total}=\"${OPTARG}\"" pass_total=$(($pass_total + 1)) @@ -313,7 +319,7 @@ while [ 1 ]; do i=0 while [ $i -lt $tap_total ] ; do eval "tapname=\$tap_dev${i}" - devargs="$devargs -s $nextslot:0,virtio-net,${tapname} " + devargs="$devargs -s $nextslot:0,${nic},${tapname} " nextslot=$(($nextslot + 1)) i=$(($i + 1)) done