Bug 225558

Summary: [bhyve][patch] Add option to specify emulated NIC in vmrun.sh
Product: Base System Reporter: Johannes Lundberg <johalun0>
Component: kernAssignee: Rodney W. Grimes <rgrimes>
Status: Closed FIXED    
Severity: Affects Some People CC: emaste, rgrimes, virtualization
Priority: Normal Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch for share/examples/bhyve/vmrun.sh
none
updated patch none

Description Johannes Lundberg 2018-01-30 12:09:36 UTC
Created attachment 190195 [details]
patch for share/examples/bhyve/vmrun.sh

This patch adds '-n' option to specify NIC. 
virtio-net is set as default.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2018-01-30 17:42:46 UTC
Fix brain-o in assignment.
Comment 2 Rodney W. Grimes freebsd_committer freebsd_triage 2018-01-30 18:49:57 UTC
First pass look at this patch leads to these comments:

White space change at line 40, this change should not be made

-n option added out of alpha order at line 74, should be after -m,
"ethernet adapter" is a little vague and missleading,
this is actually "network adapter emulation type"

I am not sure how much should be added to vmrun.sh, this was
suppose to be a simple script for simple operations, if your
getting complicated you should be invoking bhyve, not vmrun,
the only other valid option for -n at this time is e1000, is
it really worth adding a knob to vmrun.sh to switch between
virtio-net and e1000?  Or even if we consider the ne2000 out
of tree code, that is a 3 way option.
Comment 3 Rodney W. Grimes freebsd_committer freebsd_triage 2018-01-31 17:46:58 UTC
I have discussed this change with the bhyve developers group and we plan to move forward with implementing the -n option.
Comment 4 Johannes Lundberg 2018-01-31 20:08:37 UTC
Created attachment 190234 [details]
updated patch

Don't know what was going on in my mind when I set n before m....
Comment 5 Johannes Lundberg 2018-01-31 20:09:49 UTC
(In reply to Rodney W. Grimes from comment #3)
 
Cool. Thanks!  Please see the updated patch with suggested fixes.
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-02-01 17:59:42 UTC
A commit references this bug:

Author: rgrimes
Date: Thu Feb  1 17:59:14 UTC 2018
New revision: 328695
URL: https://svnweb.freebsd.org/changeset/base/328695

Log:
  Add option '-n' network device emulation type which has a default of virtio-net

  PR:		225558
  Submitted by:	Johannes Lundberg <johalun0@gmail.com>
  Approved by:	grehan (mentor)
  MFC after:	3 days

Changes:
  head/share/examples/bhyve/vmrun.sh
Comment 7 commit-hook freebsd_committer freebsd_triage 2018-02-12 19:08:39 UTC
A commit references this bug:

Author: rgrimes
Date: Mon Feb 12 19:08:17 UTC 2018
New revision: 329179
URL: https://svnweb.freebsd.org/changeset/base/329179

Log:
  MFC:	r328695,r328720,r328784,r328795 share/examples/bhyve/vmrun.sh additions
  	and cleanups

  r328695:
  	Add option '-n' network device emulation type which has a default
  	of virtio-net
  	PR:		225558
  	Submitted by:	Johannes Lundberg <johalun0@gmail.com>

  r328720:
  	Add -n <network device emulation type> to usage synopsis
  	forgotten in r328695.

  	Fix long lines in usage.
  	Consistently use "default:" rather than "default is"

  r328784:
  	Clean up long lines.

  r328795:
  	Fold constants and unify vnc variable names.

  Approved by:	grehan (mentor)

  PR:		225558

Changes:
_U  stable/11/
  stable/11/share/examples/bhyve/vmrun.sh
Comment 8 commit-hook freebsd_committer freebsd_triage 2018-02-12 19:08:41 UTC
A commit references this bug:

Author: rgrimes
Date: Mon Feb 12 19:08:17 UTC 2018
New revision: 329179
URL: https://svnweb.freebsd.org/changeset/base/329179

Log:
  MFC:	r328695,r328720,r328784,r328795 share/examples/bhyve/vmrun.sh additions
  	and cleanups

  r328695:
  	Add option '-n' network device emulation type which has a default
  	of virtio-net
  	PR:		225558
  	Submitted by:	Johannes Lundberg <johalun0@gmail.com>

  r328720:
  	Add -n <network device emulation type> to usage synopsis
  	forgotten in r328695.

  	Fix long lines in usage.
  	Consistently use "default:" rather than "default is"

  r328784:
  	Clean up long lines.

  r328795:
  	Fold constants and unify vnc variable names.

  Approved by:	grehan (mentor)

  PR:		225558

Changes:
_U  stable/11/
  stable/11/share/examples/bhyve/vmrun.sh
Comment 9 Johannes Lundberg 2018-05-20 08:38:42 UTC
Merged