mbox

[PULL,v2,0/9] Introduce I/O channels framework

Message ID 1450366809-9800-1-git-send-email-berrange@redhat.com
State New
Headers show

Pull-request

git://github.com/berrange/qemu tags/pull-io-channel-base-2015-12-17-2

Message

Daniel P. Berrangé Dec. 17, 2015, 3:40 p.m. UTC
The following changes since commit e5fbe28e5424d26fc2c25d0a7ecb927d3c80d5e8:

  Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20151217-1' into staging (2015-12-17 13:38:34 +0000)

are available in the git repository at:

  git://github.com/berrange/qemu tags/pull-io-channel-base-2015-12-17-2

for you to fetch changes up to 65499bafaf39b75c9787ef39fffeb3ff9fe48424:

  io: add QIOChannelBuffer class (2015-12-17 15:28:33 +0000)

----------------------------------------------------------------
Merge I/O channels base classes

----------------------------------------------------------------
Daniel P. Berrange (9):
      io: add abstract QIOChannel classes
      io: add helper module for creating watches on FDs
      io: add QIOTask class for async operations
      io: add QIOChannelSocket class
      io: add QIOChannelFile class
      io: add QIOChannelTLS class
      io: add QIOChannelWebsock class
      io: add QIOChannelCommand class
      io: add QIOChannelBuffer class

 MAINTAINERS                     |   7 +
 Makefile                        |   2 +
 Makefile.objs                   |   5 +
 Makefile.target                 |   2 +
 configure                       |  11 +
 include/io/channel-buffer.h     |  60 +++
 include/io/channel-command.h    |  91 ++++
 include/io/channel-file.h       |  93 ++++
 include/io/channel-socket.h     | 244 ++++++++++
 include/io/channel-tls.h        | 142 ++++++
 include/io/channel-watch.h      |  72 +++
 include/io/channel-websock.h    | 108 +++++
 include/io/channel.h            | 502 +++++++++++++++++++++
 include/io/task.h               | 256 +++++++++++
 include/qemu/sockets.h          |  19 +
 io/Makefile.objs                |   9 +
 io/channel-buffer.c             | 249 +++++++++++
 io/channel-command.c            | 357 +++++++++++++++
 io/channel-file.c               | 225 ++++++++++
 io/channel-socket.c             | 741 +++++++++++++++++++++++++++++++
 io/channel-tls.c                | 393 ++++++++++++++++
 io/channel-watch.c              | 200 +++++++++
 io/channel-websock.c            | 963 ++++++++++++++++++++++++++++++++++++++++
 io/channel.c                    | 291 ++++++++++++
 io/task.c                       | 159 +++++++
 scripts/create_config           |   9 +
 tests/.gitignore                |   8 +
 tests/Makefile                  |  19 +
 tests/io-channel-helpers.c      | 246 ++++++++++
 tests/io-channel-helpers.h      |  42 ++
 tests/test-io-channel-buffer.c  |  50 +++
 tests/test-io-channel-command.c | 129 ++++++
 tests/test-io-channel-file.c    | 100 +++++
 tests/test-io-channel-socket.c  | 399 +++++++++++++++++
 tests/test-io-channel-tls.c     | 342 ++++++++++++++
 tests/test-io-task.c            | 276 ++++++++++++
 trace-events                    |  56 +++
 util/qemu-sockets.c             |   2 +-
 38 files changed, 6878 insertions(+), 1 deletion(-)
 create mode 100644 include/io/channel-buffer.h
 create mode 100644 include/io/channel-command.h
 create mode 100644 include/io/channel-file.h
 create mode 100644 include/io/channel-socket.h
 create mode 100644 include/io/channel-tls.h
 create mode 100644 include/io/channel-watch.h
 create mode 100644 include/io/channel-websock.h
 create mode 100644 include/io/channel.h
 create mode 100644 include/io/task.h
 create mode 100644 io/Makefile.objs
 create mode 100644 io/channel-buffer.c
 create mode 100644 io/channel-command.c
 create mode 100644 io/channel-file.c
 create mode 100644 io/channel-socket.c
 create mode 100644 io/channel-tls.c
 create mode 100644 io/channel-watch.c
 create mode 100644 io/channel-websock.c
 create mode 100644 io/channel.c
 create mode 100644 io/task.c
 create mode 100644 tests/io-channel-helpers.c
 create mode 100644 tests/io-channel-helpers.h
 create mode 100644 tests/test-io-channel-buffer.c
 create mode 100644 tests/test-io-channel-command.c
 create mode 100644 tests/test-io-channel-file.c
 create mode 100644 tests/test-io-channel-socket.c
 create mode 100644 tests/test-io-channel-tls.c
 create mode 100644 tests/test-io-task.c

