Skip to content

Commit

Permalink
runtime/virtcontrainers: fix alignment HypervisorConfig struct
Browse files Browse the repository at this point in the history
HypervisorConfig struct of size 760 bytes could be of size 752 bytes,
fix maligned.

Signed-off-by: Julio Montes <julio.montes@intel.com>
  • Loading branch information
Julio Montes committed Jun 14, 2021
1 parent aaf72f0 commit d9e88b7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/how-to/how-to-set-sandbox-config-kata.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ There are several kinds of Kata configurations and they are listed below.
| `io.katacontainers.config.hypervisor.kernel` | string | the kernel used to boot the container VM |
| `io.katacontainers.config.hypervisor.machine_accelerators` | string | machine specific accelerators for the hypervisor |
| `io.katacontainers.config.hypervisor.machine_type` | string | the type of machine being emulated by the hypervisor |
| `io.katacontainers.config.hypervisor.memory_offset` | uint32| the memory space used for `nvdimm` device by the hypervisor |
| `io.katacontainers.config.hypervisor.memory_offset` | uint64| the memory space used for `nvdimm` device by the hypervisor |
| `io.katacontainers.config.hypervisor.memory_slots` | uint32| the memory slots assigned to the VM by the hypervisor |
| `io.katacontainers.config.hypervisor.msize_9p` | uint32 | the `msize` for 9p shares |
| `io.katacontainers.config.hypervisor.path` | string | the hypervisor that will run the container VM |
Expand Down
58 changes: 29 additions & 29 deletions src/runtime/virtcontainers/hypervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,6 @@ type HypervisorConfig struct {
// entropy (/dev/random, /dev/urandom or real hardware RNG device)
EntropySource string

// EntropySourceList is the list of valid entropy sources
EntropySourceList []string

// Shared file system type:
// - virtio-9p (default)
// - virtio-fs
Expand All @@ -318,6 +315,12 @@ type HypervisorConfig struct {
// VirtioFSDaemon is the virtio-fs vhost-user daemon path
VirtioFSDaemon string

// File based memory backend root directory
FileBackedMemRootDir string

// EntropySourceList is the list of valid entropy sources
EntropySourceList []string

// VirtioFSDaemonList is the list of valid virtiofs names for annotations
VirtioFSDaemonList []string

Expand All @@ -327,15 +330,18 @@ type HypervisorConfig struct {
// VirtioFSExtraArgs passes options to virtiofsd daemon
VirtioFSExtraArgs []string

// File based memory backend root directory
FileBackedMemRootDir string
// Enable annotations by name
EnableAnnotations []string

// FileBackedMemRootList is the list of valid root directories values for annotations
FileBackedMemRootList []string

// PFlash image paths
PFlash []string

// VhostUserStorePathList is the list of valid values for vhost-user paths
VhostUserStorePathList []string

// customAssets is a map of assets.
// Each value in that map takes precedence over the configured assets.
// For example, if there is a value for the "kernel" key in this map,
Expand Down Expand Up @@ -398,9 +404,14 @@ type HypervisorConfig struct {
// root bus instead of a bridge.
HotplugVFIOOnRootBus bool

// PCIeRootPort is used to indicate the number of PCIe Root Port devices
// The PCIe Root Port device is used to hot-plug the PCIe device
PCIeRootPort uint32
// GuestMemoryDumpPaging is used to indicate if enable paging
// for QEMU dump-guest-memory command
GuestMemoryDumpPaging bool

// Enable confidential guest support.
// Enable or disable different hardware features, ranging
// from memory encryption to both memory and CPU-state encryption and integrity.
ConfidentialGuest bool

// BootToBeTemplate used to indicate if the VM is created to be a template VM
BootToBeTemplate bool
Expand All @@ -418,8 +429,8 @@ type HypervisorConfig struct {
// related folders, sockets and device nodes should be.
VhostUserStorePath string

// VhostUserStorePathList is the list of valid values for vhost-user paths
VhostUserStorePathList []string
// GuestCoredumpPath is the path in host for saving guest memory dump
GuestMemoryDumpPath string

// GuestHookPath is the path within the VM that will be used for 'drop-in' hooks
GuestHookPath string
Expand All @@ -431,6 +442,14 @@ type HypervisorConfig struct {
// SELinux label for the VM
SELinuxProcessLabel string

// SGXEPCSize specifies the size in bytes for the EPC Section.
// Enable SGX. Hardware-based isolation and memory encryption.
SGXEPCSize int64

// PCIeRootPort is used to indicate the number of PCIe Root Port devices
// The PCIe Root Port device is used to hot-plug the PCIe device
PCIeRootPort uint32

// RxRateLimiterMaxRate is used to control network I/O inbound bandwidth on VM level.
RxRateLimiterMaxRate uint64

Expand All @@ -439,25 +458,6 @@ type HypervisorConfig struct {

// MemOffset specifies memory space for nvdimm device
MemOffset uint64

// SGXEPCSize specifies the size in bytes for the EPC Section.
// Enable SGX. Hardware-based isolation and memory encryption.
SGXEPCSize int64

// Enable annotations by name
EnableAnnotations []string

// GuestCoredumpPath is the path in host for saving guest memory dump
GuestMemoryDumpPath string

// GuestMemoryDumpPaging is used to indicate if enable paging
// for QEMU dump-guest-memory command
GuestMemoryDumpPaging bool

// Enable confidential guest support.
// Enable or disable different hardware features, ranging
// from memory encryption to both memory and CPU-state encryption and integrity.
ConfidentialGuest bool
}

// vcpu mapping from vcpu number to thread number
Expand Down

0 comments on commit d9e88b7

Please sign in to comment.