Re: [Spice-devel] Postcopy+spice crash

2016-12-06 Thread Dr. David Alan Gilbert
* Gerd Hoffmann (kra...@redhat.com) wrote: > Hi, > > Yep, spice worker thread ... > > > Thread 7 (Thread 0x7fbe7f9ff700 (LWP 22383)): > > #0 0x7fc0aa42f49d in read () from /lib64/libpthread.so.0 > > #1 0x7fc0a8c36c01 in spice_backtrace_gstack () from > > /lib64/libspice-server.so.1 >

Re: [Spice-devel] [spice PATCH v2 2/6] image_encoders: check shared_dict before accessing it

2016-12-06 Thread Frediano Ziglio
> > In both image_encoders_restore_glz_dictionary() and > image_encoders_get_glz_dictionary() shared-dict may > be NULL if size is too large, and the server gets > size from the network. > > Both functions end up calling glz_enc_dictionary_create() > that calls glz_dictionary_window_create() wher

Re: [Spice-devel] [spice PATCH v2 1/6] display-channel: current_remove: rename inner variable 'container'

2016-12-06 Thread Frediano Ziglio
> > It shadows the outer one. > > Renamed also the outer 'container' variable. > > Signed-off-by: Uri Lublin > --- > server/display-channel.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/server/display-channel.c b/server/display-channel.c > index 061a9

Re: [Spice-devel] [spice PATCH v2 3/6] red_get_image_data_flat: allocate mem after sanity check

2016-12-06 Thread Frediano Ziglio
> > This patch prevents possible memory leak. > > Found by coverity. > > Signed-off-by: Uri Lublin > --- > server/red-parse-qxl.c | 11 +++ > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/server/red-parse-qxl.c b/server/red-parse-qxl.c > index 11da3a1..89cb120 10064

Re: [Spice-devel] [spice PATCH v2 5/6] red-record-qxl: child_output_setup: remove fcntl call

2016-12-06 Thread Frediano Ziglio
> > man 2 dup2 specifies: > The close-on-exec flag (FD_CLOEXEC; see fcntl(2)) for > the duplicate descriptor is off. > > Since the purpose of the fcntl call is to turn off FD_CLOEXEC > flag, and it's already done, just remove this call. > > Suggested-by: Frediano Ziglio > Signed-off-by: U

Re: [Spice-devel] [spice PATCH v2 4/6] red-record-qxl: add curly braces to empty while loop

2016-12-06 Thread Frediano Ziglio
> > Spice coding style suggests to use curly braces > for while blocks. > > Some prefer the block to not be empty so continue > is untouched. > > Signed-off-by: Uri Lublin > --- > server/red-record-qxl.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/server/red

Re: [Spice-devel] [spice PATCH v2 6/6] dispatcher: write_safe: move EINTR debug message

2016-12-06 Thread Frediano Ziglio
> > spice_debug was called for not-EINTR case, move > it to the right place. > > Signed-off-by: Uri Lublin > --- > server/dispatcher.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/server/dispatcher.c b/server/dispatcher.c > index f0479aa..f4fe97b 100644 > --- a/serv

Re: [Spice-devel] [PATCH spice-server v3] tests: Apply same warning level as main server code

2016-12-06 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Tue, Dec 06, 2016 at 03:05:48PM +, Frediano Ziglio wrote: > Allow to catch minor issue with test code. > Although test usually are coded with less care than production > code the current changes required are not so extensive and > can catch different issues. >

[Spice-devel] [spice PATCH v2 5/6] red-record-qxl: child_output_setup: remove fcntl call

2016-12-06 Thread Uri Lublin
man 2 dup2 specifies: The close-on-exec flag (FD_CLOEXEC; see fcntl(2)) for the duplicate descriptor is off. Since the purpose of the fcntl call is to turn off FD_CLOEXEC flag, and it's already done, just remove this call. Suggested-by: Frediano Ziglio Signed-off-by: Uri Lublin --- serve

[Spice-devel] [spice PATCH v2 6/6] dispatcher: write_safe: move EINTR debug message

2016-12-06 Thread Uri Lublin
spice_debug was called for not-EINTR case, move it to the right place. Signed-off-by: Uri Lublin --- server/dispatcher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/dispatcher.c b/server/dispatcher.c index f0479aa..f4fe97b 100644 --- a/server/dispatcher.c +++ b/ser

[Spice-devel] [spice PATCH v2 3/6] red_get_image_data_flat: allocate mem after sanity check

