Re: [Qemu-devel] qemu-kvm-1.0 crashes with threaded vnc server?

2012-02-11 Thread Corentin Chary
go but somehow get lost on the mailing list. I rebased the tree but did not have the time (yet) to test them. http://git.iksaif.net/?p=qemu.git;a=shortlog;h=refs/heads/wip Feel free to try them. If QEMU segfault again, please send a full gdb backtrace / valgrind trace / way to reproduce :). Thanks, -- Corentin Chary http://xf.iksaif.net

Re: [Qemu-devel] qemu-kvm-1.0 crashes with threaded vnc server?

2012-06-28 Thread Corentin Chary
eter Lieven" a écrit : > On 13.03.2012 16:06, Alexander Graf wrote: > >> On 13.03.2012, at 16:05, Corentin Chary wrote: >> >> On Tue, Mar 13, 2012 at 12:29 PM, Peter Lieven wrote: >>> >>>> On 11.02.2012 09:55, Corentin Chary wrote

Re: [Qemu-devel] qemu-kvm-1.0 crashes with threaded vnc server?

2012-03-13 Thread Corentin Chary
On Tue, Mar 13, 2012 at 12:29 PM, Peter Lieven wrote: > On 11.02.2012 09:55, Corentin Chary wrote: >> >> On Thu, Feb 9, 2012 at 7:08 PM, Peter Lieven  wrote: >>> >>> Hi, >>> >>> is anyone aware if there are still problems when enabling the threa

[Qemu-devel] [PATCH 0/2] Lost VNC patches

2012-03-13 Thread Corentin Chary
Hi Anthony, Please merge these two patchs from another age, they fix crash in the VNC server (the iohandler one is only for the threaded server). Thanks, Corentin Chary (1): vnc: don't mess up with iohandlers in the vnc thread Stefan Weil (1): vnc: Limit r/w access to size of allo

[Qemu-devel] [PATCH 2/2] vnc: Limit r/w access to size of allocated memory

2012-03-13 Thread Corentin Chary
From: Stefan Weil This fixes memory reads and writes which exceeded the upper limit of allocated memory vd->guest.ds->data and vd->server->data. Cc: Anthony Liguori Signed-off-by: Stefan Weil --- ui/vnc.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/ui/vnc.c b/ui

[Qemu-devel] [PATCH 1/2] vnc: don't mess up with iohandlers in the vnc thread

2012-03-13 Thread Corentin Chary
From: Corentin Chary The threaded VNC servers messed up with QEMU fd handlers without any kind of locking, and that can cause some nasty race conditions. Using qemu_mutex_lock_iothread() won't work because vnc_dpy_cpy(), which will wait for the current job queue to finish, can be called

Re: [Qemu-devel] [PATCH 0/2] Lost VNC patches

2012-03-14 Thread Corentin Chary
On Wed, Mar 14, 2012 at 11:16 PM, Stefan Weil wrote: > Am 14.03.2012 22:46, schrieb Anthony Liguori: > >> On 03/14/2012 01:58 AM, Corentin Chary wrote: >>> >>> Hi Anthony, >>> >>> Please merge these two patchs from another age, they fix crash in t

Re: [Qemu-devel] qemu-kvm-1.0 crashes with threaded vnc server?

2012-02-28 Thread Corentin Chary
On Mon, Feb 13, 2012 at 10:24 AM, Peter Lieven wrote: > > Am 11.02.2012 um 09:55 schrieb Corentin Chary: > >> On Thu, Feb 9, 2012 at 7:08 PM, Peter Lieven wrote: >>> Hi, >>> >>> is anyone aware if there are still problems when enabling the threaded v

[Qemu-devel] [Bug 806656] Re: Tight PNG VNC encoding is sent even when --disable-vnc-png is set

2011-07-06 Thread Corentin Chary
The patch looks right, maybe you should send it directly to the qemu mailing list. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/806656 Title: Tight PNG VNC encoding is sent even when --disable-vnc

Re: [Qemu-devel] [PATCH] Spelling fixes

2013-07-08 Thread Corentin Chary
quot;is quite the same" >>> and "that of coefficient position". >> "is quite the same" isn't idiomatic English either. I can't >> tell if the author meant "is quite similar" or "is exactly >> the same", so we probabl

Re: [Qemu-devel] [PATCH 1/4] vnc: tight: Fix crash after 2GB of output

2011-04-11 Thread Corentin Chary
Aurelien, could you also take a look at http://patchwork.ozlabs.org/patch/87717/ ? Thanks, -- Corentin Chary http://xf.iksaif.net

Re: [Qemu-devel] [PATCH v3 0/4] Coroutines for better asynchronous programming

2011-05-13 Thread Corentin Chary
how would coroutines help ? Do you plan to rewrite the server using coroutines instead of threads ? Thanks -- Corentin Chary http://xf.iksaif.net

[Qemu-devel] [PATCH v2 00/15] vnc: adapative tight, zrle, zywrle, and bitmap module

2010-11-11 Thread Corentin Chary
other encoding for lossless updates, like zlib or tight. - Bitmap module: create bitmap.h and bitops.h, and remove duplicate code from vnc.c It was my last series from GSoC 2010 context, if necessary I can send different series for adaptive vnc, zrle and bitmap stuff. Thanks, Corentin Char

[Qemu-devel] [PATCH v2 07/15] vnc: palette: and fill and color calls.

2010-11-11 Thread Corentin Chary
These two helpers are needed for zrle and zywrle. Signed-off-by: Corentin Chary --- ui/vnc-palette.c | 33 + ui/vnc-palette.h |3 +++ 2 files changed, 36 insertions(+), 0 deletions(-) diff --git a/ui/vnc-palette.c b/ui/vnc-palette.c index f93250b..d691a0c

[Qemu-devel] [PATCH v2 10/15] vnc: fix lossy rect refreshing

2010-11-11 Thread Corentin Chary
The for loop in send_lossy_rect was totally wrong, and we can't call vnc_set_bits() because it does not really do what it should. Use vnc_set_bit() directly instead. Signed-off-by: Corentin Chary --- ui/vnc.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git

[Qemu-devel] [PATCH v2 01/15] vnc: don't set the quality if lossy encoding are disabled

2010-11-11 Thread Corentin Chary
This should not change the current behavior, but if any new encoding try to use the tight quality, it will always be set to -1 when lossy encodings are disabled. Signed-off-by: Corentin Chary --- ui/vnc.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/ui/vnc.c b/ui

[Qemu-devel] [PATCH v2 03/15] vnc: refresh lossy rect after a given timeout

2010-11-11 Thread Corentin Chary
If an adaptive encoding has choosen to send a lossy update based on the result of vnc_update_freq(), then it should advertise it with vnc_sent_lossy_rect(). This will allow to automatically refresh this rect once it's static again. Signed-off-by: Corentin Chary --- ui/vnc-jobs-async.c |

[Qemu-devel] [PATCH v2 12/15] vnc: use the new generic bitmap functions

2010-11-11 Thread Corentin Chary
Switch to bitmap.h and bitops.h instead of redefining our own bitmap helpers. Signed-off-by: Corentin Chary --- ui/vnc.c | 91 ++--- ui/vnc.h |7 +++-- 2 files changed, 25 insertions(+), 73 deletions(-) diff --git a/ui/vnc.c b/ui

[Qemu-devel] [PATCH v2 05/15] vnc: palette: use a pool to reduce memory allocations

2010-11-11 Thread Corentin Chary
We now that the palette will never have more than 256 elements. Let's use a pool to reduce malloc calls. Signed-off-by: Corentin Chary --- ui/vnc-palette.c | 18 ++ ui/vnc-palette.h |3 ++- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/ui/vnc-palett

[Qemu-devel] [PATCH v2 14/15] vnc: tight: tweak adaptive tight settings

2010-11-11 Thread Corentin Chary
The force_jpeg threshold was too low. Signed-off-by: Corentin Chary --- ui/vnc-enc-tight.c | 20 ++-- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index 81024d5..82c1e96 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc

[Qemu-devel] [PATCH v2 02/15] vnc: add a way to get the update frequency for a given region

2010-11-11 Thread Corentin Chary
rect was not updated in the last 2 second, then the frequency became 0, and all the stored timestamp are reseted. Signed-off-by: Corentin Chary --- ui/vnc.c | 101 ++ ui/vnc.h | 19 +++ 2 files changed, 120 insertions(+), 0

[Qemu-devel] [PATCH v2 04/15] vnc: tight: use the update frequency to choose between lossy and lossless

2010-11-11 Thread Corentin Chary
Use the new update frequency infrastructure to use jpeg for regions with high update frequency. Signed-off-by: Corentin Chary --- ui/vnc-enc-tight.c | 75 +++- 1 files changed, 62 insertions(+), 13 deletions(-) diff --git a/ui/vnc-enc-tight.c b

[Qemu-devel] [PATCH v2 13/15] vnc: don't try to send bigger updates that client height

2010-11-11 Thread Corentin Chary
Respect client size if it doesn't not support desktop resizing. Signed-off-by: Corentin Chary --- ui/vnc.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 600ea75..9189014 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -795,12 +7

[Qemu-devel] [PATCH v2 06/15] vnc: palette: add palette_init calls

2010-11-11 Thread Corentin Chary
This allow to use palette on the stack instead of always allocating them. Signed-off-by: Corentin Chary --- ui/vnc-palette.c |8 +++- ui/vnc-palette.h |1 + 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/ui/vnc-palette.c b/ui/vnc-palette.c index c47420b..f93250b

[Qemu-devel] [PATCH v2 15/15] vnc: add a non-adaptive option

2010-11-11 Thread Corentin Chary
This option allow to disable adaptive behaviors in some encodings. Signed-off-by: Corentin Chary --- qemu-options.hx|9 + ui/vnc-enc-tight.c |2 +- ui/vnc.c | 13 + ui/vnc.h |1 + 4 files changed, 20 insertions(+), 5 deletions(-) diff

[Qemu-devel] [PATCH v2 09/15] vnc: fix uint8_t comparisons with negative values

2010-11-11 Thread Corentin Chary
Signed-off-by: Corentin Chary --- ui/vnc-enc-tight.c |4 ++-- ui/vnc-enc-zrle.c |3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index ad9a9a8..81024d5 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -1546,7

[Qemu-devel] [PATCH v2 11/15] bitmap: add a generic bitmap and bitops library

2010-11-11 Thread Corentin Chary
. Signed-off-by: Corentin Chary --- Makefile.objs |1 + bitmap.c | 255 + bitmap.h | 222 ++ bitops.c | 142 ++ bitops.h | 272

Re: [Qemu-devel] [PATCH v2 11/15] bitmap: add a generic bitmap and bitops library

2010-11-11 Thread Corentin Chary
__ffs(1): 0 ffs(1): 1 This behavior is needed for all the other function to work (and makes more sense that the normal ffs). But .. maybe I should just use ffs() - 1 -- Corentin Chary http://xf.iksaif.net

[Qemu-devel] [PATCH] vnc: qemu can die if the client is disconnected while updating screen

2010-11-26 Thread Corentin Chary
d bug ?), but the destroy call does. Signed-off-by: Corentin Chary --- ui/vnc-jobs-async.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/ui/vnc-jobs-async.c b/ui/vnc-jobs-async.c index 6e9cf08..0b5d750 100644 --- a/ui/vnc-jobs-async.c +++ b/ui/vnc-jobs-async.c @@ -

[Qemu-devel] [PATCH 0/2] vnc: the lost parts

2011-01-25 Thread Corentin Chary
Hi Anthony, If you want to enable vnc threaded server by default, you should really merge these two lost patchs :). Thanks, Corentin Chary (1): vnc: qemu can die if the client is disconnected while updating screen Yoshiaki Tamura (1): vl.c: set NULL upon deleting handlers in

[Qemu-devel] [PATCH 2/2] vnc: qemu can die if the client is disconnected while updating screen

2011-01-25 Thread Corentin Chary
From: Corentin Chary agraf reported that qemu_mutex_destroy(vs->output_mutex) was failing in vnc_disconnect_finish() when the vnc client was disconnected while updating the screen. It's because vnc_worker_thread_loop() tries to unlock the mutex while not locked. Signed-off-by: Corent

[Qemu-devel] [PATCH 1/2] vl.c: set NULL upon deleting handlers in qemu_set_fd_handler2()

2011-01-25 Thread Corentin Chary
s, it'll be called, and then crashes because of lack of resources. This patch fixes it. Signed-off-by: Yoshiaki Tamura Reviewed-by: Corentin Chary --- vl.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index 14255c4..7a26bea 100644 --- a/vl.c +++ b/vl

Re: [Qemu-devel] [PATCH 1/2] vl.c: set NULL upon deleting handlers in qemu_set_fd_handler2()

2011-01-25 Thread Corentin Chary
On Tue, Jan 25, 2011 at 10:03 AM, Stefan Hajnoczi wrote: > On Tue, Jan 25, 2011 at 8:33 AM, Corentin Chary > wrote: >> From: Yoshiaki Tamura >> >> Currently qemu_set_fd_handler2() is only setting ioh->deleted upon >> deleting.  This may cause

Re: [Qemu-devel] Re: Unmaintained QEMU builds

2010-09-06 Thread Corentin Chary
or? Most open source stuff is multiplatform, and serious >> commercial work needs something faster than tcg. >> > > *-user is useful to GCC developers (and used by those who work on the ARM > backend to run the GCC testsuite). > > Paolo > > > Isn't that also used by scratchbox ? -- Corentin Chary http://xf.iksaif.net

Re: [Qemu-devel] qemu: qemu_mutex_lock: Invalid argument

2010-09-14 Thread Corentin Chary
gt; There is two patch for that http://patchwork.ozlabs.org/patch/62420/ http://patchwork.ozlabs.org/patch/62263/ On of these patch is already in master: http://git.qemu.org/qemu.git/commit/?id=ac71103dc6b408775ae72067790ab367912f75ec -- Corentin Chary http://xf.iksaif.net

Re: [Qemu-devel] [RFC/ PATCH 1/4] qemu: Generic asynchronous threading framework to offload tasks

2010-05-24 Thread Corentin Chary
on (even if currently qemu-thread is a direct wrapper to pthread). Thanks, -- Corentin Chary http://xf.iksaif.net

Re: [Qemu-devel] [PATCH 2/5] vnc: send desktopresize event as reply to set encodings

2010-05-25 Thread Corentin Chary
odings message to make sure the client us up to date. I had a similar patch on my queue but yours is probably cleaner :). -- Corentin Chary http://xf.iksaif.net

[Qemu-devel] [PATCH 1/3] vnc: tight: don't forget last pixel in tight_encode_indexed_rect

2010-05-26 Thread Corentin Chary
A simple patch would have been to just remove count -= 1, but this one also replace the while (count--) with a for(i = 0; i < count; i++) which I believe is more easy to understand. Signed-off-by: Corentin Chary --- vnc-encoding-tight.c |9 - 1 files changed, 4 insertions(+)

[Qemu-devel] [PATCH 3/3] vnc: add missing target for vnc-encodings-*.o

2010-05-26 Thread Corentin Chary
vnc-encodings-*.c dependencies where missing. Signed-off-by: Corentin Chary --- Makefile |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8e1f9d6..b264e38 100644 --- a/Makefile +++ b/Makefile @@ -120,11 +120,11 @@ vnc-auth-vencrypt.o: vnc

[Qemu-devel] [PATCH 2/3] vnc: tight: don't forget the third color

2010-05-26 Thread Corentin Chary
While couting color, if the third color was only present one time it wasn't added to the palette. Signed-off-by: Corentin Chary --- vnc-encoding-tight.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/vnc-encoding-tight.c b/vnc-encoding-tight.c index c8effe6..ef

[Qemu-devel] [PATCH 0/3] [RFC] Threaded vnc server

2010-05-29 Thread Corentin Chary
/index.php?post/2010/05/28/QEMU%3A-Threaded-VNC-Server-results Thanks Corentin Chary (3): qemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exit qemu-thread: add cleanup_push() and cleanup_pop() vnc: threaded VNC server Makefile|4 + Makefile.objs |7 +- configure

[Qemu-devel] [PATCH 3/3] vnc: threaded VNC server

2010-05-29 Thread Corentin Chary
onfigure --disable-vnc-thread and a syncrhonous queue of job will be used (which as exactly the same behavior as the old queue). If you disable the VNC thread, all thread related code will not be built and there will be no overhead. Signed-off-by: Corentin Chary --- Makefile|4 + Makef

[Qemu-devel] [PATCH 1/3] qemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exit

2010-05-29 Thread Corentin Chary
Add some missing functions in qemu-thread. Currently qemu-thread is only used for io-thread but it will used by the vnc server soon and we need those functions instead of calling pthread directly. Signed-off-by: Corentin Chary --- qemu-thread.c | 22 ++ qemu-thread.h

[Qemu-devel] [PATCH 2/3] qemu-thread: add cleanup_push() and cleanup_pop()

2010-05-29 Thread Corentin Chary
'}', respectively. This means that variables declared within the scope of paired calls to these functions will only be visible within that scope. Signed-off-by: Corentin Chary --- qemu-thread.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/qemu-th

Re: [Qemu-devel] [PATCH 1/3] vnc: tight: don't forget last pixel in tight_encode_indexed_rect

2010-06-01 Thread Corentin Chary
On Thu, May 27, 2010 at 4:28 PM, Richard Henderson wrote: > On 05/26/2010 11:21 PM, Corentin Chary wrote: >> -        int rep = 0;                                                    \ >> +        int i = 0, rep = 0;                                             \ > > Dead in

[Qemu-devel] [PATCH 0/3] Small tight fixes

2010-06-01 Thread Corentin Chary
Hi, Here is two small tight fix and another small patch related to vnc encodings. Thanks, Corentin Chary (3): vnc: tight: don't forget last pixel in tight_encode_indexed_rect vnc: tight: don't forget the third color vnc: add missing target for vnc-encodings-*.o Makefile

[Qemu-devel] [PATCH 1/3] vnc: tight: don't forget last pixel in tight_encode_indexed_rect

2010-06-01 Thread Corentin Chary
A simple patch would have been to just remove count -= 1, but this one also replace the while (count--) with a for(i = 0; i < count; i++) which I believe is more easy to understand. Signed-off-by: Corentin Chary --- vnc-encoding-tight.c |9 - 1 files changed, 4 insertions(+)

[Qemu-devel] [PATCH 2/3] vnc: tight: don't forget the third color

2010-06-01 Thread Corentin Chary
While couting color, if the third color was only present one time it wasn't added to the palette. Signed-off-by: Corentin Chary --- vnc-encoding-tight.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/vnc-encoding-tight.c b/vnc-encoding-tight.c index c8effe6..ef

[Qemu-devel] [PATCH 3/3] vnc: add missing target for vnc-encodings-*.o

2010-06-01 Thread Corentin Chary
vnc-encodings-*.c dependencies where missing. Signed-off-by: Corentin Chary --- Makefile |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index cc5fc45..221fbd8 100644 --- a/Makefile +++ b/Makefile @@ -120,11 +120,11 @@ vnc-auth-vencrypt.o: vnc

Re: [Qemu-devel] [PATCH] vnc: split encoding in specific files

2010-06-02 Thread Corentin Chary
On Tue, May 4, 2010 at 10:12 AM, Kevin Wolf wrote: > Am 03.05.2010 19:15, schrieb Anthony Liguori: >> On 05/03/2010 07:31 AM, Corentin Chary wrote: >>> This will allow to implement new encodings (tight, zrle, ..) >>> in a cleaner way. This may hurt performances, beca

Re: [Qemu-devel] Re: [PATCH 2/3] qemu-thread: add cleanup_push() and cleanup_pop()

2010-06-03 Thread Corentin Chary
On Thu, Jun 3, 2010 at 9:27 AM, Paolo Bonzini wrote: > On 05/29/2010 09:38 AM, Corentin Chary wrote: >> >> Signed-off-by: Corentin Chary >> --- >>  qemu-thread.h |    4 >>  1 files changed, 4 insertions(+), 0 deletions(-) >> >> diff --git a/q

Re: [Qemu-devel] Re: [PATCH 3/3] vnc: threaded VNC server

2010-06-03 Thread Corentin Chary
On Thu, Jun 3, 2010 at 9:55 AM, Paolo Bonzini wrote: > On 05/29/2010 09:38 AM, Corentin Chary wrote: >> >> 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

[Qemu-devel] Re: [PATCH V3 2/3] qemu: Generic asynchronous threading framework to offload tasks

2010-06-03 Thread Corentin Chary
threads; > +    QTAILQ_INIT(&(queue->request_list)); > +    QTAILQ_INIT(&(queue->work_item_pool)); > +    qemu_mutex_init(&(queue->lock)); > +    qemu_cond_init(&(queue->cond)); > +} > + > +static inline struct work_item *async_work_init(struct async_queue *queue, > +      

[Qemu-devel] [PATCH 3/5] vnc: add lossless option

2010-06-04 Thread Corentin Chary
The lossless option can be used to force lossless compression by disabling all lossy encodings like gradient or jpeg. Signed-off-by: Corentin Chary --- qemu-options.hx |5 + vnc-encoding-tight.c |4 vnc.c|2 ++ vnc.h|2 ++ 4 files

[Qemu-devel] [PATCH 0/5] vnc updates and ui move

2010-06-04 Thread Corentin Chary
Hi, This set starts by adding JPEG and gradient to tight, then move all ui code in the ui/ subdirectory. Thanks, Corentin Chary (5): vnc: tight: add JPEG and gradient subencoding with smooth image detection vnc: JPEG should be disabled if the client don't set tight quality vnc

[Qemu-devel] [PATCH 2/5] vnc: JPEG should be disabled if the client don't set tight quality

2010-06-04 Thread Corentin Chary
Disable JPEG compression by default and only enable it if the VNC client has sent the requested quality. Signed-off-by: Corentin Chary --- vnc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vnc.c b/vnc.c index ed0e096..9cf38d1 100644 --- a/vnc.c +++ b/vnc.c

[Qemu-devel] [PATCH 1/5] vnc: tight: add JPEG and gradient subencoding with smooth image detection

2010-06-04 Thread Corentin Chary
Add gradient filter and JPEG compression with an heuristic to detect how lossy the comppression will be. This code has been adapted from libvncserver/tight.c. JPEG support can be enabled/disabled at compile time with --enable-vnc-jpeg and --disable-vnc-jpeg. Signed-off-by: Corentin Chary

[Qemu-devel] [PATCH v2 1/2] qemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exit

2010-06-04 Thread Corentin Chary
Add some missing functions in qemu-thread. Currently qemu-thread is only used for io-thread but it will used by the vnc server soon and we need those functions instead of calling pthread directly. Signed-off-by: Corentin Chary --- qemu-thread.c | 22 ++ qemu-thread.h

[Qemu-devel] [PATCH v2 0/2] Threaded VNC server

2010-06-04 Thread Corentin Chary
ssues found by Paolo, except the exit condition, mainly because we can only have one queue per VncState (due to zstreams), so this is not really an issue. * Rebased on top of jpeg and ui/ patchs Corentin Chary (2): qemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exit vnc: threaded VNC s

Re: [Qemu-devel] Re: [PATCH V3 1/3] qemu: Add qemu-wrappers for pthread_attr_t

2010-06-04 Thread Corentin Chary
the threads joinable. > > Regards, > > Anthony Liguori Actually, I want to know if the queue is empty and if no job are currently being processed: all worker are idle or stopped. I don't really need pthread_join() for that, since worker can be idle (we don't want to always start and stop the thread :) ). -- Corentin Chary http://xf.iksaif.net

[Qemu-devel] [PATCH v2 2/2] vnc: threaded VNC server

2010-06-04 Thread Corentin Chary
rhead. Signed-off-by: Corentin Chary --- Makefile.objs |7 +- configure | 13 ++ ui/vnc-jobs-sync.c | 65 ++ ui/vnc-jobs.c | 351 ui/vnc.c | 169 ++ ui/vnc.h |

[Qemu-devel] Re: [PATCH 2/5] vnc: JPEG should be disabled if the client don't set tight quality

2010-06-04 Thread Corentin Chary
t. Most vnc clients have this options. -- Corentin Chary http://xf.iksaif.net

[Qemu-devel] Re: [PATCH 4/5] ui: move all ui components in ui/

2010-06-04 Thread Corentin Chary
On Fri, Jun 4, 2010 at 3:18 PM, Alexander Graf wrote: > > On 04.06.2010, at 15:18, Corentin Chary wrote: > >> Move sdl, vnc, curses and cocoa UI into ui/ to cleanup >> the root directory. Also remove some unnecessary explicit >> targets from Makefile. > > There

[Qemu-devel] Re: [PATCH 2/5] vnc: JPEG should be disabled if the client don't set tight quality

2010-06-04 Thread Corentin Chary
;. I'm not sure Anthony agrees on this though. > > Alex > > If client set a quality it means that we are allowed to send something lossy. If you don't want this behavior, you can add the lossless (or lossy) parameter :). -- Corentin Chary http://xf.iksaif.net

[Qemu-devel] Re: [PATCH v2 2/2] vnc: threaded VNC server

