From 14e9d2c815bce8e887719d9aeaaaee8278fba02c Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Fri, 25 Jul 2025 08:43:50 +0000 Subject: [PATCH 1/2] versions: Upgrade to Cloud Hypervisor v47.0 Details of v47.0 release can be found in our roadmap project as iteration v47.0: https://github.com/orgs/cloud-hypervisor/projects/6. Signed-off-by: Ruoqing He --- versions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.yaml b/versions.yaml index 90ba81d7d6..4858e86d24 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: "v45.0" + version: "v47.0" firecracker: description: "Firecracker micro-VMM" From 3ec10b372183b63206e83eab74f5e2a03ad1c0b7 Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Fri, 25 Jul 2025 08:53:31 +0000 Subject: [PATCH 2/2] runtime: clh: Re-generate client code against v47.0 Re-generates the client code against Cloud Hypervisor v47.0. Note: The client code of cloud-hypervisor's OpenAPI is automatically generated by openapi-generator. Signed-off-by: Ruoqing He --- src/runtime/virtcontainers/clh.go | 6 ++-- .../cloud-hypervisor/client/api/openapi.yaml | 8 +++-- .../client/docs/DefaultApi.md | 2 +- .../client/docs/DiskConfig.md | 9 +++-- .../cloud-hypervisor/client/docs/NetConfig.md | 4 +-- .../client/model_disk_config.go | 33 +++++++++++-------- .../client/model_net_config.go | 6 ++-- .../cloud-hypervisor/cloud-hypervisor.yaml | 6 ++-- 8 files changed, 48 insertions(+), 26 deletions(-) diff --git a/src/runtime/virtcontainers/clh.go b/src/runtime/virtcontainers/clh.go index ddb9df9d85..8714794d98 100644 --- a/src/runtime/virtcontainers/clh.go +++ b/src/runtime/virtcontainers/clh.go @@ -594,7 +594,8 @@ func (clh *cloudHypervisor) CreateVM(ctx context.Context, id string, network Net if assetType == types.ImageAsset { if clh.config.DisableImageNvdimm || clh.config.ConfidentialGuest { - disk := chclient.NewDiskConfig(assetPath) + disk := chclient.NewDiskConfig() + disk.Path = &assetPath disk.SetReadonly(true) diskRateLimiterConfig := clh.getDiskRateLimiterConfig() @@ -886,7 +887,8 @@ func (clh *cloudHypervisor) hotplugAddBlockDevice(drive *config.BlockDrive) erro } // Create the clh disk config via the constructor to ensure default values are properly assigned - clhDisk := *chclient.NewDiskConfig(drive.File) + clhDisk := *chclient.NewDiskConfig() + clhDisk.Path = &drive.File clhDisk.Readonly = &drive.ReadOnly clhDisk.VhostUser = func(b bool) *bool { return &b }(false) if clh.config.BlockDeviceCacheSet { 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 acb2b948dd..8fe3234463 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml @@ -149,6 +149,9 @@ paths: description: The VM instance was successfully resized. "404": description: The VM instance could not be resized because it is not created. + "429": + description: The VM instance could not be resized because a cpu removal + is still pending. summary: Resize the VM /vm.resize-zone: put: @@ -1762,8 +1765,6 @@ components: items: $ref: '#/components/schemas/VirtQueueAffinity' type: array - required: - - path type: object NetConfig: example: @@ -1795,9 +1796,12 @@ components: type: string ip: default: 192.168.249.1 + description: IPv4 or IPv6 address type: string mask: default: 255.255.255.0 + description: Must be a valid IPv4 netmask if ip is an IPv4 address or a + valid IPv6 netmask if ip is an IPv6 address. type: string mac: type: string diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md index 4ea4ddaa55..e4cac03fdc 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md @@ -637,7 +637,7 @@ import ( ) func main() { - diskConfig := *openapiclient.NewDiskConfig("Path_example") // DiskConfig | The details of the new disk + diskConfig := *openapiclient.NewDiskConfig() // DiskConfig | The details of the new disk configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/DiskConfig.md b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/DiskConfig.md index 74367d8acd..c50d4b35d0 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/DiskConfig.md +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/DiskConfig.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Path** | **string** | | +**Path** | Pointer to **string** | | [optional] **Readonly** | Pointer to **bool** | | [optional] [default to false] **Direct** | Pointer to **bool** | | [optional] [default to false] **Iommu** | Pointer to **bool** | | [optional] [default to false] @@ -23,7 +23,7 @@ Name | Type | Description | Notes ### NewDiskConfig -`func NewDiskConfig(path string, ) *DiskConfig` +`func NewDiskConfig() *DiskConfig` NewDiskConfig instantiates a new DiskConfig object This constructor will assign default values to properties that have it defined, @@ -57,6 +57,11 @@ and a boolean to check if the value has been set. SetPath sets Path field to given value. +### HasPath + +`func (o *DiskConfig) HasPath() bool` + +HasPath returns a boolean if a field has been set. ### GetReadonly diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md index f3af126473..78ae659c6c 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Tap** | Pointer to **string** | | [optional] -**Ip** | Pointer to **string** | | [optional] [default to "192.168.249.1"] -**Mask** | Pointer to **string** | | [optional] [default to "255.255.255.0"] +**Ip** | Pointer to **string** | IPv4 or IPv6 address | [optional] [default to "192.168.249.1"] +**Mask** | Pointer to **string** | Must be a valid IPv4 netmask if ip is an IPv4 address or a valid IPv6 netmask if ip is an IPv6 address. | [optional] [default to "255.255.255.0"] **Mac** | Pointer to **string** | | [optional] **HostMac** | Pointer to **string** | | [optional] **Mtu** | Pointer to **int32** | | [optional] diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go index a802ee27ce..f898c94fd3 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go @@ -16,7 +16,7 @@ import ( // DiskConfig struct for DiskConfig type DiskConfig struct { - Path string `json:"path"` + Path *string `json:"path,omitempty"` Readonly *bool `json:"readonly,omitempty"` Direct *bool `json:"direct,omitempty"` Iommu *bool `json:"iommu,omitempty"` @@ -36,9 +36,8 @@ type DiskConfig struct { // 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 NewDiskConfig(path string) *DiskConfig { +func NewDiskConfig() *DiskConfig { this := DiskConfig{} - this.Path = path var readonly bool = false this.Readonly = &readonly var direct bool = false @@ -74,28 +73,36 @@ func NewDiskConfigWithDefaults() *DiskConfig { return &this } -// GetPath returns the Path field value +// GetPath returns the Path field value if set, zero value otherwise. func (o *DiskConfig) GetPath() string { - if o == nil { + if o == nil || o.Path == nil { var ret string return ret } - - return o.Path + return *o.Path } -// GetPathOk returns a tuple with the Path field value +// GetPathOk returns a tuple with the Path field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DiskConfig) GetPathOk() (*string, bool) { - if o == nil { + if o == nil || o.Path == nil { return nil, false } - return &o.Path, true + return o.Path, true } -// SetPath sets field value +// HasPath returns a boolean if a field has been set. +func (o *DiskConfig) HasPath() bool { + if o != nil && o.Path != nil { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. func (o *DiskConfig) SetPath(v string) { - o.Path = v + o.Path = &v } // GetReadonly returns the Readonly field value if set, zero value otherwise. @@ -516,7 +523,7 @@ func (o *DiskConfig) SetQueueAffinity(v []VirtQueueAffinity) { func (o DiskConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if true { + if o.Path != nil { toSerialize["path"] = o.Path } if o.Readonly != nil { diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go index 8f6d30ff3b..3302067579 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go @@ -16,8 +16,10 @@ import ( // NetConfig struct for NetConfig type NetConfig struct { - Tap *string `json:"tap,omitempty"` - Ip *string `json:"ip,omitempty"` + Tap *string `json:"tap,omitempty"` + // IPv4 or IPv6 address + Ip *string `json:"ip,omitempty"` + // Must be a valid IPv4 netmask if ip is an IPv4 address or a valid IPv6 netmask if ip is an IPv6 address. Mask *string `json:"mask,omitempty"` Mac *string `json:"mac,omitempty"` HostMac *string `json:"host_mac,omitempty"` diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml b/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml index 81a58c0560..80a4fa2572 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml @@ -160,6 +160,8 @@ paths: description: The VM instance was successfully resized. 404: description: The VM instance could not be resized because it is not created. + 429: + description: The VM instance could not be resized because a cpu removal is still pending. /vm.resize-zone: put: @@ -885,8 +887,6 @@ components: type: integer DiskConfig: - required: - - path type: object properties: path: @@ -935,9 +935,11 @@ components: ip: type: string default: "192.168.249.1" + description: IPv4 or IPv6 address mask: type: string default: "255.255.255.0" + description: Must be a valid IPv4 netmask if ip is an IPv4 address or a valid IPv6 netmask if ip is an IPv6 address. mac: type: string host_mac: