Page MenuHomeFreeBSD

bhyvectl: Add device hotplugging options
Needs ReviewPublic

Authored by bnovkov on Sun, Jan 11, 1:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 25, 6:41 PM
Unknown Object (File)
Sun, Jan 25, 10:29 AM
Unknown Object (File)
Fri, Jan 23, 10:48 PM
Unknown Object (File)
Mon, Jan 19, 6:14 PM
Unknown Object (File)
Sat, Jan 17, 7:14 AM
Unknown Object (File)
Fri, Jan 16, 8:12 PM
Unknown Object (File)
Thu, Jan 15, 5:54 PM
Unknown Object (File)
Mon, Jan 12, 3:53 AM

Details

Reviewers
None
Group Reviewers
bhyve
Summary

This change introduces the --pci-{add,remove} options which allow
users to add or remove emulated PCI devices to an active virtual machine.

--pci-add's argument follows the same format as bhyve's -s option,
with the only difference being that --pci-add does not take a
bus:slot:function string. When asked to hotplug a device,
bhyvectl creates a new nvlist and uses libbhyve's
pci_parse_config and pci_init_fds routines to populate it with the
appropriate key/value pairs and file descriptors. It will then
invoke the appropriate bhyve IPC command.

--pci-remove takes a bus:slot:function string as an argument.
The argument can also be specified in all of the same formats
used by bhyve's -s flag.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69802
Build 66685: arc lint + arc unit

Event Timeline

Couple of comments/questions:

  1. I think we should not allow neither --pci-add nor --pci-remove to be combined with other options (such as --destroy) and also with each other.
  2. Is it possible to make --pci-add print the PCI address of the added device? That would be important for preserving consistent device addresses for the VM, and also just convenient for the consequent --pci-remove without having to use the guest to figure out that PCI address.