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 <heruoqing@iscas.ac.cn>
This commit is contained in:
Ruoqing He
2025-07-25 08:53:31 +00:00
committed by Fabiano Fidêncio
parent 14e9d2c815
commit 3ec10b3721
8 changed files with 48 additions and 26 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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]

View File

@@ -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 {

View File

@@ -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"`

View File

@@ -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: