1. 07 3月, 2009 3 次提交
    • A
      Add SASL authentication support ("Daniel P. Berrange") · 2f9606b3
      aliguori 提交于
      This patch adds the new SASL authentication protocol to the VNC server.
      
      It is enabled by setting the 'sasl' flag when launching VNC. SASL can
      optionally provide encryption via its SSF layer, if a suitable mechanism
      is configured (eg, GSSAPI/Kerberos, or Digest-MD5).  If an SSF layer is
      not available, then it should be combined with the x509 VNC authentication
      protocol which provides encryption.
      
      eg, if using GSSAPI
      
         qemu -vnc localhost:1,sasl
      
      eg if using  TLS/x509 for encryption
      
         qemu -vnc localhost:1,sasl,tls,x509
      
      
      By default the Cyrus SASL library will look for its configuration in
      the file /etc/sasl2/qemu.conf.  For non-root users, this can be overridden
      by setting the SASL_CONF_PATH environment variable, eg to make it look in
      $HOME/.sasl2.  NB unprivileged users may not have access to the full range
      of SASL mechanisms, since some of them require some administrative privileges
      to configure. The patch includes an example SASL configuration file which
      illustrates config for GSSAPI and Digest-MD5, though it should be noted that
      the latter is not really considered secure any more.
      
      Most of the SASL authentication code is located in a separate source file,
      vnc-auth-sasl.c.  The main vnc.c file only contains minimal integration
      glue, specifically parsing of command line flags / setup, and calls to
      start the SASL auth process, to do encoding/decoding for data.
      
      There are several possible stacks for reading & writing of data, depending
      on the combo of VNC authentication methods in use
      
       - Clear.    read/write straight to socket
       - TLS.      read/write via GNUTLS helpers
       - SASL.     encode/decode via SASL SSF layer, then read/write to socket
       - SASL+TLS. encode/decode via SASL SSF layer, then read/write via GNUTLS
      
      Hence, the vnc_client_read & vnc_client_write methods have been refactored
      a little.
      
         vnc_client_read:  main entry point for reading, calls either
      
             - vnc_client_read_plain   reading, with no intermediate decoding
             - vnc_client_read_sasl    reading, with SASL SSF decoding
      
         These two methods, then call vnc_client_read_buf(). This decides
         whether to write to the socket directly or write via GNUTLS.
      
      The situation is the same for writing data. More extensive comments
      have been added in the code / patch. The vnc_client_read_sasl and
      vnc_client_write_sasl method implementations live in the separate
      vnc-auth-sasl.c file.
      
      The state required for the SASL auth mechanism is kept in a separate
      VncStateSASL struct, defined in vnc-auth-sasl.h and included in the
      main VncState.
      
      The configure script probes for SASL and automatically enables it
      if found, unless --disable-vnc-sasl was given to override it.
      
      
       Makefile            |    7 
       Makefile.target     |    5 
       b/qemu.sasl         |   34 ++
       b/vnc-auth-sasl.c   |  626 ++++++++++++++++++++++++++++++++++++++++++++++++++++
       b/vnc-auth-sasl.h   |   67 +++++
       configure           |   34 ++
       qemu-doc.texi       |   97 ++++++++
       vnc-auth-vencrypt.c |   12 
       vnc.c               |  249 ++++++++++++++++++--
       vnc.h               |   31 ++
       10 files changed, 1129 insertions(+), 33 deletions(-)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6724 c046a42c-6fe2-441c-8c8c-71466251a162
      2f9606b3
    • A
      Move TLS auth into separate file ("Daniel P. Berrange") · 5fb6c7a8
      aliguori 提交于
      This patch refactors the existing TLS code to make the main VNC code
      more managable. The code moves to two new files
      
       - vnc-tls.c: generic helpers for TLS handshake & credential setup
       - vnc-auth-vencrypt.c: the actual VNC TLS authentication mechanism.
      
      The reason for this split is that there are other TLS based auth
      mechanisms which we may like to use in the future. These can all
      share the same vnc-tls.c routines. In addition this will facilitate
      anyone who may want to port the vnc-tls.c file to allow for choice
      of GNUTLS & NSS for impl.
      
      The TLS state is moved out of the VncState struct, and into a separate
      VncStateTLS struct, defined in vnc-tls.h. This is then referenced from
      the main VncState. End size of the struct is the same, but it keeps
      things a little more managable.
      
      The vnc.h file gains a bunch more function prototypes, for functions
      in vnc.c that were previously static, but now need to be accessed
      from the separate auth code files.
      
      The only TLS related code still in the main vl.c is the command line
      argument handling / setup, and the low level I/O routines calling
      gnutls_send/recv.
      
      
       Makefile              |   11 
       b/vnc-auth-vencrypt.c |  167 ++++++++++++++
       b/vnc-auth-vencrypt.h |   33 ++
       b/vnc-tls.c           |  414 +++++++++++++++++++++++++++++++++++
       b/vnc-tls.h           |   70 ++++++
       vnc.c                 |  581 +++-----------------------------------------------
       vnc.h                 |   76 ++++--
       7 files changed, 780 insertions(+), 572 deletions(-)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6723 c046a42c-6fe2-441c-8c8c-71466251a162
      5fb6c7a8
    • A
      Refactor keymap code to avoid duplication ("Daniel P. Berrange") · 0483755a
      aliguori 提交于
      Each of the graphical frontends #include a .c file, for keymap code
      resulting in duplicated definitions & duplicated compiled code. A
      couple of small changes allowed this to be sanitized, so instead of
      doing a #include "keymaps.c", duplicating all code, we can have a
      shared keymaps.h file, and only compile code once. This allows the
      next patch to move the VncState struct out into a header file without
      causing clashing definitions.
      
      
       Makefile      |    9 +++++---
       b/keymaps.h   |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       curses.c      |    3 --
       curses_keys.h |    9 +++-----
       keymaps.c     |   45 ++++++++++++++++---------------------------
       sdl.c         |    3 --
       sdl_keysym.h  |    7 ++----
       vnc.c         |    5 +---
       vnc_keysym.h  |    7 ++----
       9 files changed, 97 insertions(+), 51 deletions(-)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6721 c046a42c-6fe2-441c-8c8c-71466251a162
      0483755a
  2. 27 1月, 2009 1 次提交
  3. 23 1月, 2009 1 次提交
  4. 22 1月, 2009 5 次提交
  5. 09 1月, 2009 1 次提交
  6. 03 1月, 2009 1 次提交
  7. 16 12月, 2008 1 次提交
  8. 13 12月, 2008 1 次提交
    • A
      Replace posix-aio with custom thread pool · 3c529d93
      aliguori 提交于
      glibc implements posix-aio as a thread pool and imposes a number of limitations.
      
      1) it limits one request per-file descriptor.  we hack around this by dup()'ing
      file descriptors which is hideously ugly
      
      2) it's impossible to add new interfaces and we need a vectored read/write
      operation to properly support a zero-copy API.
      
      What has been suggested to me by glibc folks, is to implement whatever new
      interfaces we want and then it can eventually be proposed for standardization.
      This requires that we implement our own posix-aio implementation though.
      
      This patch implements posix-aio using pthreads.  It immediately eliminates the
      need for fd pooling.
      
      It performs at least as well as the current posix-aio code (in some
      circumstances, even better).
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5996 c046a42c-6fe2-441c-8c8c-71466251a162
      3c529d93
  9. 11 12月, 2008 1 次提交
  10. 07 12月, 2008 1 次提交
  11. 27 11月, 2008 1 次提交
  12. 23 11月, 2008 1 次提交
  13. 12 11月, 2008 2 次提交
  14. 09 10月, 2008 1 次提交
    • A
      Fix IO performance regression in sparc · 9e472e10
      aliguori 提交于
      Replace signalfd with signal handler/pipe.  There is no way to interrupt
      the CPU execution loop when a file descriptor becomes readable.  This
      results in a large performance regression in sparc emulation during
      bootup.
         
      This patch switches us to signal handler/pipe which was originally
      suggested by Ian Jackson.  The signal handler lets us interrupt the
      CPU emulation loop while the write to a pipe lets us avoid the
      select/signal race condition.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5451 c046a42c-6fe2-441c-8c8c-71466251a162
      9e472e10
  15. 02 10月, 2008 1 次提交
  16. 29 9月, 2008 7 次提交
  17. 24 9月, 2008 1 次提交
  18. 23 9月, 2008 1 次提交
    • A
      Refactor AIO to allow multiple AIO implementations · a76bab49
      aliguori 提交于
      This patch refactors the AIO layer to allow multiple AIO implementations.  It's
      only possible because of the recent signalfd() patch.  
      
      Right now, the AIO infrastructure is pretty specific to the block raw backend.
      For other block devices to implement AIO, the qemu_aio_wait function must
      support registration.  This patch introduces a new function,
      qemu_aio_set_fd_handler, which can be used to register a file descriptor to be
      called back.  qemu_aio_wait() now polls a set of file descriptors registered
      with this function until one becomes readable or writable.
      
      This patch should allow the implementation of alternative AIO backends (via a
      thread pool or linux-aio) and AIO backends in non-traditional block devices
      (like NBD).
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5297 c046a42c-6fe2-441c-8c8c-71466251a162
      a76bab49
  19. 15 9月, 2008 1 次提交
    • A
      Use common objects for qemu-img and qemu-nbd · 03ff3ca3
      aliguori 提交于
      Right now, we sprinkle #if defined(QEMU_IMG) && defined(QEMU_NBD) all over the
      code.  It's ugly and causes us to have to build multiple object files for
      linking against qemu and the tools.
      
      This patch introduces a new file, qemu-tool.c which contains enough for
      qemu-img, qemu-nbd, and QEMU to all share the same objects.
      
      This also required getting qemu-nbd to be a bit more Windows friendly.  I also
      changed the Windows block-raw to use normal IO instead of overlapping IO since
      we don't actually do AIO yet on Windows.  I changed the various #if 0's to
       #if WIN32_AIO to make it easier for someone to eventually fix AIO on Windows.
      
      After this patch, there are no longer any #ifdef's related to qemu-img and
      qemu-nbd.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5226 c046a42c-6fe2-441c-8c8c-71466251a162
      03ff3ca3
  20. 12 9月, 2008 1 次提交
  21. 10 9月, 2008 1 次提交
    • A
      Use signalfd() to work around signal/select race · baf35cb9
      aliguori 提交于
      This patch introduces signalfd() to work around the signal/select race in
      checking for AIO completions.  For platforms that don't support signalfd(), we
      emulate it with threads.
      
      There was a long discussion about this approach.  I don't believe there are any
      fundamental problems with this approach and I believe eliminating the use of
      signals is a good thing.
      
      I've tested Windows and Linux using Windows and Linux guests.  I've also checked
      for disk IO performance regressions.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5187 c046a42c-6fe2-441c-8c8c-71466251a162
      baf35cb9
  22. 22 8月, 2008 1 次提交
    • A
      Fix windows build · cd01b4a3
      aliguori 提交于
      Right now, the Windows build is broken because of NBD.  Using a mingw32 cross
      compiler is also badly broken.
      
      This patch fixes the Windows build by stubbing out NBD support until someone
      fixes it for Windows.  It also santizing the mingw32 cross compiler support
      by replacing the --enable-mingw32 option with a compiler check to determine
      if we're on windows or not.
      
      Also remove the weird SDL pseudo-detection for mingw32 using a cross compiler.
      The hardcoded sdl-config name is seemly arbitrary.  If you cross compiler SDL
      correctly and modify your PATH variable appropriately, it will Just Work when
      cross compiling.
      
      The audio driver detection is also broken for cross compiling so you have to
      specify the audio drivers explicitly for now.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5046 c046a42c-6fe2-441c-8c8c-71466251a162
      cd01b4a3
  23. 02 8月, 2008 1 次提交
  24. 27 7月, 2008 1 次提交
  25. 19 7月, 2008 1 次提交
  26. 18 7月, 2008 1 次提交
  27. 03 7月, 2008 1 次提交