Skip to content

vm/bhyve: added customizable bhyve arguments #5941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions vm/bhyve/bhyve.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ func init() {
}

type Config struct {
Bridge string `json:"bridge"` // name of network bridge device, optional
Count int `json:"count"` // number of VMs to use
CPU int `json:"cpu"` // number of VM vCPU
HostIP string `json:"hostip"` // VM host IP address
Mem string `json:"mem"` // amount of VM memory
Dataset string `json:"dataset"` // ZFS dataset containing VM image
Bridge string `json:"bridge"` // name of network bridge device, optional
Count int `json:"count"` // number of VMs to use
CPU int `json:"cpu"` // number of VM vCPU
HostIP string `json:"hostip"` // VM host IP address
Mem string `json:"mem"` // amount of VM memory
Dataset string `json:"dataset"` // ZFS dataset containing VM image
BhyveArgs string `json:"bhyve_args"` // extra arguments to bhyve
}

type Pool struct {
Expand Down Expand Up @@ -185,9 +186,11 @@ func (inst *instance) Boot() error {
"-s", fmt.Sprintf("2:0,virtio-net,%v", netdev),
"-s", fmt.Sprintf("3:0,virtio-blk,%v", inst.image),
"-l", "com1,stdio",
inst.vmName,
}

bhyveArgs = append(bhyveArgs, strings.Split(inst.cfg.BhyveArgs, " ")...)
bhyveArgs = append(bhyveArgs, inst.vmName)

outr, outw, err := osutil.LongPipe()
if err != nil {
return err
Expand Down
Loading