From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 15:58:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A0AAFC2; Thu, 12 Mar 2015 15:58:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85449DF7; Thu, 12 Mar 2015 15:58:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CFw8jS071577; Thu, 12 Mar 2015 15:58:08 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CFw8sk071576; Thu, 12 Mar 2015 15:58:08 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201503121558.t2CFw8sk071576@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 12 Mar 2015 15:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279925 - head/share/examples/bhyve X-SVN-Group: head 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.18-1 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, 12 Mar 2015 15:58:08 -0000 Author: glebius Date: Thu Mar 12 15:58:07 2015 New Revision: 279925 URL: https://svnweb.freebsd.org/changeset/base/279925 Log: Add -p parameter to list PCI device to pass through to the guest. Reviewed by: neel Modified: head/share/examples/bhyve/vmrun.sh Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Thu Mar 12 15:48:25 2015 (r279924) +++ head/share/examples/bhyve/vmrun.sh Thu Mar 12 15:58:07 2015 (r279925) @@ -62,6 +62,7 @@ usage() { echo " -i: force boot of the Installation CDROM image" echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" + echo " -p: pass-through a host PCI device at bus/slot/func (e.g. 10/0/0)" echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" echo "" [ -n "$msg" ] && errmsg "$msg" @@ -89,8 +90,9 @@ disk_total=0 apic_opt="" gdbport=0 loader_opt="" +pass_total=0 -while getopts ac:C:d:e:g:hH:iI:m:t: c ; do +while getopts ac:C:d:e:g:hH:iI:m:p:t: c ; do case $c in a) apic_opt="-a" @@ -123,6 +125,10 @@ while getopts ac:C:d:e:g:hH:iI:m:t: c ; m) memsize=${OPTARG} ;; + p) + eval "pass_dev${pass_total}=\"${OPTARG}\"" + pass_total=$(($pass_total + 1)) + ;; t) eval "tap_dev${tap_total}=\"${OPTARG}\"" tap_total=$(($tap_total + 1)) @@ -237,6 +243,14 @@ while [ 1 ]; do i=$(($i + 1)) done + i=0 + while [ $i -lt $pass_total ] ; do + eval "pass=\$pass_dev${i}" + devargs="$devargs -s $nextslot:0,passthru,${pass} " + nextslot=$(($nextslot + 1)) + i=$(($i + 1)) + done + ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -A -H -P \ -g ${gdbport} \ -s 0:0,hostbridge \