qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 666a3a: io: add abstract QIOChannel classes


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 666a3a: io: add abstract QIOChannel classes
Date: Fri, 18 Dec 2015 05:30:04 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 666a3af9c858c22d254e545de3ffc3fb197a3187
      
https://github.com/qemu/qemu/commit/666a3af9c858c22d254e545de3ffc3fb197a3187
  Author: Daniel P. Berrange <address@hidden>
  Date:   2015-12-18 (Fri, 18 Dec 2015)

  Changed paths:
    M MAINTAINERS
    M Makefile
    M Makefile.objs
    M Makefile.target
    A include/io/channel.h
    A io/Makefile.objs
    A io/channel.c

  Log Message:
  -----------
  io: add abstract QIOChannel classes

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: Daniel P. Berrange <address@hidden>


  Commit: 1c809fa01df0c638417480dfd446415615bfd217
      
https://github.com/qemu/qemu/commit/1c809fa01df0c638417480dfd446415615bfd217
  Author: Daniel P. Berrange <address@hidden>
  Date:   2015-12-18 (Fri, 18 Dec 2015)

  Changed paths:
    A include/io/channel-watch.h
    M io/Makefile.objs
    A io/channel-watch.c

  Log Message:
  -----------
  io: add helper module for creating watches on FDs

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: Daniel P. Berrange <address@hidden>


  Commit: b02db2d9203ccfd1c26e55f7d975f0c05caee0ce
      
https://github.com/qemu/qemu/commit/b02db2d9203ccfd1c26e55f7d975f0c05caee0ce
  Author: Daniel P. Berrange <address@hidden>
  Date:   2015-12-18 (Fri, 18 Dec 2015)

  Changed paths:
    A include/io/task.h
    M io/Makefile.objs
    A io/task.c
    M tests/.gitignore
    M tests/Makefile
    A tests/test-io-task.c
    M trace-events

  Log Message:
  -----------
  io: add QIOTask class for async operations

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: Daniel P. Berrange <address@hidden>


  Commit: 559607ea173a0003efda7f884bec73b242f923fb
      
https://github.com/qemu/qemu/commit/559607ea173a0003efda7f884bec73b242f923fb
  Author: Daniel P. Berrange <address@hidden>
  Date:   2015-12-18 (Fri, 18 Dec 2015)

  Changed paths:
    M configure
    A include/io/channel-socket.h
    M include/qemu/sockets.h
    M io/Makefile.objs
    A io/channel-socket.c
    M scripts/create_config
    M tests/.gitignore
    M tests/Makefile
    A tests/io-channel-helpers.c
    A tests/io-channel-helpers.h
    A tests/test-io-channel-socket.c
    M trace-events
    M util/qemu-sockets.c

  Log Message:
  -----------
  io: add QIOChannelSocket class

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: Daniel P. Berrange <address@hidden>


  Commit: d6e48869a41b61bb2f4eb0a787c08225630feb9e
      
https://github.com/qemu/qemu/commit/d6e48869a41b61bb2f4eb0a787c08225630feb9e
  Author: Daniel P. Berrange <address@hidden>
  Date:   2015-12-18 (Fri, 18 Dec 2015)

  Changed paths:
    A include/io/channel-file.h
    M io/Makefile.objs
    A io/channel-file.c
    M tests/.gitignore
    M tests/Makefile
    A tests/test-io-channel-file.c
    M trace-events

  Log Message:
  -----------
  io: add QIOChannelFile class

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: Daniel P. Berrange <address@hidden>


  Commit: ed8ee42c4063809495d9eed738a26957b6dfe692
      
https://github.com/qemu/qemu/commit/ed8ee42c4063809495d9eed738a26957b6dfe692
  Author: Daniel P. Berrange <address@hidden>
  Date:   2015-12-18 (Fri, 18 Dec 2015)

  Changed paths:
    A include/io/channel-tls.h
    M io/Makefile.objs
    A io/channel-tls.c
    M tests/.gitignore
    M tests/Makefile
    A tests/test-io-channel-tls.c
    M trace-events

  Log Message:
  -----------
  io: add QIOChannelTLS class

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: Daniel P. Berrange <address@hidden>


  Commit: 2d1d0e70cf3eadca967427e71b2c5c7d031bc5c8
      
