MCPcopy
hub / github.com/lxc/incus / QueryCPUModel

Method QueryCPUModel

internal/server/instance/drivers/qmp/commands.go:201–220  ·  view source on GitHub ↗

QueryCPUModel returns a CPUModel for the specified model name.

(model string)

Source from the content-addressed store, hash-verified

199
200// QueryCPUModel returns a CPUModel for the specified model name.
201func (m *Monitor) QueryCPUModel(model string) (*CPUModel, error) {
202 // Prepare the response.
203 var resp struct {
204 Return struct {
205 Model CPUModel `json:"model"`
206 } `json:"return"`
207 }
208
209 args := map[string]any{
210 "model": map[string]string{"name": model},
211 "type": "full",
212 }
213
214 err := m.Run("query-cpu-model-expansion", args, &resp)
215 if err != nil {
216 return nil, fmt.Errorf("Failed to query CPU model: %w", err)
217 }
218
219 return &resp.Return.Model, nil
220}
221
222// Status returns the current VM status.
223func (m *Monitor) Status() (string, error) {

Callers 1

checkFeaturesMethod · 0.95

Calls 2

RunMethod · 0.95
ErrorfMethod · 0.80

Tested by

no test coverage detected