Skip to content

Commit 31dd75b

Browse files
committed
shorten response to resp
1 parent 3d8bf99 commit 31dd75b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/drivers/qemu/qemu.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ func (d *Driver) RunQMPCommand(command string) (map[string]interface{}, error) {
667667
var buf [1024]byte
668668
nr, err := conn.Read(buf[:])
669669
if err != nil {
670-
return nil, errors.Wrap(err, "read initial response")
670+
return nil, errors.Wrap(err, "read initial resp")
671671
}
672672
type qmpInitialResponse struct {
673673
QMP struct {
@@ -685,7 +685,7 @@ func (d *Driver) RunQMPCommand(command string) (map[string]interface{}, error) {
685685

686686
var initialResponse qmpInitialResponse
687687
if err := json.Unmarshal(buf[:nr], &initialResponse); err != nil {
688-
return nil, errors.Wrap(err, "unmarshal initial response")
688+
return nil, errors.Wrap(err, "unmarshal initial resp")
689689
}
690690

691691
// run 'qmp_capabilities' to switch to command mode
@@ -702,14 +702,14 @@ func (d *Driver) RunQMPCommand(command string) (map[string]interface{}, error) {
702702
}
703703
nr, err = conn.Read(buf[:])
704704
if err != nil {
705-
return nil, errors.Wrap(err, "read qmp_capabilities response")
705+
return nil, errors.Wrap(err, "read qmp_capabilities resp")
706706
}
707707
type qmpResponse struct {
708708
Return map[string]interface{} `json:"return"`
709709
}
710710
var response qmpResponse
711711
if err := json.Unmarshal(buf[:nr], &response); err != nil {
712-
return nil, errors.Wrap(err, "unmarshal qmp_capabilities response")
712+
return nil, errors.Wrap(err, "unmarshal qmp_capabilities resp")
713713
}
714714
// expecting empty response
715715
if len(response.Return) != 0 {
@@ -726,14 +726,14 @@ func (d *Driver) RunQMPCommand(command string) (map[string]interface{}, error) {
726726
}
727727
nr, err = conn.Read(buf[:])
728728
if err != nil {
729-
return nil, errors.Wrap(err, "read command response")
729+
return nil, errors.Wrap(err, "read command resp")
730730
}
731731

732732
// Sometimes QEMU returns two JSON objects with the first object being the command response
733733
// and the second object being an event log (unimportant)
734734
firstRespObj := strings.Split(string(buf[:nr]), "\n")[0]
735735
if err := json.Unmarshal([]byte(firstRespObj), &response); err != nil {
736-
return nil, errors.Wrap(err, "unmarshal command response")
736+
return nil, errors.Wrap(err, "unmarshal command resp")
737737
}
738738
if strings.HasPrefix(command, "query-") {
739739
return response.Return, nil

0 commit comments

Comments
 (0)