Merge pull request #11626 from RuoqingHe/bump-cloud-hypervisor-v47

versions: Upgrade to Cloud Hypervisor v47.0
This commit is contained in:
Xuewei Niu 2025-07-28 10:34:45 +08:00 committed by GitHub
commit e5d5768c75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 49 additions and 27 deletions

View File

@ -594,7 +594,8 @@ func (clh *cloudHypervisor) CreateVM(ctx context.Context, id string, network Net
if assetType == types.ImageAsset { if assetType == types.ImageAsset {
if clh.config.DisableImageNvdimm || clh.config.ConfidentialGuest { if clh.config.DisableImageNvdimm || clh.config.ConfidentialGuest {
disk := chclient.NewDiskConfig(assetPath) disk := chclient.NewDiskConfig()
disk.Path = &assetPath
disk.SetReadonly(true) disk.SetReadonly(true)
diskRateLimiterConfig := clh.getDiskRateLimiterConfig() 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 // 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.Readonly = &drive.ReadOnly
clhDisk.VhostUser = func(b bool) *bool { return &b }(false) clhDisk.VhostUser = func(b bool) *bool { return &b }(false)
if clh.config.BlockDeviceCacheSet { if clh.config.BlockDeviceCacheSet {

View File

@ -149,6 +149,9 @@ paths:
description: The VM instance was successfully resized. description: The VM instance was successfully resized.
"404": "404":
description: The VM instance could not be resized because it is not created. 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 summary: Resize the VM
/vm.resize-zone: /vm.resize-zone:
put: put:
@ -1762,8 +1765,6 @@ components:
items: items:
$ref: '#/components/schemas/VirtQueueAffinity' $ref: '#/components/schemas/VirtQueueAffinity'
type: array type: array
required:
- path
type: object type: object
NetConfig: NetConfig:
example: example:
@ -1795,9 +1796,12 @@ components:
type: string type: string
ip: ip:
default: 192.168.249.1 default: 192.168.249.1
description: IPv4 or IPv6 address
type: string type: string
mask: mask:
default: 255.255.255.0 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 type: string
mac: mac:
type: string type: string

View File

@ -637,7 +637,7 @@ import (
) )
func main() { 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() configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration) api_client := openapiclient.NewAPIClient(configuration)

View File

@ -4,7 +4,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Path** | **string** | | **Path** | Pointer to **string** | | [optional]
**Readonly** | Pointer to **bool** | | [optional] [default to false] **Readonly** | Pointer to **bool** | | [optional] [default to false]
**Direct** | Pointer to **bool** | | [optional] [default to false] **Direct** | Pointer to **bool** | | [optional] [default to false]
**Iommu** | Pointer to **bool** | | [optional] [default to false] **Iommu** | Pointer to **bool** | | [optional] [default to false]
@ -23,7 +23,7 @@ Name | Type | Description | Notes
### NewDiskConfig ### NewDiskConfig
`func NewDiskConfig(path string, ) *DiskConfig` `func NewDiskConfig() *DiskConfig`
NewDiskConfig instantiates a new DiskConfig object NewDiskConfig instantiates a new DiskConfig object
This constructor will assign default values to properties that have it defined, 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. SetPath sets Path field to given value.
### HasPath
`func (o *DiskConfig) HasPath() bool`
HasPath returns a boolean if a field has been set.
### GetReadonly ### GetReadonly

View File

@ -5,8 +5,8 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Tap** | Pointer to **string** | | [optional] **Tap** | Pointer to **string** | | [optional]
**Ip** | Pointer to **string** | | [optional] [default to "192.168.249.1"] **Ip** | Pointer to **string** | IPv4 or IPv6 address | [optional] [default to "192.168.249.1"]
**Mask** | Pointer to **string** | | [optional] [default to "255.255.255.0"] **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] **Mac** | Pointer to **string** | | [optional]
**HostMac** | Pointer to **string** | | [optional] **HostMac** | Pointer to **string** | | [optional]
**Mtu** | Pointer to **int32** | | [optional] **Mtu** | Pointer to **int32** | | [optional]

View File

@ -16,7 +16,7 @@ import (
// DiskConfig struct for DiskConfig // DiskConfig struct for DiskConfig
type DiskConfig struct { type DiskConfig struct {
Path string `json:"path"` Path *string `json:"path,omitempty"`
Readonly *bool `json:"readonly,omitempty"` Readonly *bool `json:"readonly,omitempty"`
Direct *bool `json:"direct,omitempty"` Direct *bool `json:"direct,omitempty"`
Iommu *bool `json:"iommu,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, // 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 // and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed // will change when the set of required properties is changed
func NewDiskConfig(path string) *DiskConfig { func NewDiskConfig() *DiskConfig {
this := DiskConfig{} this := DiskConfig{}
this.Path = path
var readonly bool = false var readonly bool = false
this.Readonly = &readonly this.Readonly = &readonly
var direct bool = false var direct bool = false
@ -74,28 +73,36 @@ func NewDiskConfigWithDefaults() *DiskConfig {
return &this return &this
} }
// GetPath returns the Path field value // GetPath returns the Path field value if set, zero value otherwise.
func (o *DiskConfig) GetPath() string { func (o *DiskConfig) GetPath() string {
if o == nil { if o == nil || o.Path == nil {
var ret string var ret string
return ret 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. // and a boolean to check if the value has been set.
func (o *DiskConfig) GetPathOk() (*string, bool) { func (o *DiskConfig) GetPathOk() (*string, bool) {
if o == nil { if o == nil || o.Path == nil {
return nil, false 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) { func (o *DiskConfig) SetPath(v string) {
o.Path = v o.Path = &v
} }
// GetReadonly returns the Readonly field value if set, zero value otherwise. // 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) { func (o DiskConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{} toSerialize := map[string]interface{}{}
if true { if o.Path != nil {
toSerialize["path"] = o.Path toSerialize["path"] = o.Path
} }
if o.Readonly != nil { if o.Readonly != nil {

View File

@ -16,8 +16,10 @@ import (
// NetConfig struct for NetConfig // NetConfig struct for NetConfig
type NetConfig struct { type NetConfig struct {
Tap *string `json:"tap,omitempty"` Tap *string `json:"tap,omitempty"`
Ip *string `json:"ip,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"` Mask *string `json:"mask,omitempty"`
Mac *string `json:"mac,omitempty"` Mac *string `json:"mac,omitempty"`
HostMac *string `json:"host_mac,omitempty"` HostMac *string `json:"host_mac,omitempty"`

View File

@ -160,6 +160,8 @@ paths:
description: The VM instance was successfully resized. description: The VM instance was successfully resized.
404: 404:
description: The VM instance could not be resized because it is not created. 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: /vm.resize-zone:
put: put:
@ -885,8 +887,6 @@ components:
type: integer type: integer
DiskConfig: DiskConfig:
required:
- path
type: object type: object
properties: properties:
path: path:
@ -935,9 +935,11 @@ components:
ip: ip:
type: string type: string
default: "192.168.249.1" default: "192.168.249.1"
description: IPv4 or IPv6 address
mask: mask:
type: string type: string
default: "255.255.255.0" 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: mac:
type: string type: string
host_mac: host_mac:

View File

@ -75,7 +75,7 @@ assets:
url: "https://github.com/cloud-hypervisor/cloud-hypervisor" url: "https://github.com/cloud-hypervisor/cloud-hypervisor"
uscan-url: >- uscan-url: >-
https://github.com/cloud-hypervisor/cloud-hypervisor/tags.*/v?(\d\S+)\.tar\.gz https://github.com/cloud-hypervisor/cloud-hypervisor/tags.*/v?(\d\S+)\.tar\.gz
version: "v45.0" version: "v47.0"
firecracker: firecracker:
description: "Firecracker micro-VMM" description: "Firecracker micro-VMM"