Skip to content
  • John Snow's avatar
    39cf73c3
    python/qemu/qmp.py: Fix settimeout operation · 39cf73c3
    John Snow authored
    
    
    We enabled callers to interface directly with settimeout, but this
    reacts poorly with blocking/nonblocking operation; as they are using the
    same internal mechanism.
    
    1. Whenever we change the blocking mechanism temporarily, always set it
    back to what it was afterwards.
    
    2. Disallow callers from setting a timeout of "0", which means
    Non-blocking mode. This is going to create more weird problems than
    anybody wants, so just forbid it.
    
    I opt not to coerce '0' to 'None' to maintain the principal of least
    surprise in mirroring the semantics of Python's interface.
    
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Message-id: 20201009175123.249009-4-jsnow@redhat.com
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
    39cf73c3
    python/qemu/qmp.py: Fix settimeout operation
    John Snow authored
    
    
    We enabled callers to interface directly with settimeout, but this
    reacts poorly with blocking/nonblocking operation; as they are using the
    same internal mechanism.
    
    1. Whenever we change the blocking mechanism temporarily, always set it
    back to what it was afterwards.
    
    2. Disallow callers from setting a timeout of "0", which means
    Non-blocking mode. This is going to create more weird problems than
    anybody wants, so just forbid it.
    
    I opt not to coerce '0' to 'None' to maintain the principal of least
    surprise in mirroring the semantics of Python's interface.
    
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Message-id: 20201009175123.249009-4-jsnow@redhat.com
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
Loading