From 262daaa2eff4ab725df498ea841f2893e4cc94e3 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Fri, 24 Feb 2023 10:19:46 -0800 Subject: [PATCH 1/2] versions: Upgrade to Cloud Hypervisor v30.0 Details of this release can be found in our new roadmap project as iteration v30.0: https://github.com/orgs/cloud-hypervisor/projects/6. Fixes: #6375 Signed-off-by: Bo Chen --- versions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.yaml b/versions.yaml index 0099bd3be3..174162b99a 100644 --- a/versions.yaml +++ b/versions.yaml @@ -75,7 +75,7 @@ assets: url: "https://github.com/cloud-hypervisor/cloud-hypervisor" uscan-url: >- https://github.com/cloud-hypervisor/cloud-hypervisor/tags.*/v?(\d\S+)\.tar\.gz - version: "v29.0" + version: "v30.0" firecracker: description: "Firecracker micro-VMM" From 3ac6f29e95446e318b682d96bcba8a392ff5f392 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Fri, 24 Feb 2023 10:20:29 -0800 Subject: [PATCH 2/2] runtime: clh: Re-generate the client code This patch re-generates the client code for Cloud Hypervisor v30.0. Note: The client code of cloud-hypervisor's OpenAPI is automatically generated by openapi-generator. Fixes: #6375 Signed-off-by: Bo Chen --- .../cloud-hypervisor/client/api/openapi.yaml | 3 + .../client/docs/CpuAffinity.md | 16 +---- .../client/model_cpu_affinity.go | 64 ++++++++----------- .../cloud-hypervisor/cloud-hypervisor.yaml | 3 + 4 files changed, 34 insertions(+), 52 deletions(-) diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml index 750c1e7251..d514ae7b81 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml @@ -1131,6 +1131,9 @@ components: items: type: integer type: array + required: + - host_cpus + - vcpu type: object CpuFeatures: example: diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/CpuAffinity.md b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/CpuAffinity.md index 300c7af1da..52eb24a184 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/CpuAffinity.md +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/CpuAffinity.md @@ -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) diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpu_affinity.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpu_affinity.go index f0009699f2..889c8364f0 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpu_affinity.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpu_affinity.go @@ -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) diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml b/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml index dee8bdbf0c..a2392f9884 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml @@ -578,6 +578,9 @@ components: description: Virtual machine configuration CpuAffinity: + required: + - vcpu + - host_cpus type: object properties: vcpu: