spice: catch spice server initialization failures.
When the spice server initialization fails report this and exit insteadof ignoring the error.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qxl: set mm_time in vga update
This fixes a problem where on windows 7 startup phase, before the qxl driveris loaded, the drawables are sufficiently large and video like to trigger astream, but the lack of a filled mm time field triggers a warning in spice-gtk....
vnc: Fix compilation with --enable-vnc-png
Commit f26e428da505709ec03b2ed2c9eb3db82b30bd7b fixed compilationwith --enable-vnc-png, but broke it with --enable-vnc-png.
The breakage is caused by pngconfig.h which checks whethersetjmp.h was already included and fails because qemu-common.h...
Fix MinGW compilation when --enable-vnc-jpeg is specified
Fix conflicting types for 'INT32' in basetsd.h and jmorecfg.h byincluding qemu-common.h first.
Signed-off-by: Roy Tam <roytam@gmail.com>Acked-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
cocoa: Provide central qemu_main() prototype
This fixes a missing prototype warning in vl.c and obsoletesthe prototype in cocoa.m. Adjust callers in cocoa.m to supplythird argument, which is currently only used on Linux/ppc.
The prototype is designed so that it could be shared with SDL...
cocoa: Avoid warning related to multiple handleEvent: definitions
Avoid compiler confusion as to which method signature to use for thehandleEvent: selector on OSX >= 10.6 by making the variable type-safeas opposed to generic 'id' type.Requires moving the variable definition to after the class definition....
Cocoa: avoid displaying window when command-line contains '-h' or '-help'
There was already a check in place to avoid displaying a windowin certain modes such as vnc, nographic or curses.
Add a check for '-h' and '-help' to avoid displaying a window for a split-...
cocoa: do not create a spurious window for -version
When invoked with -version, qemu will exit just after displaying the version,so there is no need to create a window.Also handles --XXX options.
Signed-off-by: Tristan Gingold <gingold@adacore.com>Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Merge remote-tracking branch 'spice/spice.v37' into staging
Conflicts: vl.c
Fix compilation warning due to missing header for sigaction (followup)
This patch removes all references to signal.h when qemu-common.h is includedas they become redundant.
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
spice: add option for disabling copy paste support
Some people want to be able disable spice's guest <-> client copy paste supportbecause of security considerations.
[ kraxel: drop old-version error message ]
spice: add SASL support
Turn on SASL support by appending "sasl" to the spice arguments, whichrequires that the client use SASL to authenticate with the spice. Theexact choice of authentication method used is controlled from thesystem / user's SASL configuration file for the 'qemu' service. This...
spice: require spice 0.6.0 or newer.
This patch raises the minimum required spice version to 0.6.0 and dropsa few ifdefs.
0.6.0 is the first stable release with the current libspice-server API,there shouldn't be any 0.5.x development versions deployed any more....
set $SDL_VIDEODRIVER=x11 on Linux to prevent sudo kvm from fighting for video card
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Make spice dummy functions inline to fix calls not checking return values
qemu_spice_set_passwd() and qemu_spice_set_pw_expire() dummy functionsneeds to be inline, in order to handle the case where they are calledwithout checking the return value.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
spice: don't create updates in spice server context.
This patch moves the creation of spice screen updates from the spiceserver context to qemu iothread context (display refresh timer to beexact). This way we avoid accessing qemu internals (display surface)...
spice: don't call displaystate callbacks from spice server context.
This patch moves the displaystate callback calls for setting the cursorand the mouse pointer from spice server to qemu (iothread) context.This allows us to simplify locking.
spice: drop obsolete iothread locking
We don't use qemu internals from spice server context any more.Thus we don't also need to grab the iothread mutex from spiceserver context. And we don't have to temporarely release thelock to avoid deadlocks. Drop all the calls....
vnc: tight: Fix crash after 2GB of output
fix 2Gb integer overflow in in VNC tight and zlib encodings
As found by Roland Dreier <roland@purestorage.com> (excellentcatch!), when amount of VNC compressed data produced by zliband sent to client exceeds 2Gb, integer overflow occurs because...
vnc: added missing name->keysym pairs for Polish national characters
There are no { name, keysym } values in name2keysym[] array for Polishnational characters so "-k pl" option has no effect.
Signed-off-by: Leszek Grzegorek <leszek.grzegorek@gmail.com>...
ui/sdl: Load optional QEMU icon
Load an optional QEMU icon file. If there is no icon file namedqemu.bmp in QEMU's default search path, QEMU will run withthe usual system default icon.
A matching icon file will be loaded and used by X Windows managers...
severe memory leak caused by broken palette_destroy() function
The following commit breaks the code of the function palette_destroy().
http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commit;h=e31e3694afef58ba191cbcc6875ec243e5971268
The broken code causes a severe memory leak of 'VncPalette' structures...
vnc: fix build error from VNC_DIRTY_WORDS
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Make VNC support optional
Per default VNC is enabled.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
fix vnc regression
This patch fix the following regression:1. we should use bitmap_set() and bitmap_clear() to replace vnc_set_bits().
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Consolidate DisplaySurface allocation in qemu_alloc_display()
This removes various code duplication from console.e and sdl.c
change all rt_clock references to use millisecond resolution accessors
This was done with:
sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \ $(git grep -l 'get_clock\>.*rt_clock' ) sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \...
win32: implement missing timersub
Implement and wrap timersub() for Win32.
Acked-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Refactor thread retrieval and check
We have qemu_cpu_self and qemu_thread_self. The latter is retrieving thecurrent thread, the former is checking for equality (using CPUState). Wealso have qemu_thread_equal which is only used like qemu_cpu_self.
This refactors the interfaces, creating qemu_cpu_is_self and...
vnc: Fix stack corruption and other bitmap related bugs
Commit bc2429b9174ac2d3c56b7fd35884b0d89ec7fb02 introduceda severe bug (stack corruption).
bitmap_clear was called with a wrong argumentwhich caused out-of-bound writes to the local variable width_mask....
vnc: fix a memory leak in threaded vnc server
VncJobQueue's buffer is intended to be used foras the output buffer for all operations in this queue,but unfortunatly.
vnc_async_encoding_start() is in charge of setting thisbuffer as the current output buffer, but...
ui/vnc-enc-tight.c: Fix compile failure if CONFIG_VNC_JPEG not defined
Add some missing #ifdefs to fix compilation failures in the !CONFIG_VNC_JPEGcase introduced by commit ce702e93.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vnc: fix lossy rect refreshing
The for loop in send_lossy_rect was totally wrong, and we can'tcall vnc_set_bits() because it does not really do what it should.Use vnc_set_bit() directly instead.
Signed-off-by: Corentin Chary <corentincj@iksaif.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vnc: use the new generic bitmap functions
Switch to bitmap.h and bitops.h instead of redefining our own bitmaphelpers.
vnc: don't try to send bigger updates that client height
Respect client size if it doesn't not support desktop resizing.
vnc: tight: tweak adaptive tight settings
The force_jpeg threshold was too low.
vnc: add a non-adaptive option
This option allow to disable adaptive behaviors in some encodings.
vnc: Fix fatal crash with vnc reverse mode
Reverse mode is unusable:
qemu -vnc localhost:5500,reverse
crashes in vnc_refresh_server_surface because some pointers are NULL.
Fix this by calling vnc_dpy_resize (which initializes these pointers)before calling vnc_refresh....
vnc: don't set the quality if lossy encoding are disabled
This should not change the current behavior, but if any newencoding try to use the tight quality, it will always be setto -1 when lossy encodings are disabled.
Signed-off-by: Corentin Chary <corentincj@iksaif.net>...
vnc: add a way to get the update frequency for a given region
This patch compute the update frequency (in Hz) for each 64x64 rects.Any adaptive encoding can get this value using vnc_update_freq(), andswitch to a lossy encoding if the value is too high....
vnc: refresh lossy rect after a given timeout
If an adaptive encoding has choosen to send a lossy updatebased on the result of vnc_update_freq(), then it should advertiseit with vnc_sent_lossy_rect(). This will allow to automatically refreshthis rect once it's static again....
vnc: tight: use the update frequency to choose between lossy and lossless
Use the new update frequency infrastructure to use jpeg for regions withhigh update frequency.
vnc: palette: use a pool to reduce memory allocations
We now that the palette will never have more than 256elements. Let's use a pool to reduce malloc calls.
vnc: palette: add palette_init calls
This allow to use palette on the stack instead of alwaysallocating them.
vnc: palette: and fill and color calls.
These two helpers are needed for zrle and zywrle.
vnc: Add ZRLE and ZYWRLE encodings.
Add ZRLE [1] and ZYWRLE [2] encodings. The code is inspire^W stolenfrom libvncserver (again), but have been rewriten to match QEMU codingstyle.
[1] http://www.realvnc.com/docs/rfbproto.pdf[2] http://micro-vnc.jp/research/remote_desktop_ng/ZYWRLE/publications/...
vnc: fix uint8_t comparisons with negative values
ui/sdl: Fix handling of caps lock and num lock keys
Starting with SDL version 1.2.14, caps lock and num lock keyswill send a SDL_KEYUP when SDL_DISABLE_LOCK_KEYS=1 is set inthe environment.
The new code sets the environment unconditionally(it won't harm old versions which do not know it)....
vnc: qemu can die if the client is disconnected while updating screen
agraf reported that qemu_mutex_destroy(vs->output_mutex) while failingin vnc_disconnect_finish().
It's because vnc_worker_thread_loop() tries to unlock the mutex whilenot locked. The unlocking call doesn't fail (pthread bug ?), but...
Merge remote branch 'spice/spice.v29.pull' into staging
Conflicts: trace-events
Merge remote branch 'spice/usb.5' into staging
vnc: Fix password expiration through 'change vnc ""' (v2)
commit 52c18be9e99dabe295321153fda7fce9f76647ac introduced a regression in thechange vnc password command that changed the behavior of setting the VNCpassword to an empty string from disabling login to disabling authentication....
sdl: remove unused variable
Variable rec is not used, remove it. Spotted by GCC 4.6.0: CC ui/sdl.o/src/qemu/ui/sdl.c: In function 'sdl_setdata':/src/qemu/ui/sdl.c:90:14: error: variable 'rec' set but not used [-Werror=unused-but-set-variable]
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vnc: fix numlock+capslock tracking
This patch makes the numlock+capslock tracking logic only look atkeydown events. Without this patch the vnc server will insertbogous capslock keypress in case it sees the following key sequence:
shift down --- 'A' down --- shift up --- 'A' up...
spice: add chardev (v5)
Adding a chardev backend for spice, where spice determines whatto do with it based on the name attribute given during chardev creation.For usage by spice vdagent in conjunction with a properly namedvirtio-serial device, and future smartcard channel usage....
spice/vnc: client migration.
Handle spice client migration, i.e. inform a spice client connectedabout the new host and connection parameters, so it can move over theconnection automatically.
The monitor command has a not-yet used protocol argument simliar to...
Delete useless 'extern' qualifiers for functions
'extern' qualifier is useless for function declarations. Deletethem.
vnc-auth-sasl: fix a memory leak
Fix a memory leak reported by cppcheck:[/src/qemu/ui/vnc-auth-sasl.c:448]: (error) Memory leak: mechname
vnc/spice: add set_passwd monitor command.
This patch adds new set_password and expire_password monitor commandswhich allows to change and expire the password for spice and vncconnections. See the doc update patch chunk for details.
spice: add qxl device
qxl is a paravirtual graphics card. The qxl device is the bridgebetween the guest and the spice server (aka libspice-server). Thespice server will send the rendering commands to the spice client, whichwill actually render them....
spice: connection events.
This patch adds support for connection events to spice. The events arequite simliar to the vnc events. Unlike vnc spice uses multiple tcpchannels though. qemu will report every single tcp connection (akaspice channel). If you want track spice sessions only you can filter...
spice: add qmp 'query-spice' and hmp 'info spice' commands.
The patch adds a 'query-spice' monitor command which returnsinformations about the spice server configuration and also a list ofchannel connections.
vnc: auth reject cleanup
protocol_client_auth_vnc() has two places where the auth can fail,with identical code sending the reject message to the client.Move the common code to the end of the function and make botherror paths jump there. No functional change....
vnc: support password expire
This patch adds support for expiring passwords to vnc. It adds a newvnc_display_pw_expire() function which specifies the time when thepassword will expire.
Merge remote branch 'spice/bugfix.2' into staging
spice: add audio
Add support for the spice audio interface. With this patch appliedaudio can be forwarded over the network from/to the spice client. Bothrecording and playback is supported.
The driver is first in the driver list, but the can_be_default flag is...
spice-display: replace private lock with qemu mutex.
qemu_spice_create_update() must aquire the global qemu mutex tomake sure DisplayState doesn't change while we are accessing it.
Once this is in place the private lock is pretty pointless aseverything it protects is covered by the global qemu mutex now....
spice-core: fix warning when building with spice < 0.6.0
spice-core: fix watching for write events
Merge remote branch 'spice/config.2' into staging
Replace remaining gcc format attributes by macro GCC_FMT_ATTR (format checking)
Replace the remaining format attribute printf by macroGCC_FMT_ATTR which uses gnu_printf (if supported).
curses: Fix control-{@[\]^_} and ESC
control-{@[\]^_} shouldn't get the 'a' - 'A' offset for correcttranslation. ESC is better simulated as escape key.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>Signed-off-by: Andrew Zaborowski <balrogg@gmail.com>
vnc: avoid write only variables
Compiling with GCC 4.6.0 20100925 produced warnings:/src/qemu/ui/vnc.c: In function 'vnc_client_cache_auth':/src/qemu/ui/vnc.c:217:12: error: variable 'qdict' set but not used [-Werror=unused-but-set-variable]/src/qemu/ui/vnc.c: In function 'vnc_display_open':...
spice: tls support
Add options to the -spice command line switch to setup tls.
spice: make compression configurable.
This patch adds options to the -spice command line switch toconfigure image compression.
[ v2: speling fix in the documentation ]
spice: add config options for channel security.
This allows to enforce tls or plaintext usage for certain spicechannels.
[ v2: code style fixup ]
spice: add config options for the listening address
Make listening address configurable. Also add options toforce using IPv4 or IPv6.
spice: add misc config options
This patch adds a few more options to tweak spice server behavior.The documentation update chunk has the details ;)
Merge remote branch 'spice/submit.6' into staging
Conflicts: configure
Fix spelling in comments
multifuction -> multifunctionsuccessfull -> successful.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
spice: simple display
With that patch applied you'll actually see the guests screen in thespice client. This does not bring qxl and full spice support though.This is basically the qxl vga mode made more generic, so it playstogether with any qemu-emulated gfx card. You can display stdvga or...
spice: add tablet support
Add support for the spice tablet interface. The tablet interface willbe registered (and then used by the spice client) as soon as a absolutepointing device is available and used by the guest, i.e. you'll have toconfigure your guest with '-usbdevice tablet'.
spice: core bits
Add -spice command line switch. Has support setting passwd and port fornow. With this patch applied the spice client can successfully connectto qemu. You can't do anything useful yet though.
spice: add keyboard
Open keyboard channel. Now you can type into the spice client and thekeyboard events are sent to your guest. You'll need some other displaylike vnc to actually see the guest responding to them though.
spice: add mouse
Open mouse channel. Now you can move the guests mouse pointer.No tablet / absolute positioning (yet) though.
vnc: use bswapNN() rather than bswap_NN()
bswap_NN() variants are not always available in CONFIG_MACHINE_BSWAP_H caseand bswapNN() are public APIs in "bswap.h".
Signed-off-by: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vnc: tight: remove unused variable
Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
size_t is unsigned, change to ssize_t to handle errors from tight_compress_data()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vnc: check fd before calling qemu_set_fd_handler2() in vnc_client_write()
Setting fd = -1 to qemu_set_fd_handler2() causes bus error at FD_SETin main_loop_wait().
Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
win32: Avoid compiler warning (WIN32_LEAN_AND_MEAN redefined)
configure adds the macro WIN32_LEAN_AND_MEAN toQEMU_CFLAGS, and SDL_syswm.h defines it, too.
This results in a compiler warning (redefinition ofWIN32_LEAN_AND_MEAN in SDL_syswm.h. That warning prevents...
Initialize a variable in all cases
Commit d167f9bc06a577d6c85b8ed6991c1efe175aae7d missed this one:/src/qemu/ui/vnc-enc-tight.c:1483: warning: 'ret' may be used uninitialized in this function
Fix uint8_t comparison with negative value
Commit 7bccf57383cca60a778d5c543ac80c9f62d89ef2 missed this one:/src/qemu/ui/vnc-enc-tight.c: In function 'send_sub_rect':/src/qemu/ui/vnc-enc-tight.c:1527: warning: comparison is always true due to limited range of data type...
Fix mingw32 build
Fix mingw32 build errors like/src/qemu/ui/vnc-enc-tight.c: In function 'tight_detect_smooth_image24':/src/qemu/ui/vnc-enc-tight.c:119: error: 'uint' undeclared (first use in this function)
Replace 'uint' with proper 'unsigned int'.
Fix a warning with some GCCs:/src/qemu/ui/vnc-enc-tight.c: In function `send_sub_rect_nojpeg':/src/qemu/ui/vnc-enc-tight.c:1458: warning: `ret' might be used uninitialized in this function
Fix uint8_t comparisons with negative values
Fix the following warnings:/src/qemu/hw/ide/core.c: In function `ide_drive_pio_post_load':/src/qemu/hw/ide/core.c:2767: warning: comparison is always false due to limited range of data type
/src/qemu/ui/vnc-enc-tight.c: In function `tight_detect_smooth_image':...
vnc: fix tight png memory leak
The tight.png buffer was never released.
vnc: threaded VNC server
Implement a threaded VNC server using the producer-consumer model.The main thread will push encoding jobs (a list a rectangles to update)in a queue, and the VNC worker thread will consume that queue and sendframebuffer updates to the output buffer....
vnc: add missing lock for vnc_cursor_define()
All vnc_write() calls must be locked (except the ones present beforethe protocol initialization).
vnc: tight: fix rgb_prepare_row
rgb_prepare_row bpp depends on the server display surface, notthe client.
vnc: tight: split send_sub_rect
Split send_sub_rect in send_sub_rect_jpeg and send_sub_rect_nojpeg toremove all these #ifdef CONFIG_JPEG.