Skip to content
  • Peter Xu's avatar
    02130314
    qmp: introduce QMPCapability · 02130314
    Peter Xu authored
    
    
    There were no QMP capabilities defined.  Define the first capability,
    "oob", to allow out-of-band messages.
    
    After this patch, we will allow QMP clients to enable QMP capabilities
    when sending the first "qmp_capabilities" command.  Originally we are
    starting QMP session with no arguments like:
    
      { "execute": "qmp_capabilities" }
    
    Now we can enable some QMP capabilities using (take OOB as example,
    which is the only capability that we support):
    
      { "execute": "qmp_capabilities",
        "arguments": { "enable": [ "oob" ] } }
    
    When the "arguments" key is not provided, no capability is enabled.
    
    For capability "oob", the monitor needs to be run on a dedicated IO
    thread, otherwise the command will fail.  For example, trying to enable
    OOB on a MUXed typed QMP monitor will fail.
    
    One thing to mention is that QMP capabilities are per-monitor, and also
    when the connection is closed due to some reason, the capabilities will
    be reset.
    
    Also, touch up qmp-test.c to test the new bits.
    
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Message-Id: <20180309090006.10018-11-peterx@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    [eblake: touch up commit message]
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    02130314
    qmp: introduce QMPCapability
    Peter Xu authored
    
    
    There were no QMP capabilities defined.  Define the first capability,
    "oob", to allow out-of-band messages.
    
    After this patch, we will allow QMP clients to enable QMP capabilities
    when sending the first "qmp_capabilities" command.  Originally we are
    starting QMP session with no arguments like:
    
      { "execute": "qmp_capabilities" }
    
    Now we can enable some QMP capabilities using (take OOB as example,
    which is the only capability that we support):
    
      { "execute": "qmp_capabilities",
        "arguments": { "enable": [ "oob" ] } }
    
    When the "arguments" key is not provided, no capability is enabled.
    
    For capability "oob", the monitor needs to be run on a dedicated IO
    thread, otherwise the command will fail.  For example, trying to enable
    OOB on a MUXed typed QMP monitor will fail.
    
    One thing to mention is that QMP capabilities are per-monitor, and also
    when the connection is closed due to some reason, the capabilities will
    be reset.
    
    Also, touch up qmp-test.c to test the new bits.
    
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Message-Id: <20180309090006.10018-11-peterx@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    [eblake: touch up commit message]
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
Loading