Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jan 2016 13:26:56 +0000
From:      "John Dickinson" <jad@sinodun.com>
To:        freebsd-virtualization@freebsd.org
Subject:   patch to improve use of ZFS volumes with vmrun.sh
Message-ID:  <297CFBF1-625A-4B41-AB6A-2ACDD0E703C4@sinodun.com>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 3156 and 4880).

--=_MailMate_B0048A7E-0E0C-466F-B147-D18860AADF8A_=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi,

In case it is of use to anyone, here is a little patch to improve use of =
ZFS volumes with vmrun.sh


--- /usr/share/examples/bhyve/vmrun.sh	2015-08-12 15:27:20.000000000 +000=
0
+++ ./vmrun.sh	2016-01-14 13:17:27.972055736 +0000
@@ -166,11 +166,24 @@
 make_and_check_diskdev()
 {
     local virtio_diskdev=3D"$1"
+    local ZVOL=3D0
     # Create the virtio diskdev file if needed
-    if [ ! -f ${virtio_diskdev} ]; then
+    case "${virtio_diskdev}" in
+        /dev/zvol/*) ZVOL=3D1 ;;
+    esac
+
+    if [ $ZVOL -eq 0 ]; then
+        if [ ! -f ${virtio_diskdev} ]; then
    	      echo "virtio disk device file \"${virtio_diskdev}\" does not e=
xist."
             echo "Creating it ..."
             truncate -s 8G ${virtio_diskdev} > /dev/null
+        fi
+    else
+        if [ ! -c ${virtio_diskdev} ]; then
+            echo "virtio disk device volume \"${virtio_diskdev}\" does n=
ot exist."
+            echo "Please create it"
+            exit 1
+        fi
     fi
 =

     if [ ! -r ${virtio_diskdev} ]; then


regards
John

John Dickinson

http://sinodun.com

Sinodun Internet Technologies Ltd.
Magdalen Centre
Oxford Science Park
Robert Robinson Avenue
Oxford OX4 4GA
U.K.
--=_MailMate_B0048A7E-0E0C-466F-B147-D18860AADF8A_=
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename=signature.asc
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBAgAGBQJWl6IgAAoJEC3GFEI9J+IsJzgP/2BU8klYLbtL6paKwppMkIP9
7hTtmdo4fo7FSx7fgq1ISQZKlA8Ecni4fTAWhIfdXZEex3hldPj6Wx3/u2Zxuf4v
ey0qsSb9dwO0M9mflpxBcvUsVByT3D3P4DBn8KGLcTytMfeh2RNByZ68hhO/CIUf
f2S6ANpu/H4mYG2+UbvQiKowMCmam+BN0mtN8fT/B4v0t38+p0OC4auJppMNJvkt
NAH4BGZM1izX0mT8XsXrnQfbJYz7owGr6Ea9o97t806xW4bheUnKnVkAbWdvPbNj
zCYfL0zKa0skzGEizdt+hZVQb57pwnKw15VI/Qh547GNu0CDyRU3EPL3HkmgBKqC
tlOASdi+YnFYublhtviHLa/lbscTSksLxmgkbZn7ctBmWVCKhe+u1JJuJjVP7lCx
sXEpF0v/PHAMWDFEY2BGFx8d0ow/z3gu/VsixEQm22NNRNge8Lht3oR7a5DihiWi
FC7uQdla8SxbMVBUURHRtC7XpIFtHArYFlNoxbEy9xh2Jd/PBxLJitqit5nxETgK
qn/hNCEFu+Zol9oQDqG46iJ32s8cP6rndf4bZa423kXUDnFdpMP9PF+C0fCkkjzd
KFZnAXFM5WKW9I+nqWCelSxcs5jX9ouiocsV280/2r0S/IXJKMqNfW2sLfDOBpFW
Rag72nrcL3WyAWUrhb1+
=/21H
-----END PGP SIGNATURE-----

--=_MailMate_B0048A7E-0E0C-466F-B147-D18860AADF8A_=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?297CFBF1-625A-4B41-AB6A-2ACDD0E703C4>