1. 27 10月, 2011 1 次提交
    • L
      qapi: Convert query-vnc · 2b54aa87
      Luiz Capitulino 提交于
      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: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      2b54aa87
  2. 10 9月, 2011 1 次提交
  3. 24 7月, 2011 2 次提交
    • D
      Introduce a 'client_add' monitor command accepting an open FD · 13661089
      Daniel P. Berrange 提交于
      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: NAnthony Liguori <aliguori@us.ibm.com>
      13661089
    • K
      qemu-char: Print strerror message on failure · 6e1db57b
      Kevin Wolf 提交于
      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: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      6e1db57b
  4. 22 3月, 2011 2 次提交
  5. 02 2月, 2011 1 次提交
    • A
      vnc: Fix password expiration through 'change vnc ""' (v2) · 1cd20f8b
      Anthony Liguori 提交于
      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
      string.
      
      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: NNeil Wilson <neil@aldur.co.uk>
      Signed-off-by: NAnthony 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
      1cd20f8b
  6. 05 1月, 2011 1 次提交
    • A
      Fix curses on big endian hosts · 9ae19b65
      Aurelien Jarno 提交于
      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: NAurelien Jarno <aurelien@aurel32.net>
      9ae19b65
  7. 09 12月, 2010 1 次提交
  8. 15 6月, 2010 1 次提交
  9. 25 5月, 2010 1 次提交
  10. 21 5月, 2010 1 次提交
  11. 20 3月, 2010 3 次提交
    • A
      Add notifier for mouse mode changes · 7e581fb3
      Anthony Liguori 提交于
      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: NAnthony Liguori <aliguori@us.ibm.com>
      7e581fb3
    • A
      Add kbd_mouse_has_absolute() · eb2e259d
      Anthony Liguori 提交于
      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: NAnthony Liguori <aliguori@us.ibm.com>
      eb2e259d
    • A
      Rewrite mouse handlers to use QTAILQ and to have an activation function · 6fef28ee
      Anthony Liguori 提交于
      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
      active.
      
      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: NAnthony Liguori <aliguori@us.ibm.com>
      6fef28ee
  12. 09 3月, 2010 1 次提交
  13. 20 2月, 2010 1 次提交
  14. 12 12月, 2009 2 次提交
  15. 02 10月, 2009 2 次提交
  16. 11 9月, 2009 1 次提交
  17. 04 9月, 2009 1 次提交
  18. 29 6月, 2009 1 次提交
  19. 21 5月, 2009 1 次提交
    • A
      Eliminate --disable-gfx-check and make VNC default when SDL not available · f92f8afe
      Anthony Liguori 提交于
       --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: NAnthony Liguori <aliguori@us.ibm.com>
      f92f8afe
  20. 10 5月, 2009 1 次提交
  21. 13 3月, 2009 1 次提交
    • A
      DisplayAllocator interface (Stefano Stabellini) · 7b5d76da
      aliguori 提交于
      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
      changes).
      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: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6839 c046a42c-6fe2-441c-8c8c-71466251a162
      7b5d76da
  22. 06 3月, 2009 4 次提交
    • A
      monitor: Rework API (Jan Kiszka) · 376253ec
      aliguori 提交于
      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
      again.
      
      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: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6711 c046a42c-6fe2-441c-8c8c-71466251a162
      376253ec
    • A
      monitor: Rework modal password input (Jan Kiszka) · bb5fc20f
      aliguori 提交于
      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: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6710 c046a42c-6fe2-441c-8c8c-71466251a162
      bb5fc20f
    • A
      monitor: Break out readline_show_prompt (Jan Kiszka) · 9dd442b1
      aliguori 提交于
      Break readline_show_prompt out of readline_start so that (re-)printing
      the prompt can be controlled in a more fine-grained way.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6709 c046a42c-6fe2-441c-8c8c-71466251a162
      9dd442b1
    • A
      monitor: Rework early disk password inquiry (Jan Kiszka) · c0f4ce77
      aliguori 提交于
      Reading the passwords for encrypted hard disks during early startup is
      broken (I guess for quiet a while now):
       - No monitor terminal is ready for input at this point
       - Forcing all mux'ed terminals into monitor mode can confuse other
         users of that channels
      
      To overcome these issues and to lay the ground for a clean decoupling of
      monitor terminals, this patch changes the initial password inquiry as
      follows:
       - Prevent autostart if there is some encrypted disk
       - Once the user tries to resume the VM, prompt for all missing
         passwords
       - Only resume if all passwords were accepted
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6707 c046a42c-6fe2-441c-8c8c-71466251a162
      c0f4ce77
  23. 04 3月, 2009 1 次提交
  24. 26 1月, 2009 1 次提交
  25. 24 1月, 2009 1 次提交
  26. 17 1月, 2009 2 次提交
    • A
      Fix character devices after DisplayState refactoring · 2796dae0
      aliguori 提交于
      The DisplayState refactoring changed the machine init function to create a
      DisplayState for each VGA device instead of being passed an existing
      DisplayState.  This change is critical to enable multiple graphics device
      support.
      
      Unfortunately, the serial/parallel/console code is structured today to run
      before machine init to fill out the CharDriverState table which the machine
      init function uses to determine whether to create the required devices.
      
      Since a 'vc' is a type of CharDriverState, the CharDriverState code requires
      that a DisplayState exist before it runs creating a circular dependency.
      
      To fix this, this splits the creation of the initial CharDriverState from
      the initialization of the text console.  We can then in a second step associate
      a DisplayState with all TextConsoles.  This allows us to create the
      CharDriverState's first, machine init, then associate the TextConsoles with
      a DisplayState.
      
      This code screams for more cleanup.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6352 c046a42c-6fe2-441c-8c8c-71466251a162
      2796dae0
    • A
      graphical_console_init change (Stefano Stabellini) · 3023f332
      aliguori 提交于
      Patch 5/7
      
      This patch changes the graphical_console_init function to return an
      allocated DisplayState instead of a QEMUConsole.
      
      This patch contains just the graphical_console_init change and few other
      modifications mainly in console.c and vl.c.
      It was necessary to move the display frontends (e.g. sdl and vnc)
      initialization after machine->init in vl.c.
      
      This patch does *not* include any required changes to any device, these
      changes come with the following patches.
      
      Patch 6/7
      
      This patch changes the QEMUMachine init functions not to take a
      DisplayState as an argument because is not needed any more;
      
      In few places the graphic hardware initialization function was called
      only if DisplayState was not NULL, now they are always called.
      Apart from these cases, the rest are all mechanical substitutions.
      
      Patch 7/7
      
      This patch updates the graphic device code to use the new
      graphical_console_init function.
      
      As for the previous patch, in few places graphical_console_init was called
      only if DisplayState was not NULL, now it is always called.
      Apart from these cases, the rest are all mechanical substitutions.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6344 c046a42c-6fe2-441c-8c8c-71466251a162
      3023f332
  27. 16 1月, 2009 2 次提交
    • A
      DisplayState interface change (Stefano Stabellini) · 7d957bd8
      aliguori 提交于
      This patch changes the DisplayState interface adding support for
      multiple frontends at the same time (sdl and vnc) and implements most
      of the benefit of the shared_buf patch without the added complexity.
      
      Currently DisplayState is managed by sdl (or vnc) and sdl (or vnc) is
      also responsible for allocating the data and setting the depth.
      Vga.c (or another backend) will do any necessary conversion.
      
      The idea is to change it so that is vga.c (or another backend) together
      with console.c that fully manage the DisplayState interface allocating
      data and setting the depth (either 16 or 32 bit, if the guest uses a
      different resolution or is in text mode, vga.c (or another backend) is
      in charge of doing the conversion seamlessly).
      
      The other idea is that DisplayState supports *multiple* frontends
      like sdl and vnc; each of them can register some callbacks to be called
      when a display event occurs.
      
      The interesting changes are:
      
      - the new structures and related functions in console.h and console.c
      
      in particular the following functions are very helpful to manage a
      DisplaySurface:
      
      qemu_create_displaysurface
      qemu_resize_displaysurface
      qemu_create_displaysurface_from
      qemu_free_displaysurface
      
      - console_select and qemu_console_resize in console.c
      this two functions manage multiple consoles on a single host display
      
      - moving code around in hw/vga.c
      as for the shared_buf patch this is necessary to be able to handle a dynamic
      DisplaySurface bpp
      
      - changes to vga_draw_graphic in hw/vga.c
      this is the place where the DisplaySurface buffer is shared with the
      videoram, when possible;
      
      
      Compared to the last version the only changes are:
      
      - do not remove support to dpy_copy in cirrus_vga
      - change the name of the displaysurface handling functions
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6336 c046a42c-6fe2-441c-8c8c-71466251a162
      7d957bd8
    • A
      remove bgr (Stefano Stabellini) · 8927bcfd
      aliguori 提交于
      Do not handle bgr host displays in the backends.
      
      Right now a bgr flag exists so that sdl can set it, if the SDL_Surface
      is bgr.
      Afterwards the graphic device (e.g. vga.c) does the needed conversion.
      
      With this patch series is sdl that is responsible for rendering the format
      provided by the graphic device that must provide a DisplaySurface
      (ds->surface) in 16 or 32 bpp, rgb.
      Afterwards sdl creates a SDL_Surface from the given DisplaySurface and
      blits it into the main SDL_Surface using SDL_BlitSurface.
      
      Everything is handled by sdl transparently, because SDL_BlitSurface is
      perfectly capable of handling bgr displays by itself.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      
      
      git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6335 c046a42c-6fe2-441c-8c8c-71466251a162
      8927bcfd
  28. 25 11月, 2008 1 次提交
  29. 06 10月, 2008 1 次提交