Daniel P. Berrange (9):
  io: add abstract QIOChannel classes
  io: add helper module for creating watches on FDs
  io: add QIOTask class for async operations
  io: add QIOChannelSocket class
  io: add QIOChannelFile class
  io: add QIOChannelTLS class
  io: add QIOChannelWebsock class
  io: add QIOChannelCommand class
  io: add QIOChannelBuffer class

 MAINTAINERS                     |   7 +
 Makefile                        |   2 +
 Makefile.objs                   |   5 +
 Makefile.target                 |   2 +
 configure                       |  11 +
 include/io/channel-buffer.h     |  60 +++
 include/io/channel-command.h    |  91 ++++
 include/io/channel-file.h       |  93 ++++
 include/io/channel-socket.h     | 244 ++++++++++
 include/io/channel-tls.h        | 142 ++++++
 include/io/channel-watch.h      |  72 +++
 include/io/channel-websock.h    | 108 +++++
 include/io/channel.h            | 502 +++++++++++++++++++++
 include/io/task.h               | 256 +++++++++++
 include/qemu/sockets.h          |  19 +
 io/Makefile.objs                |   9 +
 io/channel-buffer.c             | 249 +++++++++++
 io/channel-command.c            | 357 +++++++++++++++
 io/channel-file.c               | 225 ++++++++++
 io/channel-socket.c             | 741 +++++++++++++++++++++++++++++++
 io/channel-tls.c                | 393 ++++++++++++++++
 io/channel-watch.c              | 200 +++++++++
 io/channel-websock.c            | 963 ++++++++++++++++++++++++++++++++++++++++
 io/channel.c                    | 291 ++++++++++++
 io/task.c                       | 159 +++++++
 scripts/create_config           |   9 +
 tests/.gitignore                |   8 +
 tests/Makefile                  |  19 +
 tests/io-channel-helpers.c      | 246 ++++++++++
 tests/io-channel-helpers.h      |  42 ++
 tests/test-io-channel-buffer.c  |  50 +++
 tests/test-io-channel-command.c | 129 ++++++
 tests/test-io-channel-file.c    | 100 +++++
 tests/test-io-channel-socket.c  | 399 +++++++++++++++++
 tests/test-io-channel-tls.c     | 342 ++++++++++++++
 tests/test-io-task.c            | 276 ++++++++++++
 trace-events                    |  56 +++
 util/qemu-sockets.c             |   2 +-
 38 files changed, 6878 insertions(+), 1 deletion(-)
 create mode 100644 include/io/channel-buffer.h
 create mode 100644 include/io/channel-command.h
 create mode 100644 include/io/channel-file.h
 create mode 100644 include/io/channel-socket.h
 create mode 100644 include/io/channel-tls.h
 create mode 100644 include/io/channel-watch.h
 create mode 100644 include/io/channel-websock.h
 create mode 100644 include/io/channel.h
 create mode 100644 include/io/task.h
 create mode 100644 io/Makefile.objs
 create mode 100644 io/channel-buffer.c
 create mode 100644 io/channel-command.c
 create mode 100644 io/channel-file.c
 create mode 100644 io/channel-socket.c
 create mode 100644 io/channel-tls.c
 create mode 100644 io/channel-watch.c
 create mode 100644 io/channel-websock.c
 create mode 100644 io/channel.c
 create mode 100644 io/task.c
 create mode 100644 tests/io-channel-helpers.c
 create mode 100644 tests/io-channel-helpers.h
 create mode 100644 tests/test-io-channel-buffer.c
 create mode 100644 tests/test-io-channel-command.c
 create mode 100644 tests/test-io-channel-file.c
 create mode 100644 tests/test-io-channel-socket.c
 create mode 100644 tests/test-io-channel-tls.c
 create mode 100644 tests/test-io-task.c

Comments

Peter Maydell Dec. 17, 2015, 4:40 p.m. UTC | #1
On 17 December 2015 at 15:40, Daniel P. Berrange <berrange@redhat.com> wrote:
> The following changes since commit e5fbe28e5424d26fc2c25d0a7ecb927d3c80d5e8:
>
>   Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20151217-1' into staging (2015-12-17 13:38:34 +0000)
>
> are available in the git repository at:
>
>   git://github.com/berrange/qemu tags/pull-io-channel-base-2015-12-17-2
>
> for you to fetch changes up to 65499bafaf39b75c9787ef39fffeb3ff9fe48424:
>
>   io: add QIOChannelBuffer class (2015-12-17 15:28:33 +0000)
>
> ----------------------------------------------------------------
> Merge I/O channels base classes
>
> ----------------------------------------------------------------
> Daniel P. Berrange (9):
>       io: add abstract QIOChannel classes
>       io: add helper module for creating watches on FDs
>       io: add QIOTask class for async operations
>       io: add QIOChannelSocket class
>       io: add QIOChannelFile class
>       io: add QIOChannelTLS class
>       io: add QIOChannelWebsock class
>       io: add QIOChannelCommand class
>       io: add QIOChannelBuffer class

Still fails on OSX I'm afraid:

/Users/pm215/src/qemu-for-merges/io/channel-buffer.c:211:5: warning:
implicit declaration of function 'g_source_set_name' is invalid
 in C99 [-Wimplicit-function-declaration]
    g_source_set_name(source, "QIOChannelBuffer");
    ^

