CCv0: Merge main into CCv0 branch

Merge remote-tracking branch 'upstream/main' into CCv0

Fixes: #6428
Signed-off-by: Georgina Kinge <georgina.kinge@ibm.com>
This commit is contained in:
Georgina Kinge
2023-03-09 16:14:53 +00:00
112 changed files with 3535 additions and 1865 deletions

View File

@@ -225,7 +225,7 @@ DEFSHAREDFS_CLH_VIRTIOFS := virtio-fs
DEFSHAREDFS_QEMU_VIRTIOFS := virtio-fs
DEFVIRTIOFSDAEMON := $(LIBEXECDIR)/virtiofsd
ifeq ($(ARCH),ppc64le)
DEFVIRTIOFSDAEMON := $(LIBEXECDIR)/kata-qemu/virtiofsd
DEFVIRTIOFSDAEMON := $(LIBEXECDIR)/qemu/virtiofsd
endif
DEFVALIDVIRTIOFSDAEMONPATHS := [\"$(DEFVIRTIOFSDAEMON)\"]
# Default DAX mapping cache size in MiB
@@ -789,7 +789,7 @@ install-bin: $(BINLIST)
install-runtime: runtime install-scripts install-completions install-configs install-bin
install-containerd-shim-v2: $(SHIMV2)
install-containerd-shim-v2: $(SHIMV2_OUTPUT)
$(QUIET_INST)$(call INSTALL_EXEC,$<,$(BINDIR))
install-monitor: $(MONITOR)

View File

@@ -307,7 +307,7 @@ func GetSandboxesStoragePath() string {
return "/run/vc/sbs"
}
// GetSandboxesStoragePath returns the storage path where sandboxes info are stored in runtime-rs
// GetSandboxesStoragePathRust returns the storage path where sandboxes info are stored in runtime-rs
func GetSandboxesStoragePathRust() string {
return "/run/kata"
}

View File

@@ -44,6 +44,7 @@ func mountLogger() *logrus.Entry {
}
func isSystemMount(m string) bool {
m = filepath.Clean(m)
for _, p := range systemMountPrefixes {
if m == p || strings.HasPrefix(m, p+"/") {
return true
@@ -54,6 +55,7 @@ func isSystemMount(m string) bool {
}
func isHostDevice(m string) bool {
m = filepath.Clean(m)
if m == "/dev" {
return true
}

View File

@@ -249,6 +249,9 @@ func TestIsHostDevice(t *testing.T) {
{"/dev/zero", true},
{"/dev/block", true},
{"/mnt/dev/block", false},
{"/../dev", true},
{"/../dev/block", true},
{"/../mnt/dev/block", false},
}
for _, test := range tests {

View File

@@ -41,6 +41,10 @@ func TestIsSystemMount(t *testing.T) {
{"/home", false},
{"/dev/block/", false},
{"/mnt/dev/foo", false},
{"/../sys", true},
{"/../sys/", true},
{"/../sys/fs/cgroup", true},
{"/../sysfoo", false},
}
for _, test := range tests {

View File

@@ -1131,6 +1131,9 @@ components:
items:
type: integer
type: array
required:
- host_cpus
- vcpu
type: object
CpuFeatures:
example:

View File

@@ -4,14 +4,14 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Vcpu** | Pointer to **int32** | | [optional]
**HostCpus** | Pointer to **[]int32** | | [optional]
**Vcpu** | **int32** | |
**HostCpus** | **[]int32** | |
## Methods
### NewCpuAffinity
`func NewCpuAffinity() *CpuAffinity`
`func NewCpuAffinity(vcpu int32, hostCpus []int32, ) *CpuAffinity`
NewCpuAffinity instantiates a new CpuAffinity object
This constructor will assign default values to properties that have it defined,
@@ -45,11 +45,6 @@ and a boolean to check if the value has been set.
SetVcpu sets Vcpu field to given value.
### HasVcpu
`func (o *CpuAffinity) HasVcpu() bool`
HasVcpu returns a boolean if a field has been set.
### GetHostCpus
@@ -70,11 +65,6 @@ and a boolean to check if the value has been set.
SetHostCpus sets HostCpus field to given value.
### HasHostCpus
`func (o *CpuAffinity) HasHostCpus() bool`
HasHostCpus returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -16,16 +16,18 @@ import (
// CpuAffinity struct for CpuAffinity
type CpuAffinity struct {
Vcpu *int32 `json:"vcpu,omitempty"`
HostCpus *[]int32 `json:"host_cpus,omitempty"`
Vcpu int32 `json:"vcpu"`
HostCpus []int32 `json:"host_cpus"`
}
// NewCpuAffinity instantiates a new CpuAffinity object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCpuAffinity() *CpuAffinity {
func NewCpuAffinity(vcpu int32, hostCpus []int32) *CpuAffinity {
this := CpuAffinity{}
this.Vcpu = vcpu
this.HostCpus = hostCpus
return &this
}
@@ -37,76 +39,60 @@ func NewCpuAffinityWithDefaults() *CpuAffinity {
return &this
}
// GetVcpu returns the Vcpu field value if set, zero value otherwise.
// GetVcpu returns the Vcpu field value
func (o *CpuAffinity) GetVcpu() int32 {
if o == nil || o.Vcpu == nil {
if o == nil {
var ret int32
return ret
}
return *o.Vcpu
return o.Vcpu
}
// GetVcpuOk returns a tuple with the Vcpu field value if set, nil otherwise
// GetVcpuOk returns a tuple with the Vcpu field value
// and a boolean to check if the value has been set.
func (o *CpuAffinity) GetVcpuOk() (*int32, bool) {
if o == nil || o.Vcpu == nil {
if o == nil {
return nil, false
}
return o.Vcpu, true
return &o.Vcpu, true
}
// HasVcpu returns a boolean if a field has been set.
func (o *CpuAffinity) HasVcpu() bool {
if o != nil && o.Vcpu != nil {
return true
}
return false
}
// SetVcpu gets a reference to the given int32 and assigns it to the Vcpu field.
// SetVcpu sets field value
func (o *CpuAffinity) SetVcpu(v int32) {
o.Vcpu = &v
o.Vcpu = v
}
// GetHostCpus returns the HostCpus field value if set, zero value otherwise.
// GetHostCpus returns the HostCpus field value
func (o *CpuAffinity) GetHostCpus() []int32 {
if o == nil || o.HostCpus == nil {
if o == nil {
var ret []int32
return ret
}
return *o.HostCpus
return o.HostCpus
}
// GetHostCpusOk returns a tuple with the HostCpus field value if set, nil otherwise
// GetHostCpusOk returns a tuple with the HostCpus field value
// and a boolean to check if the value has been set.
func (o *CpuAffinity) GetHostCpusOk() (*[]int32, bool) {
if o == nil || o.HostCpus == nil {
if o == nil {
return nil, false
}
return o.HostCpus, true
return &o.HostCpus, true
}
// HasHostCpus returns a boolean if a field has been set.
func (o *CpuAffinity) HasHostCpus() bool {
if o != nil && o.HostCpus != nil {
return true
}
return false
}
// SetHostCpus gets a reference to the given []int32 and assigns it to the HostCpus field.
// SetHostCpus sets field value
func (o *CpuAffinity) SetHostCpus(v []int32) {
o.HostCpus = &v
o.HostCpus = v
}
func (o CpuAffinity) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Vcpu != nil {
if true {
toSerialize["vcpu"] = o.Vcpu
}
if o.HostCpus != nil {
if true {
toSerialize["host_cpus"] = o.HostCpus
}
return json.Marshal(toSerialize)

View File

@@ -578,6 +578,9 @@ components:
description: Virtual machine configuration
CpuAffinity:
required:
- vcpu
- host_cpus
type: object
properties:
vcpu: