aboutsummaryrefslogtreecommitdiff
path: root/vnc.c
AgeCommit message (Collapse)AuthorFilesLines
2009-02-16Support multiple VNC clients (Brian Kress)aliguori1-135/+170
Change structure associated with a display from VncState to a new structure VncDisplay. Remove client specific fields from VncDisplay. Remove display specific fields from VncState. Maintain a linked list of VncStates per VncDisplay structure, update as necessary. When updates/resizes/copies come in from the hardware, dispatch to all clients. Signed-off-by: Brian Kress <kressb@moose.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6621 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-11monitor: Don't change VNC server when disabled (Jan Kiszka)aliguori1-0/+4
[ As requested, broken out of the monitor rework series. ] Avoid a segfault when the user issues 'change vnc' without having vnc enabled on startup. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6616 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-05toplevel: remove error handling from qemu_malloc() callers (Avi Kivity)aliguori1-6/+3
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-02Add zlib encoding support (Alexander Graf)aliguori1-0/+109
This patch adds zlib encoding support for VNC. It basically runs the raw traffic through zlib, providing a pretty good compression ratio. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6499 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-02Move the framebuffer update package out (Alexander Graf)aliguori1-4/+2
Currently the send_framebuffer_update_raw and send_framebuffer_update_hextile respectively send a send_framebuffer_update packet themselves. We need to reuse send_framebuffer_update_raw for zlib encoding though, so let's move it out. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6498 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-02Move buffer functions up (Alexander Graf)aliguori1-33/+33
We will need to use buffer functions in code that will end up being below the current buffer functions. In order to not introduce any function stub defines, let's just move them up. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6497 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-02Add some tight awareness to vnc.c (Alexander Graf)aliguori1-2/+21
This patch enables the vnc server to understand fundamental tight extensions. It changes from a "Hextile or not" scheme when sending framebuffer updates to a "preferred encoding", namely the last one set. While this is not perfect, as actually a list of "preferred encodings" should be kept, it's good enough for now. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6496 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-02Fix invalid #if in vnc.c when debugging is enabled (Alexander Graf)aliguori1-1/+1
While running with debugging enabled, I found an #if testing for an undefined value, not defined(value). This patch fixes that. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6495 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-02Use VNC protocol defines (Alexander Graf)aliguori1-47/+50
Now that we have nice defines for all sorts of constants, let's use them! This patch also takes the "feature variables", currently called has_* into a single feature int. This way adding new features is a lot easier and doesn't clutter the VncState struct. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6494 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-02Split VNC defines to vnc.h (Alexander Graf)aliguori1-35/+1
The VNC protocol contains quite some constants, some of which are currently hardcoded in the vnc.c code. This is not exactly pretty. Let's move all those constants out to vnc.h, so they are clearly separated. While at it, I also included other defines that will be used later in this patch series. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6493 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-26vnc fixes and improvements (Stefano Stabellini)aliguori1-6/+16
this patch fixes a bug and improves the generic pixel conversion function in vnc.c. The bug is that when a new vnc client connects we need to reset the flag has_WMVi but currently we don't. The generic pixel conversion function is vnc_convert_pixel and currently is not very efficient since uses the division and multiplication operators. To make it more efficient I changed to use bit shift operators instead. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6441 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-15exploiting the new interface in vnc.c (Stefano Stabellini)aliguori1-206/+103
This patch exploits the new DisplaySurface and PixelFormat structures in vnc, making the code easier to read allowing further improvements. Compared to the last version I fixed a bug that prevented the hextile encoding from working properly. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6337 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-15DisplayState interface change (Stefano Stabellini)aliguori1-73/+34
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: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6336 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-14Fix some more warningsblueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6300 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-22Properly handle the case of SetPixelEncodings with a length of zero.aliguori1-3/+6
This commit addresses CORE-2008-1210/CVE-2008-2382. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6121 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-13vnc: Fix crash on 'info vnc' after 'change vnc none'aurel321-1/+1
vnc_state->display is set to NULL after "change vnc none" but vnc_state itself is still valid. (James Ko) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6010 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-03Make audio violate POSIX lessmalc1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5864 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02Exclude unix: from vnc call to unix_listen() (Ryan Harper)aliguori1-1/+1
When using an existing unix socket like: -vnc unix:/tmp/file1Y2nY2 qemu fails to bind a unix socket because the vnc call to unix_listen includes the unix: prefix and stores that in the unix.sun_path. The fix is to not pass in unix: for the filename (same way qemu-char.c does it). Signed-off-by: Ryan Harper <ryanh@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5856 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01Reset the key modifiers upon client connectmalc1-0/+1
VNC should not maintain modifer state upon reconnects With some window managers/vnc clients it will only see a key down event for a modifier followed by immediate disconnect(think Alt-F4), with a net effect of subsequently connected clients operating as if the modifier was never released. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5851 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01Add basic audio functionality to vnc.cmalc1-1/+131
This allows among other things to capturing A/V of running guests. Ad-hoc client that does this (via script that invokes ffmpeg) can be found at: http://repo.or.cz/w/qemu/malc.git?a=tree;f=vcap;hb=capture3 Thanks to Anthony Liguori for comments and review. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5850 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01Don't try to select on an invalid VNC socket when init fails.balrog1-0/+1
Otherwise we get a segfault. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5840 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-24Introduce accessors for DisplayState (Stefano Stabellini)aliguori1-33/+33
Introducing some accessors: ds_get_linesize ds_get_bits_per_pixel ds_get_width ds_get_height ds_get_data Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5789 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-12r5531 made x509 certs not loadable (original patch from Henrik Holst).balrog1-3/+1
The patch in r5531 which replaced a bunch of strncpy with pstrcpy causes the x509 credentials from the -vnc parameter to be one character shorter than entered meaning that there is currently no way to enter x509 certificates... git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5707 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-11sockets: switch vnc to new code, support vnc port auto-allocation (Gerd Hoffman)aliguori1-87/+26
This patch switches the vnc code ofer to the new socket helper functions. It adds support IPv6 support and for automatically allocating an unused vnc display port. The latter is handled ising a to= option, specifying the upper limit for the display number to try. Scanning is started at the display number given in the display specification, i.e. this command line: -vnc localhost:7,to=11 will try displays 7 to 11 (inclusive). There are also new "ipv4" and "ipv6" options to make qemu try only the specified internet protocol version. The display actually allocated can be queried using the "info vnc" monitor command. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5696 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-25Replace uses of strncpy (a GNU extension) with Qemu pstrcpyblueswir11-1/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5531 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-24Fix compiler warning when _VNC_DEBUG isn't defined.ths1-1/+1
Signed-off-by: Thiemo Seufer <ths@networkno.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5312 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-15WMVi extension support (Stefano Stabellini)aliguori1-64/+91
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5230 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-15vnc dynamic resolution (Stefano Stabellini)aliguori1-47/+171
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5229 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-06Fix most warnings that would be caused by gcc flag -Wundefblueswir11-20/+20
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5173 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-06Some little fixes on QEMUaurel321-2/+0
- some vectors can be declared as "const" - test on CONFIG_VNC_TLS is done for two times while just one is enough. (Carlo Bramini) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5172 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-23VNC: Support for ExtendedKeyEvent client messagealiguori1-9/+50
This patch adds support for the ExtendedKeyEvent client message. This message allows a client to send raw scan codes directly to the server. If the client and server are using the same keymap, then it's unnecessary to use the '-k' option with QEMU when this extension is supported. This is extension is currently only implemented by gtk-vnc based clients (gvncviewer, virt-manager, vinagre, etc.). Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5076 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21add DisplayState->idle (Samuel Thibault)aliguori1-0/+3
Add idle field to DisplayState struct, so drivers can figure the display is idle and take advantage of that. The xen framebuffer driver will use this to communicate the idle state to the guest, so it knows it can stop doing updates to a virtual display which is invisible anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5056 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-06Add qemu_realloc(), by Gerd Hoffmann.ths1-3/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4986 c046a42c-6fe2-441c-8c8c-71466251a162
2008-06-02Don't forget to save VNC FB dimensions after resize (Brad Campbell).balrog1-8/+10
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4644 c046a42c-6fe2-441c-8c8c-71466251a162
2008-05-25Fix VNC update regoin height.balrog1-1/+1
'h' actually is the coordinate of bottom of the rectangle and not height. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4571 c046a42c-6fe2-441c-8c8c-71466251a162
2008-05-25Invalidate VNC framebuffer on every resize.balrog1-4/+3
On a resize, vncviewer keeps the image in the upper-left part of the screen unmodified and fills the right end of the lines with black colour. vnc.c keeps the first n bytes of the framebuffer unmodified instead - meaning that the client's image doesn't match the image in framebuffer and checking for dirty rows gives wrong results. We can either invalidate the whole buffer or implement the same transformation as the client. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4569 c046a42c-6fe2-441c-8c8c-71466251a162
2008-05-20Prevent SEGV in VNC server for old clients (Anthony Liguori).balrog1-0/+5
If the client does not support the DesktopResize pseudo-encoding, then vs->{width,height} may be smaller than ds->{width,height}. dirty_row is sized according to vs->{width,height}, not ds->{width,height}. This patch makes sure to bound the update region to vs->{width,height} to avoid a possible SEGV. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Reported-by: Marcelo Tosatti <mtosatti@redhat.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4502 c046a42c-6fe2-441c-8c8c-71466251a162
2008-04-24Fix spurious VNC disconnects on Win32 (Hervé Poussineau).balrog1-3/+13
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4251 c046a42c-6fe2-441c-8c8c-71466251a162
2008-03-10Let the USB tablet reach the far bottom and right pixelsaurel321-2/+2
(Samuel Thibault) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4036 c046a42c-6fe2-441c-8c8c-71466251a162
2008-02-10Add an ncurses UI.balrog1-0/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3976 c046a42c-6fe2-441c-8c8c-71466251a162
2008-02-03Add VNC reverse connections, by Eddie Kohler.balrog1-14/+40
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3951 c046a42c-6fe2-441c-8c8c-71466251a162
2008-01-14Add a missing vga_hw_update() when accepting a connection (Anders Melchiorsen).balrog1-0/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3919 c046a42c-6fe2-441c-8c8c-71466251a162
2008-01-13Reduce redundant timer ticks in VNC, by Anders Melchiorsen.balrog1-14/+8
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3904 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-16Fix wrong signedness, by Andre Przywara.ths1-19/+20
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3815 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-11Fix fragments due to incomplete dirty tracking in CGA mode (Anthony Liguori).balrog1-0/+7
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3809 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-18Add statics and missing #includes for prototypes.pbrook1-6/+6
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3683 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-17Break up vl.h.pbrook1-1/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
2007-10-31Handle 3.7 VNC clients authentication correctly (Dan Kenigsberg).balrog1-1/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3498 c046a42c-6fe2-441c-8c8c-71466251a162
2007-10-30Miscellaneous VNC related fixes from Xen forwarded by Matthew Kent.balrog1-2/+33
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3489 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-30Support UltraVNC clients, by Eduardo Felipe.ths1-2/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3288 c046a42c-6fe2-441c-8c8c-71466251a162