2016-12-06 Thread Uri Lublin
This patch prevents possible memory leak. Found by coverity. Signed-off-by: Uri Lublin --- server/red-parse-qxl.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/red-parse-qxl.c b/server/red-parse-qxl.c index 11da3a1..89cb120 100644 --- a/server/red-parse-

[Spice-devel] [spice PATCH v2 4/6] red-record-qxl: add curly braces to empty while loop

2016-12-06 Thread Uri Lublin
Spice coding style suggests to use curly braces for while blocks. Some prefer the block to not be empty so continue is untouched. Signed-off-by: Uri Lublin --- server/red-record-qxl.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/red-record-qxl.c b/server/red-

[Spice-devel] [spice PATCH v2 2/6] image_encoders: check shared_dict before accessing it

2016-12-06 Thread Uri Lublin
In both image_encoders_restore_glz_dictionary() and image_encoders_get_glz_dictionary() shared-dict may be NULL if size is too large, and the server gets size from the network. Both functions end up calling glz_enc_dictionary_create() that calls glz_dictionary_window_create() where size is checked

[Spice-devel] [spice PATCH v2 1/6] display-channel: current_remove: rename inner variable 'container'

2016-12-06 Thread Uri Lublin
It shadows the outer one. Renamed also the outer 'container' variable. Signed-off-by: Uri Lublin --- server/display-channel.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/display-channel.c b/server/display-channel.c index 061a99d..c6ab57d 100644 --- a/

[Spice-devel] [spice PATCH v2 0/6] More coverity fixes v2

2016-12-06 Thread Uri Lublin
changes since v1: Patch 1/6 better variable names (Frediano) Patch 2/6 return only after lock was released (Frediano) Patch 3/6 unchanged (same as Patch 6/8 of v1) Patch 4/6 kept both curly braces and continue (7/8) (Frediano) Patch 5/6 removed fcntl altogether (8/8) (Frediano) Pa

Re: [Spice-devel] [PATCH spice-common] Marshaller: rename _add_ref() to _add_by_ref()

2016-12-06 Thread Christophe Fergeau
On Tue, Dec 06, 2016 at 09:33:51AM -0600, Jonathon Jongsma wrote: > On Tue, 2016-12-06 at 10:49 +0100, Christophe Fergeau wrote: > > On Mon, Dec 05, 2016 at 04:19:04PM -0600, Jonathon Jongsma wrote: > > > > > > The spice_marshaller_add_ref() family of functions is confusing > > > since it > > > so

Re: [Spice-devel] [PATCH spice-common] Marshaller: rename _add_ref() to _add_by_ref()

2016-12-06 Thread Jonathon Jongsma
On Tue, 2016-12-06 at 10:49 +0100, Christophe Fergeau wrote: > On Mon, Dec 05, 2016 at 04:19:04PM -0600, Jonathon Jongsma wrote: > > > > The spice_marshaller_add_ref() family of functions is confusing > > since it > > sounds like you're incrementing a reference on the marshaller. What > > it > > i

[Spice-devel] [PATCH spice-server v3] tests: Apply same warning level as main server code

2016-12-06 Thread Frediano Ziglio
Allow to catch minor issue with test code. Although test usually are coded with less care than production code the current changes required are not so extensive and can catch different issues. Most of the patch is making functions static to avoid warnings for undeclared functions. Signed-off-by: F

Re: [Spice-devel] [PATCH spice-server v2] tests: Apply same same warning level of main server code

2016-12-06 Thread Christophe Fergeau
On Tue, Dec 06, 2016 at 02:34:14PM +, Frediano Ziglio wrote: > Allow to catch minor issue with test code. > Although test usually are coded with less care than production > code the current changes required are not so extensive and > can catch different issues. Looks like this adds one prototy

Re: [Spice-devel] [RFC PATCH spice-server 0/2] RHEL7 improvements

2016-12-06 Thread Frediano Ziglio
> > Hi, > > On Tue, Dec 06, 2016 at 12:28:31PM +, Frediano Ziglio wrote: > > These 2 patches attempt to join images split by RHEL7 graphic > > stack (Mesa) decreasing commands handled by spice-server. > > > > You can see the difference between the 2 video: > > - https://www.youtube.com/watch?

[Spice-devel] [PATCH spice-server v2] tests: Apply same same warning level of main server code

2016-12-06 Thread Frediano Ziglio
Allow to catch minor issue with test code. Although test usually are coded with less care than production code the current changes required are not so extensive and can catch different issues. Signed-off-by: Frediano Ziglio --- server/tests/Makefile.am | 1 + server/tests/

