Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions qmp/socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ func (mon *SocketMonitor) Events(context.Context) (<-chan Event, error) {
return mon.events, nil
}

// SetRWDeadline sets the read and write deadlines for the underlying socket.
// Set deadline to prevent the Command from hanging due to other processes
// (e.g. libvirt) occupying the QEMU monitor socket.
func (mon *SocketMonitor) SetRWDeadline(t time.Time) error {
return mon.c.SetDeadline(t)
}

// listen listens for incoming data from a QEMU monitor socket. It determines
// if the data is an asynchronous event or a response to a command, and returns
// the data on the appropriate channel.
Expand Down