svn commit: r273102 - head/share/examples/bhyve

Neel Natu neel at FreeBSD.org
Tue Oct 14 18:34:16 UTC 2014


Author: neel
Date: Tue Oct 14 18:34:15 2014
New Revision: 273102
URL: https://svnweb.freebsd.org/changeset/base/273102

Log:
  Use '-e' to check if the virtio backing file has already been created.
  
  The '-f' check works fine on a regular file but not if the backing file is
  a device (e.g., /dev/md0). In this case it would print a misleading but
  otherwise benign message about the backing file not being present.
  
  Submitted by:	Marcus Reid (marcus at blazingdot.com)
  Discussed with:	grehan

Modified:
  head/share/examples/bhyve/vmrun.sh

Modified: head/share/examples/bhyve/vmrun.sh
==============================================================================
--- head/share/examples/bhyve/vmrun.sh	Tue Oct 14 17:13:47 2014	(r273101)
+++ head/share/examples/bhyve/vmrun.sh	Tue Oct 14 18:34:15 2014	(r273102)
@@ -152,7 +152,7 @@ make_and_check_diskdev()
 {
     local virtio_diskdev="$1"
     # Create the virtio diskdev file if needed
-    if [ ! -f ${virtio_diskdev} ]; then
+    if [ ! -e ${virtio_diskdev} ]; then
 	    echo "virtio disk device file \"${virtio_diskdev}\" does not exist."
 	    echo "Creating it ..."
 	    truncate -s 8G ${virtio_diskdev} > /dev/null


More information about the svn-src-all mailing list