Merge pull request #40 from rbradford/qmp-caps-comment

qmp: Remind users that you must first call ExecuteQMPCapabilities()
This commit is contained in:
Sebastien Boeuf 2018-08-22 10:14:33 -07:00 committed by GitHub
commit 6aa35d33f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -561,6 +561,10 @@ func (q *QMP) executeCommand(ctx context.Context, name string, args map[string]i
// block until they have received a success or failure message from QMP,
// i.e., {"return": {}} or {"error":{}}, and in some cases certain events
// are received.
//
// QEMU currently requires that the "qmp_capabilties" command is sent before any
// other command. Therefore you must call qmp.ExecuteQMPCapabilities() before
// you execute any other command.
func QMPStart(ctx context.Context, socket string, cfg QMPConfig, disconnectedCh chan struct{}) (*QMP, *QMPVersion, error) {
if cfg.Logger == nil {
cfg.Logger = qmpNullLogger{}