Skip to content
Snippets Groups Projects
  1. May 26, 2016
  2. May 19, 2016
  3. Mar 22, 2016
    • Markus Armbruster's avatar
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster authored
      
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  4. Mar 10, 2016
  5. Feb 23, 2016
  6. Feb 15, 2016
  7. Feb 09, 2016
  8. Feb 04, 2016
    • Peter Maydell's avatar
      io: Clean up includes · cae9fc56
      Peter Maydell authored
      
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-14-git-send-email-peter.maydell@linaro.org
      cae9fc56
  9. Jan 20, 2016
  10. Jan 19, 2016
  11. Dec 23, 2015
    • Daniel P. Berrangé's avatar
      io: fix stack allocation when sending of file descriptors · 7b3c618a
      Daniel P. Berrangé authored
      
      When sending file descriptors over a socket, we have to
      allocate a data buffer to hold the FDs in the scmsghdr.
      Unfortunately we allocated the buffer on the stack inside
      an if () {} block, but called sendmsg() outside the block.
      So the stack bytes holding the FDs were liable to be
      overwritten with other data. By luck this was not a problem
      when sending 1 FD, but if sending 2 or more then it would
      fail.
      
      The fix is to simply move the variables outside the nested
      'if' block. To keep valgrind quiet we also zero-initialize
      the 'control' buffer.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      7b3c618a
  12. Dec 22, 2015
  13. Dec 18, 2015
    • Daniel P. Berrangé's avatar
      io: add QIOChannelBuffer class · d98e4eb7
      Daniel P. Berrangé authored
      
      Add a QIOChannel subclass that is capable of performing I/O
      to/from a memory buffer. This implementation does not attempt
      to support concurrent readers & writers. It is designed for
      serialized access where by a single thread at a time may write
      data, seek and then read data back out.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      d98e4eb7
    • Daniel P. Berrangé's avatar
      io: add QIOChannelCommand class · 195e14d0
      Daniel P. Berrangé authored
      
      Add a QIOChannel subclass that is capable of performing I/O
      to/from a separate process, via a pair of pipes. The command
      can be used for unidirectional or bi-directional I/O.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      195e14d0
    • Daniel P. Berrangé's avatar
      io: add QIOChannelWebsock class · 2d1d0e70
      Daniel P. Berrangé authored
      
      Add a QIOChannel subclass that can run the websocket protocol over
      the top of another QIOChannel instance. This initial implementation
      is only capable of acting as a websockets server. There is no support
      for acting as a websockets client yet.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      2d1d0e70
    • Daniel P. Berrangé's avatar
      io: add QIOChannelTLS class · ed8ee42c
      Daniel P. Berrangé authored
      
      Add a QIOChannel subclass that can run the TLS protocol over
      the top of another QIOChannel instance. The object provides a
      simplified API to perform the handshake when starting the TLS
      session. The layering of TLS over the underlying channel does
      not have to be setup immediately. It is possible to take an
      existing QIOChannel that has done some handshake and then swap
      in the QIOChannelTLS layer. This allows for use with protocols
      which start TLS right away, and those which start plain text
      and then negotiate TLS.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      ed8ee42c
    • Daniel P. Berrangé's avatar
      io: add QIOChannelFile class · d6e48869
      Daniel P. Berrangé authored
      
      Add a QIOChannel subclass that is capable of operating on things
      that are files, such as plain files, pipes, character/block
      devices, but notably not sockets.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      d6e48869
    • Daniel P. Berrangé's avatar
      io: add QIOChannelSocket class · 559607ea
      Daniel P. Berrangé authored
      
      Implement a QIOChannel subclass that supports sockets I/O.
      The implementation is able to manage a single socket file
      descriptor, whether a TCP/UNIX listener, TCP/UNIX connection,
      or a UDP datagram. It provides APIs which can listen and
      connect either asynchronously or synchronously. Since there
      is no asynchronous DNS lookup API available, it uses the
      QIOTask helper for spawning a background thread to ensure
      non-blocking operation.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      559607ea
    • Daniel P. Berrangé's avatar
      io: add QIOTask class for async operations · b02db2d9
      Daniel P. Berrangé authored
      
      A number of I/O operations need to be performed asynchronously
      to avoid blocking the main loop. The caller of such APIs need
      to provide a callback to be invoked on completion/error and
      need access to the error, if any. The small QIOTask provides
      a simple framework for dealing with such probes. The API
      docs inline provide an outline of how this is to be used.
      
      Some functions don't have the ability to run asynchronously
      (eg getaddrinfo always blocks), so to facilitate their use,
      the task class provides a mechanism to run a blocking
      function in a thread, while triggering the completion
      callback in the main event loop thread. This easily allows
      any synchronous function to be made asynchronous, albeit
      at the cost of spawning a thread.
      
      In this series, the QIOTask class will be used for things like
      the TLS handshake, the websockets handshake and TCP connect()
      progress.
      
      The concept of QIOTask is inspired by the GAsyncResult
      interface / GTask class in the GIO libraries. The min
      version requirements on glib don't allow those to be
      used from QEMU, so QIOTask provides a facsimilie which
      can be easily switched to GTask in the future if the
      min version is increased.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      b02db2d9
    • Daniel P. Berrangé's avatar
      io: add helper module for creating watches on FDs · 1c809fa0
      Daniel P. Berrangé authored
      
      A number of the channel implementations will require the
      ability to create watches on file descriptors / sockets.
      To avoid duplicating this code in each channel, provide a
      helper API for dealing with file descriptor watches.
      
      There are two watch implementations provided. The first
      is useful for bi-directional file descriptors such as
      sockets, regular files, character devices, etc. The
      second works with a pair of unidirectional file descriptors
      such as pipes.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      1c809fa0
    • Daniel P. Berrangé's avatar
      io: add abstract QIOChannel classes · 666a3af9
      Daniel P. Berrangé authored
      
      Start the new generic I/O channel framework by defining a
      QIOChannel abstract base class. This is designed to feel
      similar to GLib's GIOChannel, but with the addition of
      support for using iovecs, qemu error reporting, file
      descriptor passing, coroutine integration and use of
      the QOM framework for easier sub-classing.
      
      The intention is that anywhere in QEMU that almost
      anywhere that deals with sockets will use this new I/O
      infrastructure, so that it becomes trivial to then layer
      in support for TLS encryption. This will at least include
      the VNC server, char device backend and migration code.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      666a3af9
Loading