Skip to content

Commit

Permalink
Merge pull request #1127 from ioito/hotfix/qx-isolate-device-sync
Browse files Browse the repository at this point in the history
fix: support isolate device sync
  • Loading branch information
ioito authored Nov 28, 2024
2 parents 2a0e636 + fb8f447 commit 0574df0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/cloudprovider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,18 @@ type ICloudHost interface {
GetSchedtags() ([]string, error)

GetOvnVersion() string // just for cloudpods host

GetIsolateDevices() ([]IsolateDevice, error)
}

type IsolateDevice interface {
GetName() string
GetGlobalId() string
GetModel() string
GetAddr() string
GetDevType() string
GetNumaNode() int8
GetVendorDeviceId() string
}

type ICloudVM interface {
Expand Down Expand Up @@ -400,6 +412,7 @@ type ICloudVM interface {

AllocatePublicIpAddress() (string, error)
GetPowerStates() string
GetIsolateDeviceIds() ([]string, error)
}

type ICloudNic interface {
Expand Down
6 changes: 6 additions & 0 deletions pkg/multicloud/host_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ package multicloud

import (
"yunion.io/x/cloudmux/pkg/apis"
"yunion.io/x/cloudmux/pkg/cloudprovider"
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
)

type SHostBase struct {
Expand Down Expand Up @@ -55,3 +57,7 @@ func (host *SHostBase) GetStorageDriver() string {
func (host *SHostBase) GetStorageInfo() jsonutils.JSONObject {
return nil
}

func (host *SHostBase) GetIsolateDevices() ([]cloudprovider.IsolateDevice, error) {
return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetIsolateDevices")
}
4 changes: 4 additions & 0 deletions pkg/multicloud/instance_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,7 @@ func (ins *SInstanceBase) GetPowerStates() string {
func (instance *SInstanceBase) GetError() error {
return nil
}

func (instance *SInstanceBase) GetIsolateDeviceIds() ([]string, error) {
return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetIsolateDeviceIds")
}
4 changes: 4 additions & 0 deletions pkg/multicloud/remotefile/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,7 @@ func (self *SInstance) GetPowerStates() string {
}
return api.VM_POWER_STATES_OFF
}

func (self *SInstance) GetIsolateDeviceIds() ([]string, error) {
return nil, cloudprovider.ErrNotSupported
}

0 comments on commit 0574df0

Please sign in to comment.