Skip to content
Snippets Groups Projects
  1. Dec 18, 2015
    • Peter Maydell's avatar
      configure: Fix shell syntax to placate OpenBSD's pdksh · 18f49881
      Peter Maydell authored
      Unfortunately the OpenBSD pdksh does not like brackets inside
      the right part of a ${variable+word} parameter expansion:
      
        $ echo "${a+($b)}"
        ksh: ${a+($b)}": bad substitution
      
      though both bash and dash accept them. In any case this line
      was causing odd output in the case where nettle is not present:
        nettle    no ()
      
      (because if nettle is not present then $nettle will be "no",
      not a null string or unset).
      
      Rewrite it to just use an if.
      
      This bug was originally introduced in becaeb72 and was present
      in the 2.4.0 release.
      
      Fixes: https://bugs.launchpad.net/qemu/+bug/1525682
      
      
      Reported-by: Dmitrij D. Czarkoff
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Message-id: 1450105357-8516-1-git-send-email-peter.maydell@linaro.org
      18f49881
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/berrange/tags/pull-io-channel-base-2015-12-18-1' into staging · 67a70840
      Peter Maydell authored
      
      Merge I/O channels base classes
      
      # gpg: Signature made Fri 18 Dec 2015 12:18:38 GMT using RSA key ID 15104FDF
      # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>"
      # gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>"
      
      * remotes/berrange/tags/pull-io-channel-base-2015-12-18-1:
        io: add QIOChannelBuffer class
        io: add QIOChannelCommand class
        io: add QIOChannelWebsock class
        io: add QIOChannelTLS class
        io: add QIOChannelFile class
        io: add QIOChannelSocket class
        io: add QIOTask class for async operations
        io: add helper module for creating watches on FDs
        io: add abstract QIOChannel classes
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      67a70840
    • 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
  2. Dec 17, 2015
Loading