vfio: Remove obsolete HotplugVFIOonRootBus

Removing HotplugVFIOonRootBus which is obsolete with the latest PCI
topology changes, users can set cold_plug_vfio or hot_plug_vfio either
in the configuration.toml or via annotations.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
Zvonko Kaiser 2023-07-20 07:25:40 +00:00
parent 114542e2ba
commit dd422ccb69
15 changed files with 61 additions and 109 deletions

View File

@ -103,20 +103,19 @@ type RuntimeVersionInfo struct {
// HypervisorInfo stores hypervisor details // HypervisorInfo stores hypervisor details
type HypervisorInfo struct { type HypervisorInfo struct {
MachineType string MachineType string
Version string Version string
Path string Path string
BlockDeviceDriver string BlockDeviceDriver string
EntropySource string EntropySource string
SharedFS string SharedFS string
VirtioFSDaemon string VirtioFSDaemon string
SocketPath string SocketPath string
Msize9p uint32 Msize9p uint32
MemorySlots uint32 MemorySlots uint32
HotPlugVFIO config.PCIePort HotPlugVFIO config.PCIePort
ColdPlugVFIO config.PCIePort ColdPlugVFIO config.PCIePort
HotplugVFIOOnRootBus bool Debug bool
Debug bool
} }
// AgentInfo stores agent details // AgentInfo stores agent details
@ -307,20 +306,19 @@ func getHypervisorInfo(config oci.RuntimeConfig) (HypervisorInfo, error) {
} }
return HypervisorInfo{ return HypervisorInfo{
Debug: config.HypervisorConfig.Debug, Debug: config.HypervisorConfig.Debug,
MachineType: config.HypervisorConfig.HypervisorMachineType, MachineType: config.HypervisorConfig.HypervisorMachineType,
Version: version, Version: version,
Path: hypervisorPath, Path: hypervisorPath,
BlockDeviceDriver: config.HypervisorConfig.BlockDeviceDriver, BlockDeviceDriver: config.HypervisorConfig.BlockDeviceDriver,
Msize9p: config.HypervisorConfig.Msize9p, Msize9p: config.HypervisorConfig.Msize9p,
MemorySlots: config.HypervisorConfig.MemSlots, MemorySlots: config.HypervisorConfig.MemSlots,
EntropySource: config.HypervisorConfig.EntropySource, EntropySource: config.HypervisorConfig.EntropySource,
SharedFS: config.HypervisorConfig.SharedFS, SharedFS: config.HypervisorConfig.SharedFS,
VirtioFSDaemon: config.HypervisorConfig.VirtioFSDaemon, VirtioFSDaemon: config.HypervisorConfig.VirtioFSDaemon,
HotPlugVFIO: config.HypervisorConfig.HotPlugVFIO, HotPlugVFIO: config.HypervisorConfig.HotPlugVFIO,
ColdPlugVFIO: config.HypervisorConfig.ColdPlugVFIO, ColdPlugVFIO: config.HypervisorConfig.ColdPlugVFIO,
HotplugVFIOOnRootBus: config.HypervisorConfig.HotplugVFIOOnRootBus, SocketPath: socketPath,
SocketPath: socketPath,
}, nil }, nil
} }

View File

