Skip to content
  • Daniel P. Berrangé's avatar
    e046fb44
    char: fix handling of QIO_CHANNEL_ERR_BLOCK · e046fb44
    Daniel P. Berrangé authored
    
    
    If io_channel_send_full gets QIO_CHANNEL_ERR_BLOCK it
    and has already sent some of the data, it should return
    that amount of data, not EAGAIN, as that would cause
    the caller to re-try already sent data.
    
    Unfortunately due to a previous rebase conflict resolution
    error, the code for dealing with this was in the wrong
    part of the conditional, and so mistakenly ran on other
    I/O errors.
    
    This be seen running
    
       qemu-system-x86_64 -monitor stdio
    
    and entering 'info mtree', when running on a slow console
    (eg a slow remote ssh session). The monitor would get into
    an indefinite loop writing the same data until it managed
    to send it all without getting EAGAIN.
    
    Reported-by: default avatarIgor Mammedov <imammedo@redhat.com>
    Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
    Message-Id: <1455288410-27046-1-git-send-email-berrange@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    e046fb44
    char: fix handling of QIO_CHANNEL_ERR_BLOCK
    Daniel P. Berrangé authored
    
    
    If io_channel_send_full gets QIO_CHANNEL_ERR_BLOCK it
    and has already sent some of the data, it should return
    that amount of data, not EAGAIN, as that would cause
    the caller to re-try already sent data.
    
    Unfortunately due to a previous rebase conflict resolution
    error, the code for dealing with this was in the wrong
    part of the conditional, and so mistakenly ran on other
    I/O errors.
    
    This be seen running
    
       qemu-system-x86_64 -monitor stdio
    
    and entering 'info mtree', when running on a slow console
    (eg a slow remote ssh session). The monitor would get into
    an indefinite loop writing the same data until it managed
    to send it all without getting EAGAIN.
    
    Reported-by: default avatarIgor Mammedov <imammedo@redhat.com>
    Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
    Message-Id: <1455288410-27046-1-git-send-email-berrange@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading