Skip to content

Commit

Permalink
incusd/instance: Make QMP command list type more specific
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Somers <[email protected]>
  • Loading branch information
bensmrs committed Aug 12, 2024
1 parent afc4344 commit d16cfc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/server/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -1198,10 +1198,10 @@ func (d *qemu) Start(stateful bool) error {
func (d *qemu) runQMP(monitor *qmp.Monitor, stage string) error {
commands, ok := d.expandedConfig["raw.qemu.qmp." + stage]
if ok {
var commandList []any
var commandList []map[string]any
err := json.Unmarshal([]byte(commands), &commandList)
if err != nil {
err = fmt.Errorf("Failed to parse QMP commands at %s stage (expected JSON list): %w", stage, err)
err = fmt.Errorf("Failed to parse QMP commands at %s stage (expected JSON list of objects): %w", stage, err)
return err
}
for _, command := range commandList {
Expand Down

0 comments on commit d16cfc9

Please sign in to comment.