Bug 196243

Summary: [bhyve] vmrun.sh spurious warning using zvol diskdev
Product: Base System Reporter: PaulC <paul.chakravarti>
Component: miscAssignee: Rodney W. Grimes <rgrimes>
Status: New ---    
Severity: Affects Some People CC: amvandemore, emaste, neel, olgeni, rgrimes, virtualization
Priority: Normal    
Version: 10.1-RELEASE   
Hardware: amd64   
OS: Any   

Description PaulC 2014-12-24 01:24:19 UTC

I noticed that there is a minor problem in the vmrun.sh script if you are using a zvol as the virtio_diskdev. The 'make_and_check_diskdev' check will fail if virtio_diskdev is a zvol as it only checks for files (vs char devices). This is harmless as the truncate doesn't actually do anything if the device is a zvol however the attached small patch fixes the problem and removes the spurious error message.


--- vmrun.sh.orig       2014-12-24 01:56:58.468954569 +0100
+++ vmrun.sh    2014-12-24 02:03:23.543145433 +0100
@@ -152,7 +152,7 @@
     local virtio_diskdev="$1"
     # Create the virtio diskdev file if needed
-    if [ ! -f ${virtio_diskdev} ]; then
+    if [ ! -f ${virtio_diskdev} -a ! -c ${virtio_diskdev} ]; then
            echo "virtio disk device file \"${virtio_diskdev}\" does not exist."
            echo "Creating it ..."
            truncate -s 8G ${virtio_diskdev} > /dev/null
Comment 1 Jimmy Olgeni freebsd_committer 2015-05-27 09:19:25 UTC
CURRENT already has "-e ${virtio_diskdev}", so maybe vmrun.sh can just be merged?
Comment 2 Neel Natu freebsd_committer 2015-05-27 16:25:43 UTC
(In reply to Jimmy Olgeni from comment #1)

Yes, there are a number of changes that need to be merged before the stable/10 slush. I'll do this one along with the others.
Comment 3 amvandemore 2015-10-28 21:18:45 UTC
Comment 4 Rodney W. Grimes freebsd_committer 2018-02-02 18:11:08 UTC
I am taking any input on this anyone has.
I plan to test the state on ^head, and if we need to patch vmrun.sh that shall be done shortly.