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

Method Run

internal/server/instance/drivers/qmp/monitor.go:304–321  ·  view source on GitHub ↗

Run executes a command.

(cmd string, args any, resp any)

Source from the content-addressed store, hash-verified

302
303// Run executes a command.
304func (m *Monitor) Run(cmd string, args any, resp any) error {
305 id := m.IncreaseID()
306
307 // Construct the command.
308 requestArgs := qmpCommand{
309 ID: id,
310 Execute: cmd,
311 Arguments: args,
312 }
313
314 request, err := json.Marshal(requestArgs)
315 if err != nil {
316 return err
317 }
318
319 logCommand := !slices.Contains(ExcludedCommands, cmd)
320 return m.RunJSON(request, resp, logCommand, id)
321}
322
323// RunTransaction executes a series of commands as a single transaction.
324func (m *Monitor) RunTransaction(actions []TransactionAction) error {

Callers 15

QueryCPUsMethod · 0.95
QueryHotpluggableCPUsMethod · 0.95
QueryCPUModelMethod · 0.95
StatusMethod · 0.95
MachineDefinitionMethod · 0.95
MemoryConfigurationMethod · 0.95
CloseFileMethod · 0.95
RemoveFDFromFDSetMethod · 0.95
MigrateSetParametersMethod · 0.95
MigrateMethod · 0.95
QueryMigrateMethod · 0.95

Calls 3

IncreaseIDMethod · 0.95
RunJSONMethod · 0.95
ContainsMethod · 0.45

Tested by 15

TestRange_ContainsIPFunction · 0.36
TestRange_StringFunction · 0.36
TestVersionTestSuiteFunction · 0.36
TestObjectSuiteFunction · 0.36
Test_DHCPValidIPFunction · 0.36
TestQemuConfigTemplatesFunction · 0.36
TestDBTestSuiteFunction · 0.36
TestStrings_ErrorFunction · 0.36
TestIntegers_ErrorFunction · 0.36
TestSelectObjects_ErrorFunction · 0.36