Re: [Spice-devel] [PATCH v4 06/17] sound: Implements config_socket RedChannel callback

2016-12-06 Thread Frediano Ziglio
> > On Mon, Dec 05, 2016 at 09:16:45AM -0500, Frediano Ziglio wrote: > > > > > > On Thu, Dec 01, 2016 at 03:43:01PM -0600, Jonathon Jongsma wrote: > > > > On Thu, 2016-12-01 at 11:24 +, Frediano Ziglio wrote: > > > > > This code is the same inside __new_channel but will set the > > > > > Reds

Re: [Spice-devel] [RFC PATCH spice-server 0/2] RHEL7 improvements

2016-12-06 Thread Victor Toso
Hi, On Tue, Dec 06, 2016 at 12:28:31PM +, Frediano Ziglio wrote: > These 2 patches attempt to join images split by RHEL7 graphic > stack (Mesa) decreasing commands handled by spice-server. > > You can see the difference between the 2 video: > - https://www.youtube.com/watch?v=OarV6zUmUdg (befo

Re: [Spice-devel] [PATCH v4 06/17] sound: Implements config_socket RedChannel callback

2016-12-06 Thread Christophe Fergeau
On Mon, Dec 05, 2016 at 09:16:45AM -0500, Frediano Ziglio wrote: > > > > On Thu, Dec 01, 2016 at 03:43:01PM -0600, Jonathon Jongsma wrote: > > > On Thu, 2016-12-01 at 11:24 +, Frediano Ziglio wrote: > > > > This code is the same inside __new_channel but will set the > > > > RedsStream from Red

Re: [Spice-devel] [PATCH spice-server] Compile all tests with same warning level of main server code

2016-12-06 Thread Christophe Fergeau
On Tue, Dec 06, 2016 at 02:27:55PM +0100, Pavel Grunt wrote: > Hi, it looks fine - i would consider a split fixing the warnings due > to missing static and then enabling warnings. > > up to you, ack from me Personally I would nack this as the log only matches the first hunk of this patch. Christ

Re: [Spice-devel] [PATCH spice-server] Compile all tests with same warning level of main server code

2016-12-06 Thread Pavel Grunt
Hi, it looks fine - i would consider a split fixing the warnings due to missing static and then enabling warnings. up to you, ack from me Pavel On Tue, 2016-12-06 at 13:18 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- >  server/tests/Makefile.am   |  1

Re: [Spice-devel] [PATCH spice 1/3] build-sys: Use variable instead of number

2016-12-06 Thread Pavel Grunt
On Tue, 2016-12-06 at 07:48 -0500, Frediano Ziglio wrote: > > - Original Message - > > From: "Pavel Grunt" > > To: spice-devel@lists.freedesktop.org > > Sent: Monday, December 5, 2016 2:49:47 PM > > Subject: [Spice-devel] [PATCH spice 1/3] build-sys: Use variable > > instead of number >

[Spice-devel] [PATCH spice-server] Compile all tests with same warning level of main server code

2016-12-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/tests/Makefile.am | 1 + server/tests/stat-test.c | 1 + server/tests/test-display-base.c | 17 ++-- server/tests/test-display-no-ssl.c | 2 +- server/tests/test-display-reso

Re: [Spice-devel] [PATCH spice-server] build: Remove not existing include directory

2016-12-06 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Tue, Dec 06, 2016 at 12:53:31PM +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/tests/Makefile.am | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am > index c55d21d..8995859

[Spice-devel] [PATCH spice-server 3/3] Add message counters to statistics

2016-12-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/red-channel.c | 4 1 file changed, 4 insertions(+) diff --git a/server/red-channel.c b/server/red-channel.c index 03443ba..4a4f20c 100644 --- a/server/red-channel.c +++ b/server/red-channel.c @@ -103,6 +103,7 @@ struct RedChannelPrivate RedsSta

[Spice-devel] [PATCH spice-server 1/3] Improve statistic code interface

2016-12-06 Thread Frediano Ziglio
Use new structures and functions to implement statistic code. Instead of using macro use inline functions. Inline functions are more type safe. If statistics are disabled structure and functions became empty; this allow the code to work and compile with either statistic disabled or enabled not requ

[Spice-devel] [PATCH spice-server 2/3] spicevmc: Add some statistics

