Documentation ¶
Index ¶
- type GuestCommand
- type GuestExec
- type GuestExecStatus
- type GuestInfo
- type QemuGuestAgent
- func (qga *QemuGuestAgent) Close() error
- func (qga *QemuGuestAgent) GuestExecCommand(cmdPath string, args, env []string, inputData string, captureOutput bool) (*GuestExec, error)
- func (qga *QemuGuestAgent) GuestExecStatusCommand(pid int) (*GuestExecStatus, error)
- func (qga *QemuGuestAgent) GuestInfo() (*GuestInfo, error)
- func (qga *QemuGuestAgent) GuestPing() error
- func (qga *QemuGuestAgent) GuestSetUserPassword(username, password string, crypted bool) error
- func (qga *QemuGuestAgent) Lock()
- func (qga *QemuGuestAgent) QgaCommand(cmd *monitor.Command) ([]byte, error)
- func (qga *QemuGuestAgent) TryLock(timeout time.Duration) bool
- func (qga *QemuGuestAgent) Unlock()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GuestCommand ¶
type GuestExecStatus ¶
type GuestExecStatus struct { Exited bool Exitcode int Signal int OutData string `json:"out-data"` ErrData string `json:"err-data"` OutTruncated bool `json:"out-truncated"` ErrTruncated bool `json:"err-truncated"` }
## # @GuestExecStatus: # # @exited: true if process has already terminated. # @exitcode: process exit code if it was normally terminated. # @signal: signal number (linux) or unhandled exception code # (windows) if the process was abnormally terminated. # @out-data: base64-encoded stdout of the process # @err-data: base64-encoded stderr of the process # Note: @out-data and @err-data are present only # if 'capture-output' was specified for 'guest-exec' # @out-truncated: true if stdout was not fully captured # due to size limitation. # @err-truncated: true if stderr was not fully captured # due to size limitation. # # Since: 2.5 ## { 'struct': 'GuestExecStatus',
'data': { 'exited': 'bool', '*exitcode': 'int', '*signal': 'int', '*out-data': 'str', '*err-data': 'str', '*out-truncated': 'bool', '*err-truncated': 'bool' }}
type GuestInfo ¶
type GuestInfo struct { Version string `json:"version"` SupportedCommands []GuestCommand `json:"supported_commands"` }
type QemuGuestAgent ¶
type QemuGuestAgent struct {
// contains filtered or unexported fields
}
func NewQemuGuestAgent ¶
func NewQemuGuestAgent(id, qgaSocketPath string) (*QemuGuestAgent, error)
func (*QemuGuestAgent) Close ¶
func (qga *QemuGuestAgent) Close() error
func (*QemuGuestAgent) GuestExecCommand ¶
func (*QemuGuestAgent) GuestExecStatusCommand ¶
func (qga *QemuGuestAgent) GuestExecStatusCommand(pid int) (*GuestExecStatus, error)
func (*QemuGuestAgent) GuestInfo ¶
func (qga *QemuGuestAgent) GuestInfo() (*GuestInfo, error)
func (*QemuGuestAgent) GuestPing ¶
func (qga *QemuGuestAgent) GuestPing() error
func (*QemuGuestAgent) GuestSetUserPassword ¶
func (qga *QemuGuestAgent) GuestSetUserPassword(username, password string, crypted bool) error
# @username: the user account whose password to change # @password: the new password entry string, base64 encoded # @crypted: true if password is already crypt()d, false if raw # # If the @crypted flag is true, it is the caller's responsibility # to ensure the correct crypt() encryption scheme is used. This # command does not attempt to interpret or report on the encryption # scheme. Refer to the documentation of the guest operating system # in question to determine what is supported. # # Not all guest operating systems will support use of the # @crypted flag, as they may require the clear-text password # # The @password parameter must always be base64 encoded before # transmission, even if already crypt()d, to ensure it is 8-bit # safe when passed as JSON. # # Returns: Nothing on success. # # Since: 2.3
func (*QemuGuestAgent) Lock ¶
func (qga *QemuGuestAgent) Lock()
Lock before execute qemu guest agent commands
func (*QemuGuestAgent) QgaCommand ¶
func (qga *QemuGuestAgent) QgaCommand(cmd *monitor.Command) ([]byte, error)
func (*QemuGuestAgent) TryLock ¶
func (qga *QemuGuestAgent) TryLock(timeout time.Duration) bool
Lock before execute qemu guest agent commands
func (*QemuGuestAgent) Unlock ¶
func (qga *QemuGuestAgent) Unlock()
Unlock after execute qemu guest agent commands