Skip to content
Snippets Groups Projects
  1. Mar 13, 2018
  2. Mar 06, 2018
  3. Mar 02, 2018
  4. Feb 15, 2018
  5. Feb 09, 2018
  6. Dec 15, 2017
  7. Oct 16, 2017
  8. Oct 04, 2017
  9. Sep 06, 2017
    • Eric Blake's avatar
      io: Add new qio_channel_read{, v}_all_eof functions · e8ffaa31
      Eric Blake authored
      
      Some callers want to distinguish between clean EOF (no bytes read)
      vs. a short read (at least one byte read, but EOF encountered
      before reaching the desired length), as it allows clients the
      ability to do a graceful shutdown when a server shuts down at
      defined safe points in the protocol, rather than treating all
      shutdown scenarios as an error due to EOF.  However, we don't want
      to require all callers to have to check for early EOF.  So add
      another wrapper function that can be used by the callers that care
      about the distinction.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20170905191114.5959-3-eblake@redhat.com>
      Acked-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      e8ffaa31
    • Eric Blake's avatar
      io: Yield rather than wait when already in coroutine · 9ffb8270
      Eric Blake authored
      
      The new qio_channel_{read,write}{,v}_all functions are documented
      as yielding until data is available.  When used on a blocking
      channel, this yield is done via qio_channel_wait() which spawns
      a nested event loop under the hood (so it is that secondary loop
      which yields as needed); but if we are already in a coroutine (at
      which point QIO_CHANNEL_ERR_BLOCK is only possible if we are a
      non-blocking channel), we want to yield the current coroutine
      instead of spawning a nested event loop.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20170905191114.5959-2-eblake@redhat.com>
      Acked-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      [commit message updated]
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      9ffb8270
  10. Sep 05, 2017
  11. Aug 02, 2017
    • Peter Xu's avatar
      io: fix qio_channel_socket_accept err handling · 8bd9c4e6
      Peter Xu authored
      
      When accept failed, we should setup errp with the reason. More
      importantly, the caller may assume errp be non-NULL when error happens,
      and not setting the errp may crash QEMU.
      
      At the same time, move the trace_qio_channel_socket_accept_fail() after
      the if check on EINTR. Two reasons:
      
      1. when EINTR happened, it's not really a fault (we should just try
         again), so we should not log with an "accept failure".
      
      2. trace_*() functions may overwrite errno, then the old errno will be
         missing. We need to either check errno before trace_*() calls, or
         reserve the errno.
      
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Message-Id: <1501666880-10159-3-git-send-email-peterx@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      8bd9c4e6
Loading