https://github.com/qemu/qemu/commit/2d1d0e70cf3eadca967427e71b2c5c7d031bc5c8
  Author: Daniel P. Berrange <address@hidden>
  Date:   2015-12-18 (Fri, 18 Dec 2015)

  Changed paths:
    A include/io/channel-websock.h
    M io/Makefile.objs
    A io/channel-websock.c
    M trace-events

  Log Message:
  -----------
  io: add QIOChannelWebsock class

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: Daniel P. Berrange <address@hidden>


  Commit: 195e14d0262c5676cb9ff4b253e4b2b15c19d3f0
      
https://github.com/qemu/qemu/commit/195e14d0262c5676cb9ff4b253e4b2b15c19d3f0
  Author: Daniel P. Berrange <address@hidden>
  Date:   2015-12-18 (Fri, 18 Dec 2015)

  Changed paths:
    A include/io/channel-command.h
    M io/Makefile.objs
    A io/channel-command.c
    M tests/.gitignore
    M tests/Makefile
    A tests/test-io-channel-command.c
    M trace-events

  Log Message:
  -----------
  io: add QIOChannelCommand class

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: Daniel P. Berrange <address@hidden>


  Commit: d98e4eb7de93290f7921b0dbe869c7dd3c567945
      
https://github.com/qemu/qemu/commit/d98e4eb7de93290f7921b0dbe869c7dd3c567945
  Author: Daniel P. Berrange <address@hidden>
  Date:   2015-12-18 (Fri, 18 Dec 2015)

  Changed paths:
    A include/io/channel-buffer.h
    M io/Makefile.objs
    A io/channel-buffer.c
    M tests/.gitignore
    M tests/Makefile
    A tests/test-io-channel-buffer.c

  Log Message:
  -----------
  io: add QIOChannelBuffer class

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: Daniel P. Berrange <address@hidden>


  Commit: 67a708406221f476c0f8fa60c192c186150c5185
      
https://github.com/qemu/qemu/commit/67a708406221f476c0f8fa60c192c186150c5185
  Author: Peter Maydell <address@hidden>
  Date:   2015-12-18 (Fri, 18 Dec 2015)

  Changed paths:
    M MAINTAINERS
    M Makefile
    M Makefile.objs
    M Makefile.target
    M configure
    A include/io/channel-buffer.h
    A include/io/channel-command.h
    A include/io/channel-file.h
    A include/io/channel-socket.h
    A include/io/channel-tls.h
    A include/io/channel-watch.h
    A include/io/channel-websock.h
    A include/io/channel.h
    A include/io/task.h
    M include/qemu/sockets.h
    A io/Makefile.objs
    A io/channel-buffer.c
    A io/channel-command.c
    A io/channel-file.c
    A io/channel-socket.c
    A io/channel-tls.c
    A io/channel-watch.c
    A io/channel-websock.c
    A io/channel.c
    A io/task.c
    M scripts/create_config
    M tests/.gitignore
    M tests/Makefile
    A tests/io-channel-helpers.c
    A tests/io-channel-helpers.h
    A tests/test-io-channel-buffer.c
    A tests/test-io-channel-command.c
    A tests/test-io-channel-file.c
    A tests/test-io-channel-socket.c
    A tests/test-io-channel-tls.c
    A tests/test-io-task.c
    M trace-events
    M util/qemu-sockets.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/berrange/tags/pull-io-channel-base-2015-12-18-1' into staging

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 <address@hidden>"
# gpg:                 aka "Daniel P. Berrange <address@hidden>"

* 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: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/6a6533213d78...67a708406221

reply via email to

[Prev in Thread] Current Thread [Next in Thread]