Skip to content

Commit

Permalink
lxd/instance/drivers: Add ErrExecDisconnected
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
License: Apache-2.0
  • Loading branch information
stgraber authored and hamistao committed Aug 5, 2024
1 parent 2a2bead commit 9860084
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lxd/instance/drivers/driver_qemu_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
"github.com/canonical/lxd/shared/logger"
)

// ErrExecDisconnected is returned when the guest disconnects the exec session.
var ErrExecDisconnected = fmt.Errorf("Disconnected")

// Cmd represents a running command for an Qemu VM.
type qemuCmd struct {
attachedChildPid int
Expand Down Expand Up @@ -78,7 +81,7 @@ func (c *qemuCmd) Wait() (int, error) {
// so we inform the client of the disconnection with a more
// descriptive message.
if errors.Is(err, io.EOF) {
return exitStatus, fmt.Errorf("Disconnected")
return exitStatus, ErrExecDisconnected
}

return exitStatus, err
Expand Down

0 comments on commit 9860084

Please sign in to comment.