From owner-svn-src-all@FreeBSD.ORG Thu Sep 4 16:55:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FCDC89C; Thu, 4 Sep 2014 16:55:02 +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 5AD241511; Thu, 4 Sep 2014 16:55:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84Gt2Z3027847; Thu, 4 Sep 2014 16:55:02 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84Gt2QI027846; Thu, 4 Sep 2014 16:55:02 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201409041655.s84Gt2QI027846@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Thu, 4 Sep 2014 16:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271106 - stable/10/share/examples/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 16:55:02 -0000 Author: rodrigc Date: Thu Sep 4 16:55:01 2014 New Revision: 271106 URL: http://svnweb.freebsd.org/changeset/base/271106 Log: MFC r270512 r270513 r270754 - add comments which describe exit status codes of /usr/sbin/bhyve - move bhyvectl --destroy outside of the while loop - Use "file -s" so that we can run vmrun.sh against special devces such as /dev/md memory files systems or zvols Modified: stable/10/share/examples/bhyve/vmrun.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/bhyve/vmrun.sh ============================================================================== --- stable/10/share/examples/bhyve/vmrun.sh Thu Sep 4 16:51:45 2014 (r271105) +++ stable/10/share/examples/bhyve/vmrun.sh Thu Sep 4 16:55:01 2014 (r271106) @@ -173,13 +173,14 @@ echo "Launching virtual machine \"$vmnam virtio_diskdev="$disk_dev0" +${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1 + while [ 1 ]; do - ${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1 - file ${virtio_diskdev} | grep "boot sector" > /dev/null + file -s ${virtio_diskdev} | grep "boot sector" > /dev/null rc=$? if [ $rc -ne 0 ]; then - file ${virtio_diskdev} | grep ": Unix Fast File sys" > /dev/null + file -s ${virtio_diskdev} | grep ": Unix Fast File sys" > /dev/null rc=$? fi if [ $rc -ne 0 ]; then @@ -237,6 +238,14 @@ while [ 1 ]; do -l com1,${console} \ ${installer_opt} \ ${vmname} + + # bhyve returns the following status codes: + # 0 - VM has been reset + # 1 - VM has been powered off + # 2 - VM has been halted + # 3 - VM generated a triple fault + # all other non-zero status codes are errors + # if [ $? -ne 0 ]; then break fi