2016-12-06 Thread Frediano Ziglio
Allows to see compressed/uncompressed ratio Signed-off-by: Frediano Ziglio --- server/spicevmc.c | 17 + 1 file changed, 17 insertions(+) diff --git a/server/spicevmc.c b/server/spicevmc.c index 039a50a..8313db6 100644 --- a/server/spicevmc.c +++ b/server/spicevmc.c @@ -114,6 +1

[Spice-devel] [PATCH spice-server] build: Remove not existing include directory

2016-12-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/tests/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am index c55d21d..8995859 100644 --- a/server/tests/Makefile.am +++ b/server/tests/Makefile.am @@ -2,7 +2,6 @@ NULL = AM_CPPFLAGS =

Re: [Spice-devel] [PATCH spice 2/3] build-sys: Require GLIB 2.28

2016-12-06 Thread Frediano Ziglio
> > We are already using it > --- > configure.ac | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/configure.ac b/configure.ac > index cd78f08f..c978b924 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -148,7 +148,7 @@ SPICE_PROTOCOL_MIN_VER=0.12.12 > PKG_CHECK_MODU

Re: [Spice-devel] [spice v2] display-channel: Make video-codecs property read-write

2016-12-06 Thread Victor Toso
Hi, On Mon, Dec 05, 2016 at 03:10:43PM -0600, Jonathon Jongsma wrote: > Looks fine to me. > > Acked-by: Jonathon Jongsma Thanks, pushed as f007c0a9915342b > > On Mon, 2016-12-05 at 14:59 +0100, Victor Toso wrote: > > From: Victor Toso > > > > This patch creates display_channel_get_video_cod

Re: [Spice-devel] [PATCH spice 1/3] build-sys: Use variable instead of number

2016-12-06 Thread Frediano Ziglio
- Original Message - > From: "Pavel Grunt" > To: spice-devel@lists.freedesktop.org > Sent: Monday, December 5, 2016 2:49:47 PM > Subject: [Spice-devel] [PATCH spice 1/3] build-sys: Use variable instead of > number > Patch looks good, I would just extend to: "build-sys: Use variable

Re: [Spice-devel] Postcopy+spice crash

2016-12-06 Thread Gerd Hoffmann
Hi, Yep, spice worker thread ... > Thread 7 (Thread 0x7fbe7f9ff700 (LWP 22383)): > #0 0x7fc0aa42f49d in read () from /lib64/libpthread.so.0 > #1 0x7fc0a8c36c01 in spice_backtrace_gstack () from > /lib64/libspice-server.so.1 > #2 0x7fc0a8c3e4f7 in spice_logv () from /lib64/libspi

[Spice-devel] [PATCH spice-server 1/2] RFC: Join drawables to improve rhel7 behavior

2016-12-06 Thread Frediano Ziglio
Due to the way RHEL7 works the images came out from guest using multiple commands. This increase the commands to the client and cause the video code to create and handle multiple streams creating some visual glitches. This patch attempt to detect and join the multiple commands to avoid these issues

[Spice-devel] [PATCH spice-server 2/2] RFC: Handle timeout for joining drawables

2016-12-06 Thread Frediano Ziglio
The previous patch join correctly the commands however if there are no more commands the command joined is delayed till new commands arrive. This patch introduce a timeout (currently 10 ms) after the command is executed. Signed-off-by: Frediano Ziglio --- server/red-worker.c | 19 +++

[Spice-devel] [RFC PATCH spice-server 0/2] RHEL7 improvements

2016-12-06 Thread Frediano Ziglio
These 2 patches attempt to join images split by RHEL7 graphic stack (Mesa) decreasing commands handled by spice-server. You can see the difference between the 2 video: - https://www.youtube.com/watch?v=OarV6zUmUdg (before) - https://www.youtube.com/watch?v=5fTdCCbFeCg (after) These video are reali

Re: [Spice-devel] Postcopy+spice crash

2016-12-06 Thread Dr. David Alan Gilbert
* Gerd Hoffmann (kra...@redhat.com) wrote: > Hi, > > > >> On a quick glance I'd blame the guest for sending corrupted commands. > > >> Strange though that it happens on migration only, so there could be > > >> a host issue too. Or a timing issue triggered by migration. > > >> > > >> Which migra

Re: [Spice-devel] [PATCH spice-common] Marshaller: rename _add_ref() to _add_by_ref()

2016-12-06 Thread Christophe Fergeau
On Mon, Dec 05, 2016 at 04:19:04PM -0600, Jonathon Jongsma wrote: > The spice_marshaller_add_ref() family of functions is confusing since it > sounds like you're incrementing a reference on the marshaller. What it > is actually doing is adding a data buffer to the marshaller by reference > rather t