1. 23 Oct, 2012 1 commit
  2. 05 Sep, 2012 4 commits
  3. 12 Mar, 2012 1 commit
  4. 24 Feb, 2012 2 commits
    • Gerd Hoffmann's avatar
      optimize screendump for the common non-switch case · 45efb161
      Gerd Hoffmann authored
      switch console only if needed, also pass down whenever the console was
      switched or not because a displaysurface redraw is only needed in case
      the console was switched.
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    • Markus Armbruster's avatar
      Revert "qemu-char: Print strerror message on failure" and deps · 1f51470d
      Markus Armbruster authored
      The commit's purpose is laudable:
          The only way for chardev drivers to communicate an error was to
          return a NULL pointer, which resulted in an error message that
          said _that_ something went wrong, but not _why_.
      It attempts to achieve it by changing the interface to return 0/-errno
      and update qemu_chr_open_opts() to use strerror() to display a more
      helpful error message.  Unfortunately, it has serious flaws:
      1. Backends "socket" and "udp" return bogus error codes, because
      qemu_chr_open_socket() and qemu_chr_open_udp() assume that
      unix_listen_opts(), unix_connect_opts(), inet_listen_opts(),
      inet_connect_opts() and inet_dgram_opts() fail with errno set
      appropriately.  That assumption is wrong, and the commit turns
      unspecific error messages into misleading error messages.  For
          $ qemu-system-x86_64 -nodefaults -vnc :0 -chardev socket,id=bar,host=xxx
          inet_connect: host and/or port not specified
          chardev: opening backend "socket" failed: No such file or directory
      ENOENT is what happens to be in my errno when the backend returns
      -errno.  Let's put ERANGE there just for giggles:
          $ qemu-system-x86_64 -nodefaults -vnc :0 -chardev socket,id=bar,host=xxx -drive if=none,iops=99999999999999999999
          inet_connect: host and/or port not specified
          chardev: opening backend "socket" failed: Numerical result out of range
      Worse: when errno happens to be zero, return -errno erroneously
      signals success, and qemu_chr_new_from_opts() dies dereferencing
      uninitialized chr.  I observe this with "-serial unix:".
      2. All qemu_chr_open_opts() knows about the error is an errno error
      code.  That's simply not enough for a decent message.  For instance,
      when inet_dgram() can't resolve the parameter host, which errno code
      should it use?  What if it can't resolve parameter localaddr?
      Clue: many backends already report errors in their open methods.
      Let's revert the flawed commit along with its dependencies, and fix up
      the silent error paths instead.
      This reverts commit 6e1db57b.
      This reverts commit aad04cd0.
      The parts of commit db418a0a "Add stdio char device on windows" that
      depend on the reverted change fixed up.
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
  5. 18 Jan, 2012 2 commits
  6. 06 Dec, 2011 1 commit
  7. 27 Oct, 2011 1 commit
    • Luiz Capitulino's avatar
      qapi: Convert query-vnc · 2b54aa87
      Luiz Capitulino authored
      There are three important remarks in relation to the non-qapi command:
       1. This commit also fixes the behavior of the 'query-vnc' and 'info vnc'
          commands to return an error when qemu is built without VNC support
          (ie. --disable-vnc). The non-qapi command would return the OK
          response in QMP and no response in HMP
       2. The qapi version explicitly marks the fields 'host', 'family',
          'service' and 'auth' as optional. Their are not documented as optional
          in the non-qapi command doc, but they would not be returned if
          vnc support is disabled. The qapi version maintains the same
          semantics, but documents those fields correctly
       3. The 'clients' field, which is a list, is marked as optional but is
          always returned. If there are no clients connected an empty list
          is returned. This is not the Right Way to this in the qapi but it's
          how the non-qapi command used to work
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
  8. 09 Sep, 2011 1 commit
  9. 23 Jul, 2011 2 commits
    • Daniel P. Berrange's avatar
      Introduce a 'client_add' monitor command accepting an open FD · 13661089
      Daniel P. Berrange authored
      Allow client connections for VNC and socket based character
      devices to be passed in over the monitor using SCM_RIGHTS.
      One intended usage scenario is to start QEMU with VNC on a
      UNIX domain socket. An unprivileged user which cannot access
      the UNIX domain socket, can then connect to QEMU's VNC server
      by passing an open FD to libvirt, which passes it onto QEMU.
       { "execute": "get_fd", "arguments": { "fdname": "myclient" } }
       { "return": {} }
       { "execute": "add_client", "arguments": { "protocol": "vnc",
                                                 "fdname": "myclient",
                                                 "skipauth": true } }
       { "return": {} }
      In this case 'protocol' can be 'vnc' or 'spice', or the name
      of a character device (eg from -chardev id=XXXX)
      The 'skipauth' parameter can be used to skip any configured
      VNC authentication scheme, which is useful if the mgmt layer
      talking to the monitor has already authenticated the client
      in another way.
      * console.h: Define 'vnc_display_add_client' method
      * monitor.c: Implement 'client_add' command
      * qemu-char.c, qemu-char.h: Add 'qemu_char_add_client' method
      * qerror.c, qerror.h: Add QERR_ADD_CLIENT_FAILED
      * qmp-commands.hx: Declare 'client_add' command
      * ui/vnc.c: Implement 'vnc_display_add_client' method
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    • Kevin Wolf's avatar
      qemu-char: Print strerror message on failure · 6e1db57b
      Kevin Wolf authored
      The only way for chardev drivers to communicate an error was to return a NULL
      pointer, which resulted in an error message that said _that_ something went
      wrong, but not _why_.
      This patch changes the interface to return 0/-errno and updates
      qemu_chr_open_opts to use strerror to display a more helpful error message.
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
  10. 22 Mar, 2011 2 commits
  11. 01 Feb, 2011 1 commit
    • Anthony Liguori's avatar
      vnc: Fix password expiration through 'change vnc ""' (v2) · 1cd20f8b
      Anthony Liguori authored
      commit 52c18be9 introduced a regression in the
      change vnc password command that changed the behavior of setting the VNC
      password to an empty string from disabling login to disabling authentication.
      This commit refactors the code to eliminate this overloaded semantics in
      vnc_display_password and instead introduces the vnc_display_disable_login.   The
      monitor implementation then determines the behavior of an empty or missing
      Recently, a set_password command was added that allows both the Spice and VNC
      password to be set.  This command has not shown up in a release yet so the
      behavior is not yet defined.
      This patch proposes that an empty password be treated as an empty password with
      no special handling.  For specifically disabling login, I believe a new command
      should be introduced instead of overloading semantics.
      I'm not sure how Spice handles this but I would recommend that we have Spice
      and VNC have consistent semantics here for the 0.14.0 release.
      Reported-by: default avatarNeil Wilson <neil@aldur.co.uk>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      v1 -> v2
       - Add a proper return to make sure that login is really disabled instead of
         relying on the VNC server to treat empty passwords specially
  12. 04 Jan, 2011 1 commit
    • Aurelien Jarno's avatar
      Fix curses on big endian hosts · 9ae19b65
      Aurelien Jarno authored
      On big endian hosts, the curses interface is unusable: the emulated
      graphic card only displays garbage, while the monitor interface displays
      nothing (or rather only spaces).
      The curses interface is waiting for data in native endianness, so
      console_write_ch() should not do any conversion. The conversion should
      be done when reading the video buffer in hw/vga.c. I supposed this
      buffer is in little endian mode, though it's not impossible that the
      data is actually in guest endianness. I currently have no big endian
      guest to way (they all switch to graphic mode immediately).
      Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>
  13. 09 Dec, 2010 1 commit
  14. 14 Jun, 2010 1 commit
  15. 24 May, 2010 1 commit
  16. 21 May, 2010 1 commit
  17. 19 Mar, 2010 3 commits
    • Anthony Liguori's avatar
      Add notifier for mouse mode changes · 7e581fb3
      Anthony Liguori authored
      Right now, DisplayState clients rely on polling the mouse mode to determine
      when the device is changed to an absolute device.  Use a notification list to
      add an explicit notification.
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    • Anthony Liguori's avatar
      Add kbd_mouse_has_absolute() · eb2e259d
      Anthony Liguori authored
      kbd_mouse_is_absolute tells us whether the current mouse handler is an absolute
      device.  kbd_mouse_has_absolute tells us whether we have any device that is
      capable of absolute input.
      This lets us tell a user that they have configured an absolute device but that
      the guest is not currently using it.
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    • Anthony Liguori's avatar
      Rewrite mouse handlers to use QTAILQ and to have an activation function · 6fef28ee
      Anthony Liguori authored
      And convert usb-hid to use it (to avoid regression with bisection)
      Right now, when we do info mice and we've added a usb tablet, we don't see it
      until the guest starts using the tablet.  We implement this behavior in order
      to provide a means to delay registration of a mouse handler since we treat
      the last registered handler as the current handler.
      This is a usability problem though as we would like to give the user feedback
      that they've either 1) not added an absolute device 2) there is an absolute
      device but the guest isn't using it 3) we have an absolute device and it's
      By using QTAILQ and having an explicit activation function that moves the
      handler to the front of the queue, we can implement the same semantics as
      before with respect to automatically switching to usb tablet while providing
      the user with a whole lot more information.
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
  18. 09 Mar, 2010 1 commit
  19. 19 Feb, 2010 1 commit
  20. 12 Dec, 2009 2 commits
  21. 01 Oct, 2009 2 commits
  22. 11 Sep, 2009 1 commit
  23. 04 Sep, 2009 1 commit
  24. 29 Jun, 2009 1 commit
  25. 21 May, 2009 1 commit
    • Anthony Liguori's avatar
      Eliminate --disable-gfx-check and make VNC default when SDL not available · f92f8afe
      Anthony Liguori authored
       --disable-gfx-check predates VNC server support.  It made sense back then
      because the only thing you could do without SDL was use -nographic mode or
      similar tricks.  Since this is a very advanced mode of operation, gfx-check
      provided a good safety net for casual users.
      A casual user is very likely to use VNC to interact with a guest.  In fact, it's
      often frustrating to install QEMU on a server and have to specify
      disable-gfx-check when you only want to use VNC.
      This patch eliminates disable-gfx-check and makes SDL behave like every other
      optional dependency.  If SDL is not available, instead of failing ungracefully
      if no special options are specified, we default to -vnc localhost:0,to=99.
      When we do default to VNC, we also print a message to tell the user that we've
      done this include which port we're currently listening on.
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
  26. 09 May, 2009 1 commit
  27. 13 Mar, 2009 1 commit
    • aliguori's avatar
      DisplayAllocator interface (Stefano Stabellini) · 7b5d76da
      aliguori authored
      Hi all,
      this patch adds a DisplayAllocator interface that allows display
      frontends (sdl in particular) to provide a preallocated display buffer
      for the graphical backend to use.
      Whenever a graphical backend cannot use
      qemu_create_displaysurface_from because its own internal pixel format
      cannot be exported directly (text mode or graphical mode with color
      depth 8 or 24), it creates another display buffer in memory using
      qemu_create_displaysurface and does the conversion.
      This new buffer needs to be blitted into the sdl surface buffer every time
      we need to update portions of the screen.
      We can avoid this using the DisplayAllocator interace: sdl provides its
      own implementation of qemu_create_displaysurface, giving back the sdl
      surface buffer directly (as we used to do before the DisplayState
      Since the buffer returned by sdl could be in bgr format we need to put
      back in the handlers of that case.
      This approach is good if the two following conditions are true:
      1) the sdl surface is a software surface that resides in main memory;
      2) the host display color depth is either 16 or 32 bpp.
      If first condition is false we can have bad performances using sdl
      and vnc together.
      If the second condition is false performances are certainly not going to
      improve but they shouldn't get worse either.
      The first condition is always true, at least on linux/X11 systems; but I
      believe is true also on other platforms.
      The second condition is true in the vast majority of the cases.
      This patch should also have the good side effect of solving the sdl
      2D slowness malc was reporting on MacOS, because SDL_BlitSurface is not
      going to be called anymore when the guest is in text mode or 24bpp.
      However the root problem is still present so I suspect we may
      still see some slowness on MacOS when the guest is in 32 or 16 bpp.
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6839 c046a42c-6fe2-441c-8c8c-71466251a162
  28. 05 Mar, 2009 2 commits
    • aliguori's avatar
      monitor: Rework API (Jan Kiszka) · 376253ec
      aliguori authored
      Refactor the monitor API and prepare it for decoupled terminals:
      term_print functions are renamed to monitor_* and all monitor services
      gain a new parameter (mon) that will once refer to the monitor instance
      the output is supposed to appear on. However, the argument remains
      unused for now. All monitor command callbacks are also extended by a mon
      parameter so that command handlers are able to pass an appropriate
      reference to monitor output services.
      For the case that monitor outputs so far happen without clearly
      identifiable context, the global variable cur_mon is introduced that
      shall once provide a pointer either to the current active monitor (while
      processing commands) or to the default one. On the mid or long term,
      those use case will be obsoleted so that this variable can be removed
      Due to the broad usage of the monitor interface, this patch mostly deals
      with converting users of the monitor API. A few of them are already
      extended to pass 'mon' from the command handler further down to internal
      functions that invoke monitor_printf.
      At this chance, monitor-related prototypes are moved from console.h to
      a new monitor.h. The same is done for the readline API.
      Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6711 c046a42c-6fe2-441c-8c8c-71466251a162
    • aliguori's avatar
      monitor: Rework modal password input (Jan Kiszka) · bb5fc20f
      aliguori authored
      Currently, waiting for the user to type in some password blocks the
      whole VM because monitor_readline starts its own I/O loop. And this loop
      also screws up reading passwords from virtual console.
      Patch below fixes the shortcomings by using normal I/O processing also
      for waiting on a password. To keep to modal property for the monitor
      terminal, the command handler is temporarily replaced by a password
      handler and a callback infrastructure is established to process the
      result before switching back to command mode.
      Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6710 c046a42c-6fe2-441c-8c8c-71466251a162