Skip to content
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

runtime-rs: Add pci_hotplug as a config option #9595

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions src/libs/kata-types/src/config/hypervisor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,14 @@ pub struct DeviceInfo {
#[serde(default)]
pub default_bridges: u32,

/// Enable PCI hotplug support, default false
///
/// This is a Dragonball only config for the time being.
///
/// Enabling this will result in hotplugin VFIO devices (see below).
#[serde(default)]
pub pci_hotplug: bool,

Comment on lines +456 to +457
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a comment here that this currently is a dragonball-only config, so that other people could know that this config won't take effect on other VMMs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, thanks!

/// VFIO devices are hotplugged on a bridge by default.
///
/// Enable hotplugging on root bus. This may be required for devices with a large PCI bar,
Expand Down
2 changes: 2 additions & 0 deletions src/runtime-rs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ DEFMEMSLOTS := 10
DEFMAXMEMSZ := 0
##VAR DEFBRIDGES=<number> Default number of bridges
DEFBRIDGES := 0
DEFPCIHOTPLUG := false
DEFENABLEANNOTATIONS := [\"kernel_params\"]
DEFDISABLEGUESTSECCOMP := true
DEFDISABLEGUESTEMPTYDIR := false
Expand Down Expand Up @@ -362,6 +363,7 @@ USER_VARS += DEFMEMSZ
USER_VARS += DEFMEMSLOTS
USER_VARS += DEFMAXMEMSZ
USER_VARS += DEFBRIDGES
USER_VARS += DEFPCIHOTPLUG
USER_VARS += DEFNETWORKMODEL_DB
USER_VARS += DEFNETWORKMODEL_CLH
USER_VARS += DEFNETWORKMODEL_QEMU
Expand Down
6 changes: 6 additions & 0 deletions src/runtime-rs/config/configuration-dragonball.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ default_maxvcpus = @DEFMAXVCPUS_DB@
# > 5 --> will be set to 5
default_bridges = @DEFBRIDGES@

# PCI hotplug
# Enable or disable pci_hotplug
# Only available on Dragonball for the time being.
# Default value: @DEFPCIHOTPLUG@
pci_hotplug = @DEFPCIHOTPLUG@
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a comment here that this currently is a dragonball-only config, so that other people could know that this config won't take effect on other VMMs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, thanks!


# Default memory size in MiB for SB/VM.
# If unspecified then it will be set @DEFMEMSZ@ MiB.
default_memory = @DEFMEMSZ@
Expand Down
2 changes: 1 addition & 1 deletion src/runtime-rs/crates/hypervisor/src/dragonball/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl DragonballInner {
max_vcpu_count: self.config.cpu_info.default_maxvcpus as u8,
mem_type,
mem_file_path,
pci_hotplug_enabled: true,
pci_hotplug_enabled: self.hypervisor_config().device_info.pci_hotplug,
..Default::default()
};
info!(sl!(), "vm config: {:?}", vm_config);
Expand Down
Loading