2010-06-04 Thread Corentin Chary
oop and an exit flag. >> +    flush = (job->vs->csock != -1&&  job->vs->abording != true); > > and typo still there. Ooops, I did it again. >> +static void *vnc_worker_thread(void *arg) >> +{ >> +    VncJobQueue *queue = arg; > > Also, it's better (future proof) to call qemu_thread_self here. Ok, -- Corentin Chary http://xf.iksaif.net

[Qemu-devel] Re: [PATCH v2 2/2] vnc: threaded VNC server

2010-06-04 Thread Corentin Chary
On Fri, Jun 4, 2010 at 3:25 PM, Alexander Graf wrote: > > On 04.06.2010, at 15:20, Corentin Chary wrote: > >> 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

Re: [Qemu-devel] [PATCH V3 2/3] qemu: Generic asynchronous threading framework to offload tasks

2010-06-05 Thread Corentin Chary
                            int max_threads, int min_threads) >> +{ >> +    queue->cur_threads  = 0; >> +    queue->idle_threads = 0; >> +    queue->max_threads  = max_threads; >> +    queue->min_threads  = min_threads; >> +    QTAILQ_INIT(&(queue->request_list)); >> +    QTAILQ_INIT(&(queue->work_item_pool)); >> +    qemu_mutex_init(&(queue->lock)); >> +    qemu_cond_init(&(queue->cond)); >> +} >> > > I'd prefer there be a single queue that everything used verses multiple > queues.  Otherwise, we'll end up having per device queues and my concern is > that we'll end up with thousands and thousands of threads with no central > place to tune the maximum thread number. If there a single queue, we'll need something to control how job are processed. For example, in the VNC server, they must be processed in order (in fact, in order per VNC client, but I don't see how we could do that). >> +static inline struct work_item *async_work_init(struct async_queue >> *queue, >> +                                  void (*func)(struct work_item *), >> +                                  void *data) >> > > I'd suggest actually using a Notifier as the worker or at least something > that looks exactly like it.  There's no need to pass a void * because more > often than not, a caller just wants to pass a state structure anyway and > they can embed the Notifier within the structure.  IOW: > > async_work_submit(queue, &s->worker); > > Then in the callback: > > DeviceState *s = container_of(worker, DeviceState, worker); > > I don't think the name makes the most sense either.  I think something like: > > threadlet_submit() > > Would work best.  It would be good for there to be a big comment warning > that the routine does not run with the qemu_mutex and therefore cannot make > use of any qemu functions without very special consideration. > > > There shouldn't need to be an explicit init vs. submit function either. > > Regards, > > Anthony Liguori > -- Corentin Chary http://xf.iksaif.net

[Qemu-devel] Re: [PATCH v2 2/2] vnc: threaded VNC server

2010-06-05 Thread Corentin Chary
On Fri, Jun 4, 2010 at 3:44 PM, Alexander Graf wrote: > > On 04.06.2010, at 15:20, Corentin Chary wrote: > >> 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

Re: [Qemu-devel] Re: [PATCH v2 2/2] vnc: threaded VNC server

2010-06-06 Thread Corentin Chary
On Sun, Jun 6, 2010 at 3:54 PM, Avi Kivity wrote: > On 06/05/2010 11:03 AM, Corentin Chary wrote: >>> >>> So it's disabled by default? Sounds like a pretty cool and useful feature >>> to me that should be enabled by default. >>> >> >> Be

Re: [Qemu-devel] [PATCH v2 2/2] vnc: threaded VNC server

2010-06-06 Thread Corentin Chary
On Sun, Jun 6, 2010 at 4:11 PM, Avi Kivity wrote: > On 06/04/2010 04:20 PM, Corentin Chary wrote: >> >> +    if (vnc_trylock_display(vd)) { >> +        vd->timer_interval = VNC_REFRESH_INTERVAL_BASE; >> +        qemu_mod_timer(vd->timer, qemu_get_clock(rt_clock

Re: [Qemu-devel] [PATCH v2 2/2] vnc: threaded VNC server

2010-06-06 Thread Corentin Chary
On Sun, Jun 6, 2010 at 4:53 PM, Avi Kivity wrote: > On 06/06/2010 05:48 PM, Corentin Chary wrote: >> >> On Sun, Jun 6, 2010 at 4:11 PM, Avi Kivity  wrote: >> >>> >>> On 06/04/2010 04:20 PM, Corentin Chary wrote: >>> >>>> >>>&

[Qemu-devel] [PATCH v2 3/6] vnc: add lossy option

2010-06-06 Thread Corentin Chary
The lossy option can be used to enable lossy compression methods like gradient or jpeg. This patch disable them by default. Signed-off-by: Corentin Chary --- qemu-options.hx |7 +++ vnc-encoding-tight.c |4 vnc.c|2 ++ vnc.h|2 ++ 4

[Qemu-devel] [PATCH v2 2/6] vnc: JPEG should be disabled if the client don't set tight quality

2010-06-06 Thread Corentin Chary
Disable JPEG compression by default and only enable it if the VNC client has sent the requested quality. Signed-off-by: Corentin Chary --- vnc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vnc.c b/vnc.c index ed0e096..9cf38d1 100644 --- a/vnc.c +++ b/vnc.c

[Qemu-devel] [PATCH v2 5/6] vnc: rename vnc-encoding-* vnc-enc-*

2010-06-06 Thread Corentin Chary
For the same reason that we don't use vnc-authentication-sasl.c but vnc-auth-sals.c. Because it's to long. Signed-off-by: Corentin Chary --- Makefile.objs|4 ++-- ui/{vnchextile.h => vnc-enc-hextile-template.h} |0 ui/{vnc-encod

[Qemu-devel] [PATCH v2 1/6] vnc: tight: add JPEG and gradient subencoding with smooth image detection

2010-06-06 Thread Corentin Chary
Add gradient filter and JPEG compression with an heuristic to detect how lossy the comppression will be. This code has been adapted from libvncserver/tight.c. JPEG support can be enabled/disabled at compile time with --enable-vnc-jpeg and --disable-vnc-jpeg. Signed-off-by: Corentin Chary

[Qemu-devel] [PATCH v2 4/6] ui: move all ui components in ui/

2010-06-06 Thread Corentin Chary
Move sdl, vnc, curses and cocoa UI into ui/ to cleanup the root directory. Also remove some unnecessary explicit targets from Makefile. Signed-off-by: Corentin Chary --- Makefile | 38 +++- Makefile.objs

[Qemu-devel] [PATCH v2 0/6] vnc updates and ui move

2010-06-06 Thread Corentin Chary
Hi, This set starts by adding JPEG and gradient to tight, then move all ui code in the ui/ subdirectory. Thanks, Since v1: * Format patch with rename detection * Add "lossy" parameter instead of "lossless" * Disable lossy encodings by default * Add a small tight fix (for index

[Qemu-devel] [PATCH v2 6/6] vnc: tight: don't forget to add the last color

2010-06-06 Thread Corentin Chary
While using indexed colors, the last color was never added to the palette. Triggered with ubuntu livecd. Signed-off-by: Corentin Chary --- ui/vnc-enc-tight.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index 6db5570..77fcdf7

[Qemu-devel] [PATCH v3 1/2] qemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exit

2010-06-09 Thread Corentin Chary
Add some missing functions in qemu-thread. Currently qemu-thread is only used for io-thread but it will used by the vnc server soon and we need those functions instead of calling pthread directly. Signed-off-by: Corentin Chary --- qemu-thread.c | 22 ++ qemu-thread.h

[Qemu-devel] [PATCH v3 0/2] Threaded VNC server

2010-06-09 Thread Corentin Chary
ere in a specific structure, but this is a lot of changes, and as I'm also working on encodings, I want this patch to be easy to rebase. So I'll do as soon as the VNC server is merged. Corentin Chary (2): qemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exit vnc: threaded VNC serv

[Qemu-devel] [PATCH v3 2/2] vnc: threaded VNC server

2010-06-09 Thread Corentin Chary
rhead. Signed-off-by: Corentin Chary --- Makefile.objs |7 +- configure | 13 ++ ui/vnc-jobs-async.c | 357 +++ ui/vnc-jobs-sync.c | 73 +++ ui/vnc-jobs.h | 87 + ui/vnc.c|

[Qemu-devel] [PATCH 02/16] vnc: JPEG should be disabled if the client don't set tight quality

2010-06-15 Thread Corentin Chary
Disable JPEG compression by default and only enable it if the VNC client has sent the requested quality. Signed-off-by: Corentin Chary --- vnc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vnc.c b/vnc.c index ed0e096..9cf38d1 100644 --- a/vnc.c +++ b/vnc.c

[Qemu-devel] [PATCH 03/16] vnc: add lossy option

2010-06-15 Thread Corentin Chary
The lossy option can be used to enable lossy compression methods like gradient or jpeg. This patch disable them by default. Signed-off-by: Corentin Chary --- qemu-options.hx |7 +++ vnc-encoding-tight.c |4 vnc.c|2 ++ vnc.h|2 ++ 4

[Qemu-devel] [PATCH 06/16] vnc: tight: don't forget do at the last color

2010-06-15 Thread Corentin Chary
While using indexed colors, the last color was never added to the palette. Triggered with ubuntu livecd. Signed-off-by: Corentin Chary --- ui/vnc-enc-tight.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index 358221d..ade8e5f

[Qemu-devel] [PATCH 04/16] ui: move all ui components in ui/

2010-06-15 Thread Corentin Chary
Move sdl, vnc, curses and cocoa UI into ui/ to cleanup the root directory. Also remove some unnecessary explicit targets from Makefile. Signed-off-by: Corentin Chary --- Makefile | 38 +++- Makefile.objs

[Qemu-devel] [PATCH 05/16] vnc: rename vnc-encoding-* vnc-enc-*

2010-06-15 Thread Corentin Chary
For the same reason that we don't use vnc-authentication-sasl.c but vnc-auth-sals.c. Because it's to long. Signed-off-by: Corentin Chary --- Makefile.objs|4 ++-- ui/{vnchextile.h => vnc-enc-hextile-template.h} |0 ui/{vnc-encod

[Qemu-devel] [PATCH 07/16] vnc: tight: remove a memleak in send_jpeg_rect()

2010-06-15 Thread Corentin Chary
buf was never freed. Signed-off-by: Corentin Chary --- ui/vnc-enc-tight.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index ade8e5f..4ff88a8 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -1247,8 +1247,6

[Qemu-devel] [PATCH 09/16] vnc: tight: specific zlib level and filters for each compression level

2010-06-15 Thread Corentin Chary
he 80 col limit. * PNG_ macros are only defined if CONFIG_VNC_PNG is defined Signed-off-by: Corentin Chary --- ui/vnc-enc-tight.c | 19 ++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index 007d88f..9e1f214 100644 -

[Qemu-devel] [PATCH 01/16] vnc: tight: add JPEG and gradient subencoding with smooth image detection

2010-06-15 Thread Corentin Chary
Add gradient filter and JPEG compression with an heuristic to detect how lossy the comppression will be. This code has been adapted from libvncserver/tight.c. JPEG support can be enabled/disabled at compile time with --enable-vnc-jpeg and --disable-vnc-jpeg. Signed-off-by: Corentin Chary

[Qemu-devel] [PATCH 00/16] VNC updates for 0.13

2010-06-15 Thread Corentin Chary
, and as I'm also working on encodings, I want this patch to be easy to rebase. So I'll do as soon as the VNC server is merged. Since v3: * Encoding are data is now in specific structures, that makes vnc_async_encoding_start a lot cleaner. * Added a missing vnc_output_lock(vs) Coren

[Qemu-devel] [PATCH 13/16] qemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exit

2010-06-15 Thread Corentin Chary
Add some missing functions in qemu-thread. Currently qemu-thread is only used for io-thread but it will used by the vnc server soon and we need those functions instead of calling pthread directly. Signed-off-by: Corentin Chary --- qemu-thread.c | 22 ++ qemu-thread.h

[Qemu-devel] [PATCH 08/16] vnc: tight add PNG encoding

2010-06-15 Thread Corentin Chary
/ Signed-off-by: Corentin Chary --- Makefile.target|1 + configure | 37 +++ ui/vnc-enc-tight.c | 277 ++-- ui/vnc-enc-tight.h | 17 ++-- ui/vnc.c |9 +- ui/vnc.h | 11 ++ 6 files changed, 311

[Qemu-devel] [PATCH 15/16] vnc: add missing lock for vnc_cursor_define()

2010-06-15 Thread Corentin Chary
All vnc_write() calls must be locked (except the ones present before the protocol initialization). Signed-off-by: Corentin Chary --- ui/vnc.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index cffe238..61f9a05 100644 --- a/ui/vnc.c +++ b/ui/vnc.c

[Qemu-devel] [PATCH 10/16] vnc: tight: stop using qdict for palette stuff

2010-06-15 Thread Corentin Chary
doesn't suffer from the QObject overhead. Signed-off-by: Corentin Chary --- Makefile.objs |2 +- ui/vnc-enc-tight.c | 163 +++ ui/vnc-palette.c | 136 +++ ui/vnc-palette.h |

[Qemu-devel] [PATCH 11/16] vnc: encapsulate encoding members

2010-06-15 Thread Corentin Chary
This will allow to implement the threaded VNC server in a more cleaner way. Signed-off-by: Corentin Chary --- ui/vnc-enc-hextile.c | 14 ++-- ui/vnc-enc-tight.c | 194 +- ui/vnc-enc-zlib.c| 34 +- ui/vnc.c |8

[Qemu-devel] [PATCH 12/16] vnc: fix tight png memory leak

2010-06-15 Thread Corentin Chary
The tight.png buffer was never released. Signed-off-by: Corentin Chary --- ui/vnc-enc-tight.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index dbde08d..1d926c9 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c

[Qemu-devel] [PATCH 16/16] vnc: tight: don't limit png rect size

2010-06-15 Thread Corentin Chary
PNG was introduced because some vnc HTML5 clients like noVNC have slow zlib decoding, but really fast PNG rendering. This means that if PNG is enabled we should send only PNG (and JPEG, fill), and never something compressed directly with zlib. Signed-off-by: Corentin Chary --- ui/vnc-enc

[Qemu-devel] [PATCH 14/16] vnc: threaded VNC server

2010-06-15 Thread Corentin Chary
rhead. Signed-off-by: Corentin Chary --- Makefile.objs |7 +- configure | 13 ++ ui/vnc-jobs-async.c | 331 +++ ui/vnc-jobs-sync.c | 73 +++ ui/vnc-jobs.h | 87 ++ ui/vnc.c|

[Qemu-devel] Re: [PATCH 01/16] vnc: tight: add JPEG and gradient subencoding with smooth image detection

2010-06-16 Thread Corentin Chary
On Wed, Jun 16, 2010 at 3:18 PM, Juan Quintela wrote: > Corentin Chary wrote: >> Add gradient filter and JPEG compression with an heuristic to detect how >> lossy the comppression will be. This code has been adapted from >> libvncserver/tight.c. >> >> JPEG s

Re: [Qemu-devel] Re: [PATCH V4 2/3] qemu: Generic task offloading framework: threadlets

2010-06-16 Thread Corentin Chary
iting until it >>> gets more work (which would mean it's not actually idle)... >> >> Agreed---no cancellation, please. >> >> BTW it's obviously okay with signaling the condition when a threadlet is >> submitted.  But when something affects all queue

  1   2   3   >