/Users/pm215/src/qemu-for-merges/io/channel-file.c:164:11: warning:
implicit declaration of function 'lseek64' is invalid in C99 [-W
implicit-function-declaration]
    ret = lseek64(fioc->fd, offset, whence);
          ^

/Users/pm215/src/qemu-for-merges/io/channel-watch.c:155:5: warning:
implicit declaration of function 'g_source_set_name' is invalid in C99
[-Wimplicit-function-declaration]
    g_source_set_name(source, "QIOChannelFD");
    ^

/Users/pm215/src/qemu-for-merges/io/channel-websock.c:923:5: warning:
implicit declaration of function 'g_source_set_name' is invalid in C99
[-Wimplicit-function-declaration]
    g_source_set_name(source, "QIOChannelWebsock");
    ^
  CC    iothread.o

(and then the link fails because those functions aren't present).

Glib's g_source_set_name was only introduced in 2.26,
and we have to support 2.22.

lseek64 doesn't exist on OSX.

thanks
-- PMM
Paolo Bonzini Dec. 17, 2015, 4:44 p.m. UTC | #2
On 17/12/2015 17:40, Peter Maydell wrote:
> Glib's g_source_set_name was only introduced in 2.26,
> and we have to support 2.22.
> 
> lseek64 doesn't exist on OSX.

And unnecessary on Linux too, since we compile with
-D_LARGEFILE_SOURCE/-D_FILE_OFFSET_BITS=64.

Paolo
Daniel P. Berrangé Dec. 17, 2015, 4:47 p.m. UTC | #3
On Thu, Dec 17, 2015 at 04:40:47PM +0000, Peter Maydell wrote:
> On 17 December 2015 at 15:40, Daniel P. Berrange <berrange@redhat.com> wrote:
> > The following changes since commit e5fbe28e5424d26fc2c25d0a7ecb927d3c80d5e8:
> >
> >   Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20151217-1' into staging (2015-12-17 13:38:34 +0000)
> >
> > are available in the git repository at:
> >
> >   git://github.com/berrange/qemu tags/pull-io-channel-base-2015-12-17-2
> >
> > for you to fetch changes up to 65499bafaf39b75c9787ef39fffeb3ff9fe48424:
> >
> >   io: add QIOChannelBuffer class (2015-12-17 15:28:33 +0000)
> >
> > ----------------------------------------------------------------
> > Merge I/O channels base classes
> >
> > ----------------------------------------------------------------
> > Daniel P. Berrange (9):
> >       io: add abstract QIOChannel classes
> >       io: add helper module for creating watches on FDs
> >       io: add QIOTask class for async operations
> >       io: add QIOChannelSocket class
> >       io: add QIOChannelFile class
> >       io: add QIOChannelTLS class
> >       io: add QIOChannelWebsock class
> >       io: add QIOChannelCommand class
> >       io: add QIOChannelBuffer class
> 
> Still fails on OSX I'm afraid:
> 
> /Users/pm215/src/qemu-for-merges/io/channel-buffer.c:211:5: warning:
> implicit declaration of function 'g_source_set_name' is invalid
>  in C99 [-Wimplicit-function-declaration]
>     g_source_set_name(source, "QIOChannelBuffer");
>     ^
> 
> /Users/pm215/src/qemu-for-merges/io/channel-file.c:164:11: warning:
> implicit declaration of function 'lseek64' is invalid in C99 [-W
> implicit-function-declaration]
>     ret = lseek64(fioc->fd, offset, whence);
>           ^
> 
> /Users/pm215/src/qemu-for-merges/io/channel-watch.c:155:5: warning:
> implicit declaration of function 'g_source_set_name' is invalid in C99
> [-Wimplicit-function-declaration]
>     g_source_set_name(source, "QIOChannelFD");
>     ^
> 
> /Users/pm215/src/qemu-for-merges/io/channel-websock.c:923:5: warning:
> implicit declaration of function 'g_source_set_name' is invalid in C99
> [-Wimplicit-function-declaration]
>     g_source_set_name(source, "QIOChannelWebsock");
>     ^
>   CC    iothread.o
> 
> (and then the link fails because those functions aren't present).
> 
> Glib's g_source_set_name was only introduced in 2.26,
> and we have to support 2.22.

Yep, that's no big deal. g_source_set_name is only there as
a debugging aid, it has no functional benefit so I can remove
these calls.

> lseek64 doesn't exist on OSX.

Ok.

Regards,
Daniel
Paolo Bonzini Dec. 17, 2015, 6:32 p.m. UTC | #4
On 17/12/2015 17:47, Daniel P. Berrange wrote:
>> > Glib's g_source_set_name was only introduced in 2.26,
>> > and we have to support 2.22.
> Yep, that's no big deal. g_source_set_name is only there as
> a debugging aid, it has no functional benefit so I can remove
> these calls.

Or add it to glib-compat?

Paolo