@ -87,7 +87,6 @@ func makeRuntimeConfig(prefixDir string) (configFile string, ociConfig oci.Runti
disableBlock := true disableBlock := true
blockStorageDriver := "virtio-scsi" blockStorageDriver := "virtio-scsi"
enableIOThreads := true enableIOThreads := true
hotplugVFIOOnRootBus := true
hotPlugVFIO = config.BridgePort hotPlugVFIO = config.BridgePort
coldPlugVFIO = config.NoPort coldPlugVFIO = config.NoPort
disableNewNetNs := false disableNewNetNs := false
@ -132,7 +131,6 @@ func makeRuntimeConfig(prefixDir string) (configFile string, ociConfig oci.Runti
DisableBlock: disableBlock, DisableBlock: disableBlock,
BlockDeviceDriver: blockStorageDriver, BlockDeviceDriver: blockStorageDriver,
EnableIOThreads: enableIOThreads, EnableIOThreads: enableIOThreads,
HotplugVFIOOnRootBus: hotplugVFIOOnRootBus,
HotPlugVFIO: hotPlugVFIO, HotPlugVFIO: hotPlugVFIO,
ColdPlugVFIO: coldPlugVFIO, ColdPlugVFIO: coldPlugVFIO,
DisableNewNetNs: disableNewNetNs, DisableNewNetNs: disableNewNetNs,
@ -276,10 +274,8 @@ func getExpectedHypervisor(config oci.RuntimeConfig) HypervisorInfo {
EntropySource: config.HypervisorConfig.EntropySource, EntropySource: config.HypervisorConfig.EntropySource,
SharedFS: config.HypervisorConfig.SharedFS, SharedFS: config.HypervisorConfig.SharedFS,
VirtioFSDaemon: config.HypervisorConfig.VirtioFSDaemon, VirtioFSDaemon: config.HypervisorConfig.VirtioFSDaemon,
HotPlugVFIO: config.HypervisorConfig.HotPlugVFIO,
HotplugVFIOOnRootBus: config.HypervisorConfig.HotplugVFIOOnRootBus, ColdPlugVFIO: config.HypervisorConfig.ColdPlugVFIO,
HotPlugVFIO: config.HypervisorConfig.HotPlugVFIO,
ColdPlugVFIO: config.HypervisorConfig.ColdPlugVFIO,
} }
if os.Geteuid() == 0 { if os.Geteuid() == 0 {

View File

@ -330,7 +330,6 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (runtimeConfig string,
disableBlockDevice := true disableBlockDevice := true
blockDeviceDriver := "virtio-scsi" blockDeviceDriver := "virtio-scsi"
enableIOThreads := true enableIOThreads := true
hotplugVFIOOnRootBus := true
disableNewNetNs := false disableNewNetNs := false
sharedFS := "virtio-9p" sharedFS := "virtio-9p"
virtioFSdaemon := path.Join(dir, "virtiofsd") virtioFSdaemon := path.Join(dir, "virtiofsd")
@ -338,23 +337,22 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (runtimeConfig string,
coldPlugVFIO = config.RootPort coldPlugVFIO = config.RootPort
configFileOptions := ktu.RuntimeConfigOptions{ configFileOptions := ktu.RuntimeConfigOptions{
Hypervisor: "qemu", Hypervisor: "qemu",
HypervisorPath: hypervisorPath, HypervisorPath: hypervisorPath,
KernelPath: kernelPath, KernelPath: kernelPath,
ImagePath: imagePath, ImagePath: imagePath,
RootfsType: rootfsType, RootfsType: rootfsType,
KernelParams: kernelParams, KernelParams: kernelParams,
MachineType: machineType, MachineType: machineType,
LogPath: logPath, LogPath: logPath,
DisableBlock: disableBlockDevice, DisableBlock: disableBlockDevice,
BlockDeviceDriver: blockDeviceDriver, BlockDeviceDriver: blockDeviceDriver,
EnableIOThreads: enableIOThreads, EnableIOThreads: enableIOThreads,
HotplugVFIOOnRootBus: hotplugVFIOOnRootBus, DisableNewNetNs: disableNewNetNs,
DisableNewNetNs: disableNewNetNs, SharedFS: sharedFS,
SharedFS: sharedFS, VirtioFSDaemon: virtioFSdaemon,
VirtioFSDaemon: virtioFSdaemon, HotPlugVFIO: hotPlugVFIO,
HotPlugVFIO: hotPlugVFIO, ColdPlugVFIO: coldPlugVFIO,
ColdPlugVFIO: coldPlugVFIO,
} }
runtimeConfigFileData := ktu.MakeRuntimeConfigFileData(configFileOptions) runtimeConfigFileData := ktu.MakeRuntimeConfigFileData(configFileOptions)

View File

@ -42,10 +42,9 @@ type HypervisorState struct {
// HotpluggedCPUs is the list of CPUs that were hot-added // HotpluggedCPUs is the list of CPUs that were hot-added
HotpluggedVCPUs []CPUDevice HotpluggedVCPUs []CPUDevice
HotpluggedMemory int HotpluggedMemory int
VirtiofsDaemonPid int VirtiofsDaemonPid int
Pid int Pid int
HotPlugVFIO config.PCIePort HotPlugVFIO config.PCIePort
ColdPlugVFIO config.PCIePort ColdPlugVFIO config.PCIePort
HotplugVFIOOnRootBus bool
} }

View File

@ -233,7 +233,6 @@ type RuntimeConfigOptions struct {
DefaultMsize9p uint32 DefaultMsize9p uint32
DisableBlock bool DisableBlock bool
EnableIOThreads bool EnableIOThreads bool
HotplugVFIOOnRootBus bool
DisableNewNetNs bool DisableNewNetNs bool
HypervisorDebug bool HypervisorDebug bool
RuntimeDebug bool RuntimeDebug bool
@ -317,8 +316,8 @@ func MakeRuntimeConfigFileData(config RuntimeConfigOptions) string {
default_memory = ` + strconv.FormatUint(uint64(config.DefaultMemSize), 10) + ` default_memory = ` + strconv.FormatUint(uint64(config.DefaultMemSize), 10) + `
disable_block_device_use = ` + strconv.FormatBool(config.DisableBlock) + ` disable_block_device_use = ` + strconv.FormatBool(config.DisableBlock) + `
enable_iothreads = ` + strconv.FormatBool(config.EnableIOThreads) + ` enable_iothreads = ` + strconv.FormatBool(config.EnableIOThreads) + `
hotplug_vfio_on_root_bus = ` + strconv.FormatBool(config.HotplugVFIOOnRootBus) + `
cold_plug_vfio = "` + config.ColdPlugVFIO.String() + `" cold_plug_vfio = "` + config.ColdPlugVFIO.String() + `"
hot_plug_vfio = "` + config.HotPlugVFIO.String() + `"
msize_9p = ` + strconv.FormatUint(uint64(config.DefaultMsize9p), 10) + ` msize_9p = ` + strconv.FormatUint(uint64(config.DefaultMsize9p), 10) + `
enable_debug = ` + strconv.FormatBool(config.HypervisorDebug) + ` enable_debug = ` + strconv.FormatBool(config.HypervisorDebug) + `
guest_hook_path = "` + config.DefaultGuestHookPath + `" guest_hook_path = "` + config.DefaultGuestHookPath + `"

View File

@ -81,7 +81,6 @@ const defaultFileBackedMemRootDir string = ""
const defaultEnableDebug bool = false const defaultEnableDebug bool = false
const defaultDisableNestingChecks bool = false const defaultDisableNestingChecks bool = false
const defaultMsize9p uint32 = 8192 const defaultMsize9p uint32 = 8192
const defaultHotplugVFIOOnRootBus bool = false
const defaultEntropySource = "/dev/urandom" const defaultEntropySource = "/dev/urandom"
const defaultGuestHookPath string = "" const defaultGuestHookPath string = ""
const defaultVirtioFSCacheMode = "never" const defaultVirtioFSCacheMode = "never"

View File

@ -146,7 +146,6 @@ type hypervisor struct {
DisableNestingChecks bool `toml:"disable_nesting_checks"` DisableNestingChecks bool `toml:"disable_nesting_checks"`
EnableIOThreads bool `toml:"enable_iothreads"` EnableIOThreads bool `toml:"enable_iothreads"`
DisableImageNvdimm bool `toml:"disable_image_nvdimm"` DisableImageNvdimm bool `toml:"disable_image_nvdimm"`
HotplugVFIOOnRootBus bool `toml:"hotplug_vfio_on_root_bus"`
HotPlugVFIO config.PCIePort `toml:"hot_plug_vfio"` HotPlugVFIO config.PCIePort `toml:"hot_plug_vfio"`
ColdPlugVFIO config.PCIePort `toml:"cold_plug_vfio"` ColdPlugVFIO config.PCIePort `toml:"cold_plug_vfio"`
DisableVhostNet bool `toml:"disable_vhost_net"` DisableVhostNet bool `toml:"disable_vhost_net"`
@ -867,7 +866,6 @@ func newQemuHypervisorConfig(h hypervisor) (vc.HypervisorConfig, error) {
EnableIOThreads: h.EnableIOThreads, EnableIOThreads: h.EnableIOThreads,
Msize9p: h.msize9p(), Msize9p: h.msize9p(),
DisableImageNvdimm: h.DisableImageNvdimm, DisableImageNvdimm: h.DisableImageNvdimm,
HotplugVFIOOnRootBus: h.HotplugVFIOOnRootBus,
HotPlugVFIO: h.hotPlugVFIO(), HotPlugVFIO: h.hotPlugVFIO(),
ColdPlugVFIO: h.coldPlugVFIO(), ColdPlugVFIO: h.coldPlugVFIO(),
DisableVhostNet: h.DisableVhostNet, DisableVhostNet: h.DisableVhostNet,
@ -1063,7 +1061,6 @@ func newClhHypervisorConfig(h hypervisor) (vc.HypervisorConfig, error) {
BlockDeviceCacheNoflush: h.BlockDeviceCacheNoflush, BlockDeviceCacheNoflush: h.BlockDeviceCacheNoflush,
EnableIOThreads: h.EnableIOThreads, EnableIOThreads: h.EnableIOThreads,
Msize9p: h.msize9p(), Msize9p: h.msize9p(),
HotplugVFIOOnRootBus: h.HotplugVFIOOnRootBus,
ColdPlugVFIO: h.coldPlugVFIO(), ColdPlugVFIO: h.coldPlugVFIO(),
HotPlugVFIO: h.hotPlugVFIO(), HotPlugVFIO: h.hotPlugVFIO(),
DisableVhostNet: true, DisableVhostNet: true,
@ -1294,7 +1291,6 @@ func GetDefaultHypervisorConfig() vc.HypervisorConfig {
BlockDeviceCacheNoflush: defaultBlockDeviceCacheNoflush, BlockDeviceCacheNoflush: defaultBlockDeviceCacheNoflush,
EnableIOThreads: defaultEnableIOThreads, EnableIOThreads: defaultEnableIOThreads,
Msize9p: defaultMsize9p, Msize9p: defaultMsize9p,
HotplugVFIOOnRootBus: defaultHotplugVFIOOnRootBus,
ColdPlugVFIO: defaultColdPlugVFIO, ColdPlugVFIO: defaultColdPlugVFIO,
HotPlugVFIO: defaultHotPlugVFIO, HotPlugVFIO: defaultHotPlugVFIO,
GuestHookPath: defaultGuestHookPath, GuestHookPath: defaultGuestHookPath,
@ -1682,18 +1678,19 @@ func checkConfig(config oci.RuntimeConfig) error {
// Only allow one of the following settings for cold-plug: // Only allow one of the following settings for cold-plug:
// no-port, root-port, switch-port // no-port, root-port, switch-port
func checkPCIeConfig(coldPlug config.PCIePort, hotPlug config.PCIePort, machineType string) error { func checkPCIeConfig(coldPlug config.PCIePort, hotPlug config.PCIePort, machineType string) error {
// Currently only QEMU q35 supports advanced PCIe topologies // Currently only QEMU q35,virt support advanced PCIe topologies
// firecracker, dragonball do not have right now any PCIe support // firecracker, dragonball do not have right now any PCIe support
if machineType != "q35" {
return nil
}
if coldPlug != config.NoPort && hotPlug != config.NoPort { if coldPlug != config.NoPort && hotPlug != config.NoPort {
return fmt.Errorf("invalid hot-plug=%s and cold-plug=%s settings, only one of them can be set", coldPlug, hotPlug) return fmt.Errorf("invalid hot-plug=%s and cold-plug=%s settings, only one of them can be set", coldPlug, hotPlug)
} }
if coldPlug == config.NoPort && hotPlug == config.NoPort { if coldPlug == config.NoPort && hotPlug == config.NoPort {
return nil return nil
} }
if machineType != "q35" && machineType != "virt" {
return nil
}
var port config.PCIePort var port config.PCIePort
if coldPlug != config.NoPort { if coldPlug != config.NoPort {
port = coldPlug port = coldPlug
@ -1701,10 +1698,13 @@ func checkPCIeConfig(coldPlug config.PCIePort, hotPlug config.PCIePort, machineT
if hotPlug != config.NoPort { if hotPlug != config.NoPort {
port = hotPlug port = hotPlug
} }
if port == config.NoPort || port == config.BridgePort || port == config.RootPort || port == config.SwitchPort { if port == config.NoPort {
return fmt.Errorf("invalid vfio_port=%s setting, use on of %s, %s, %s",
port, config.BridgePort, config.RootPort, config.SwitchPort)
}
if port == config.BridgePort || port == config.RootPort || port == config.SwitchPort {
return nil return nil
} }
return fmt.Errorf("invalid vfio_port=%s setting, allowed values %s, %s, %s, %s", return fmt.Errorf("invalid vfio_port=%s setting, allowed values %s, %s, %s, %s",
coldPlug, config.NoPort, config.BridgePort, config.RootPort, config.SwitchPort) coldPlug, config.NoPort, config.BridgePort, config.RootPort, config.SwitchPort)
} }

View File

@ -85,7 +85,6 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (testConfig testRuntime
blockDeviceDriver := "virtio-scsi" blockDeviceDriver := "virtio-scsi"
blockDeviceAIO := "io_uring" blockDeviceAIO := "io_uring"
enableIOThreads := true enableIOThreads := true
hotplugVFIOOnRootBus := true
hotPlugVFIO = config.NoPort hotPlugVFIO = config.NoPort
coldPlugVFIO = config.BridgePort coldPlugVFIO = config.BridgePort
disableNewNetNs := false disableNewNetNs := false
@ -108,7 +107,6 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (testConfig testRuntime
BlockDeviceDriver: blockDeviceDriver, BlockDeviceDriver: blockDeviceDriver,
BlockDeviceAIO: blockDeviceAIO, BlockDeviceAIO: blockDeviceAIO,
EnableIOThreads: enableIOThreads, EnableIOThreads: enableIOThreads,
HotplugVFIOOnRootBus: hotplugVFIOOnRootBus,
HotPlugVFIO: hotPlugVFIO, HotPlugVFIO: hotPlugVFIO,
ColdPlugVFIO: coldPlugVFIO, ColdPlugVFIO: coldPlugVFIO,
DisableNewNetNs: disableNewNetNs, DisableNewNetNs: disableNewNetNs,
@ -172,7 +170,6 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (testConfig testRuntime
BlockDeviceAIO: defaultBlockDeviceAIO, BlockDeviceAIO: defaultBlockDeviceAIO,
DefaultBridges: defaultBridgesCount, DefaultBridges: defaultBridgesCount,
EnableIOThreads: enableIOThreads, EnableIOThreads: enableIOThreads,
HotplugVFIOOnRootBus: hotplugVFIOOnRootBus,
HotPlugVFIO: hotPlugVFIO, HotPlugVFIO: hotPlugVFIO,
ColdPlugVFIO: coldPlugVFIO, ColdPlugVFIO: coldPlugVFIO,
Msize9p: defaultMsize9p, Msize9p: defaultMsize9p,
@ -611,7 +608,6 @@ func TestNewQemuHypervisorConfig(t *testing.T) {
machineType := "machineType" machineType := "machineType"
disableBlock := true disableBlock := true
enableIOThreads := true enableIOThreads := true
hotplugVFIOOnRootBus := true
coldPlugVFIO = config.BridgePort coldPlugVFIO = config.BridgePort
orgVHostVSockDevicePath := utils.VHostVSockDevicePath orgVHostVSockDevicePath := utils.VHostVSockDevicePath
blockDeviceAIO := "io_uring" blockDeviceAIO := "io_uring"
@ -630,7 +626,6 @@ func TestNewQemuHypervisorConfig(t *testing.T) {
MachineType: machineType, MachineType: machineType,
DisableBlockDeviceUse: disableBlock, DisableBlockDeviceUse: disableBlock,
EnableIOThreads: enableIOThreads, EnableIOThreads: enableIOThreads,
HotplugVFIOOnRootBus: hotplugVFIOOnRootBus,
ColdPlugVFIO: coldPlugVFIO, ColdPlugVFIO: coldPlugVFIO,
RxRateLimiterMaxRate: rxRateLimiterMaxRate, RxRateLimiterMaxRate: rxRateLimiterMaxRate,
TxRateLimiterMaxRate: txRateLimiterMaxRate, TxRateLimiterMaxRate: txRateLimiterMaxRate,
@ -682,10 +677,6 @@ func TestNewQemuHypervisorConfig(t *testing.T) {
t.Errorf("Expected value for enable IOThreads %v, got %v", enableIOThreads, config.EnableIOThreads) t.Errorf("Expected value for enable IOThreads %v, got %v", enableIOThreads, config.EnableIOThreads)
} }
if config.HotplugVFIOOnRootBus != hotplugVFIOOnRootBus {
t.Errorf("Expected value for HotplugVFIOOnRootBus %v, got %v", hotplugVFIOOnRootBus, config.HotplugVFIOOnRootBus)
}
if config.RxRateLimiterMaxRate != rxRateLimiterMaxRate { if config.RxRateLimiterMaxRate != rxRateLimiterMaxRate {
t.Errorf("Expected value for rx rate limiter %v, got %v", rxRateLimiterMaxRate, config.RxRateLimiterMaxRate) t.Errorf("Expected value for rx rate limiter %v, got %v", rxRateLimiterMaxRate, config.RxRateLimiterMaxRate)
} }
@ -807,7 +798,6 @@ func TestNewQemuHypervisorConfigImageAndInitrd(t *testing.T) {
machineType := "machineType" machineType := "machineType"
disableBlock := true disableBlock := true
enableIOThreads := true enableIOThreads := true
hotplugVFIOOnRootBus := true
hypervisor := hypervisor{ hypervisor := hypervisor{
Path: hypervisorPath, Path: hypervisorPath,
@ -817,7 +807,6 @@ func TestNewQemuHypervisorConfigImageAndInitrd(t *testing.T) {
MachineType: machineType, MachineType: machineType,
DisableBlockDeviceUse: disableBlock, DisableBlockDeviceUse: disableBlock,
EnableIOThreads: enableIOThreads, EnableIOThreads: enableIOThreads,
HotplugVFIOOnRootBus: hotplugVFIOOnRootBus,
} }
_, err := newQemuHypervisorConfig(hypervisor) _, err := newQemuHypervisorConfig(hypervisor)

View File

@ -500,12 +500,6 @@ func addHypervisorConfigOverrides(ocispec specs.Spec, config *vc.SandboxConfig,
return err return err
} }
if err := newAnnotationConfiguration(ocispec, vcAnnotations.HotplugVFIOOnRootBus).setBool(func(hotplugVFIOOnRootBus bool) {
config.HypervisorConfig.HotplugVFIOOnRootBus = hotplugVFIOOnRootBus
}); err != nil {
return err
}
if err := newAnnotationConfiguration(ocispec, vcAnnotations.UseLegacySerial).setBool(func(useLegacySerial bool) { if err := newAnnotationConfiguration(ocispec, vcAnnotations.UseLegacySerial).setBool(func(useLegacySerial bool) {
config.HypervisorConfig.LegacySerial = useLegacySerial config.HypervisorConfig.LegacySerial = useLegacySerial
}); err != nil { }); err != nil {

View File

@ -659,7 +659,6 @@ func TestAddHypervisorAnnotations(t *testing.T) {
ocispec.Annotations[vcAnnotations.DisableVhostNet] = "true" ocispec.Annotations[vcAnnotations.DisableVhostNet] = "true"
ocispec.Annotations[vcAnnotations.GuestHookPath] = "/usr/bin/" ocispec.Annotations[vcAnnotations.GuestHookPath] = "/usr/bin/"
ocispec.Annotations[vcAnnotations.DisableImageNvdimm] = "true" ocispec.Annotations[vcAnnotations.DisableImageNvdimm] = "true"
ocispec.Annotations[vcAnnotations.HotplugVFIOOnRootBus] = "true"
ocispec.Annotations[vcAnnotations.ColdPlugVFIO] = config.BridgePort ocispec.Annotations[vcAnnotations.ColdPlugVFIO] = config.BridgePort
ocispec.Annotations[vcAnnotations.HotPlugVFIO] = config.NoPort ocispec.Annotations[vcAnnotations.HotPlugVFIO] = config.NoPort
ocispec.Annotations[vcAnnotations.IOMMUPlatform] = "true" ocispec.Annotations[vcAnnotations.IOMMUPlatform] = "true"
@ -700,7 +699,6 @@ func TestAddHypervisorAnnotations(t *testing.T) {
assert.Equal(sbConfig.HypervisorConfig.DisableVhostNet, true) assert.Equal(sbConfig.HypervisorConfig.DisableVhostNet, true)
assert.Equal(sbConfig.HypervisorConfig.GuestHookPath, "/usr/bin/") assert.Equal(sbConfig.HypervisorConfig.GuestHookPath, "/usr/bin/")
assert.Equal(sbConfig.HypervisorConfig.DisableImageNvdimm, true) assert.Equal(sbConfig.HypervisorConfig.DisableImageNvdimm, true)
assert.Equal(sbConfig.HypervisorConfig.HotplugVFIOOnRootBus, true)
assert.Equal(string(sbConfig.HypervisorConfig.ColdPlugVFIO), string(config.BridgePort)) assert.Equal(string(sbConfig.HypervisorConfig.ColdPlugVFIO), string(config.BridgePort))
assert.Equal(string(sbConfig.HypervisorConfig.HotPlugVFIO), string(config.NoPort)) assert.Equal(string(sbConfig.HypervisorConfig.HotPlugVFIO), string(config.NoPort))
assert.Equal(sbConfig.HypervisorConfig.IOMMUPlatform, true) assert.Equal(sbConfig.HypervisorConfig.IOMMUPlatform, true)

View File

@ -284,10 +284,6 @@ type HypervisorConfig struct {
// DisableImageNvdimm is used to disable guest rootfs image nvdimm devices // DisableImageNvdimm is used to disable guest rootfs image nvdimm devices
DisableImageNvdimm bool DisableImageNvdimm bool
// HotplugVFIOOnRootBus is used to indicate if devices need to be hotplugged on the
// root bus instead of a bridge.
HotplugVFIOOnRootBus bool
// HotPlugVFIO is used to indicate if devices need to be hotplugged on the // HotPlugVFIO is used to indicate if devices need to be hotplugged on the
// root port, switch, bridge or no port // root port, switch, bridge or no port
HotPlugVFIO hv.PCIePort HotPlugVFIO hv.PCIePort

View File

@ -599,10 +599,6 @@ type HypervisorConfig struct {
// DisableImageNvdimm is used to disable guest rootfs image nvdimm devices // DisableImageNvdimm is used to disable guest rootfs image nvdimm devices
DisableImageNvdimm bool DisableImageNvdimm bool
// HotplugVFIOOnRootBus is used to indicate if devices need to be hotplugged on the
// root bus instead of a bridge.
HotplugVFIOOnRootBus bool
// GuestMemoryDumpPaging is used to indicate if enable paging // GuestMemoryDumpPaging is used to indicate if enable paging
// for QEMU dump-guest-memory command // for QEMU dump-guest-memory command
GuestMemoryDumpPaging bool GuestMemoryDumpPaging bool

View File

@ -244,7 +244,6 @@ func (s *Sandbox) dumpConfig(ss *persistapi.SandboxState) {
FileBackedMemRootList: sconfig.HypervisorConfig.FileBackedMemRootList, FileBackedMemRootList: sconfig.HypervisorConfig.FileBackedMemRootList,
DisableNestingChecks: sconfig.HypervisorConfig.DisableNestingChecks, DisableNestingChecks: sconfig.HypervisorConfig.DisableNestingChecks,
DisableImageNvdimm: sconfig.HypervisorConfig.DisableImageNvdimm, DisableImageNvdimm: sconfig.HypervisorConfig.DisableImageNvdimm,
HotplugVFIOOnRootBus: sconfig.HypervisorConfig.HotplugVFIOOnRootBus,
BootToBeTemplate: sconfig.HypervisorConfig.BootToBeTemplate, BootToBeTemplate: sconfig.HypervisorConfig.BootToBeTemplate,
BootFromTemplate: sconfig.HypervisorConfig.BootFromTemplate, BootFromTemplate: sconfig.HypervisorConfig.BootFromTemplate,
DisableVhostNet: sconfig.HypervisorConfig.DisableVhostNet, DisableVhostNet: sconfig.HypervisorConfig.DisableVhostNet,
@ -485,7 +484,6 @@ func loadSandboxConfig(id string) (*SandboxConfig, error) {
FileBackedMemRootList: hconf.FileBackedMemRootList, FileBackedMemRootList: hconf.FileBackedMemRootList,
DisableNestingChecks: hconf.DisableNestingChecks, DisableNestingChecks: hconf.DisableNestingChecks,
DisableImageNvdimm: hconf.DisableImageNvdimm, DisableImageNvdimm: hconf.DisableImageNvdimm,
HotplugVFIOOnRootBus: hconf.HotplugVFIOOnRootBus,
HotPlugVFIO: hconf.HotPlugVFIO, HotPlugVFIO: hconf.HotPlugVFIO,
ColdPlugVFIO: hconf.ColdPlugVFIO, ColdPlugVFIO: hconf.ColdPlugVFIO,
BootToBeTemplate: hconf.BootToBeTemplate, BootToBeTemplate: hconf.BootToBeTemplate,

View File

@ -191,10 +191,6 @@ type HypervisorConfig struct {
// DisableImageNvdimm disables nvdimm for guest rootfs image // DisableImageNvdimm disables nvdimm for guest rootfs image
DisableImageNvdimm bool DisableImageNvdimm bool
// HotplugVFIOOnRootBus is used to indicate if devices need to be hotplugged on the
// root bus instead of a bridge.
HotplugVFIOOnRootBus bool
// HotPlugVFIO is used to indicate if devices need to be hotplugged on the // HotPlugVFIO is used to indicate if devices need to be hotplugged on the
// root, switch, bridge or no-port // root, switch, bridge or no-port
HotPlugVFIO config.PCIePort HotPlugVFIO config.PCIePort

View File

@ -122,10 +122,6 @@ const (
// DisableImageNvdimm is a sandbox annotation to specify use of nvdimm device for guest rootfs image. // DisableImageNvdimm is a sandbox annotation to specify use of nvdimm device for guest rootfs image.
DisableImageNvdimm = kataAnnotHypervisorPrefix + "disable_image_nvdimm" DisableImageNvdimm = kataAnnotHypervisorPrefix + "disable_image_nvdimm"
// HotplugVFIOOnRootBus is a sandbox annotation used to indicate if devices need to be hotplugged on the
// root bus instead of a bridge.
HotplugVFIOOnRootBus = kataAnnotHypervisorPrefix + "hotplug_vfio_on_root_bus"
// ColdPlugVFIO is a sandbox annotation used to indicate if devices need to be coldplugged. // ColdPlugVFIO is a sandbox annotation used to indicate if devices need to be coldplugged.
ColdPlugVFIO = kataAnnotHypervisorPrefix + "cold_plug_vfio" ColdPlugVFIO = kataAnnotHypervisorPrefix + "cold_plug_vfio"