[Spice-devel] [PATCH spice-server 2/2] stream-device: Handle capabilities

2018-03-19 Thread Frediano Ziglio
Handle capabilities from guest device. Send capability to the guest when device is opened. Currently there's no capabilities set on the message sent. On the tests we need to discard the capability message before reading the error. Signed-off-by: Frediano Ziglio --- server/red-stream-device.c

Re: [Spice-devel] [PATCH spice-server] video-stream: Improve RedUpgradeItem documentation

2018-03-19 Thread Uri Lublin
On 03/19/2018 11:32 AM, Frediano Ziglio wrote: Artifacts are due to lossy compression of streaming Signed-off-by: Frediano Ziglio Ack. --- server/video-stream.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/video-stream.h b/server/video-stream.h index e1b

Re: [Spice-devel] [PATCH spice-common 1/2] Add --enable-extra-checks option

2018-03-19 Thread Eduardo Lima (Etrunko)
Acked-by: Eduardo Lima (Etrunko) On 19/03/18 10:46, Frediano Ziglio wrote: > Allow to enable code to do additional or expensive checks. > The option should be used by higher level libraries. > By default the option is disabled. > > Signed-off-by: Frediano Ziglio > --- > common/log.h | 6 +

Re: [Spice-devel] [PATCH spice-server 2/2] Use --enable-extra-checks option provided by spice-common

2018-03-19 Thread Eduardo Lima (Etrunko)
Acked-by: Eduardo Lima (Etrunko) On 19/03/18 10:46, Frediano Ziglio wrote: > Reuse option from common code. > Also reuse spice_extra_checks constant instead of using the preprocessor > macro directly. > > Signed-off-by: Frediano Ziglio > --- > configure.ac | 9 + > serve

[Spice-devel] [PATCH spice-server 2/2] Use --enable-extra-checks option provided by spice-common

2018-03-19 Thread Frediano Ziglio
Reuse option from common code. Also reuse spice_extra_checks constant instead of using the preprocessor macro directly. Signed-off-by: Frediano Ziglio --- configure.ac | 9 + server/display-channel.c | 2 +- server/red-stream-device.c | 6 +++--- server/reds.c

[Spice-devel] [PATCH spice-common 1/2] Add --enable-extra-checks option

2018-03-19 Thread Frediano Ziglio
Allow to enable code to do additional or expensive checks. The option should be used by higher level libraries. By default the option is disabled. Signed-off-by: Frediano Ziglio --- common/log.h | 6 ++ configure.ac | 1 + m4/spice-deps.m4 | 14 ++ 3 files changed, 21 i

Re: [Spice-devel] [PATCH spice-server 1/2] Change ENABLE_EXTRA_CHECKS statements to #ifdef

2018-03-19 Thread Eduardo Lima (Etrunko)
On 19/03/18 06:28, Frediano Ziglio wrote: >> >> On 15/03/18 14:20, Christophe Fergeau wrote: >>> On Tue, Mar 13, 2018 at 10:37:46AM -0300, Eduardo Lima (Etrunko) wrote: On 13/03/18 04:21, Frediano Ziglio wrote: >> >> This patch makes it clear that this is a configure switch and not a >

Re: [Spice-devel] [PATCH spice-server] stream-channel: Implements monitors_config

2018-03-19 Thread Frediano Ziglio
> > On 03/13/2018 08:21 AM, Frediano Ziglio wrote: > > Although not necessary for a single monitor DisplayChannel implementation > > this make the DiisplayChannels more coherent from the client > > point of view. > > > > Signed-off-by: Frediano Ziglio > > --- > > server/stream-channel.c | 33 +

[Spice-devel] [PATCH spice-common 3/3] Avoid integer overflow computing image sizes

2018-03-19 Thread Frediano Ziglio
Use always 64, sizes can be 32x32. Signed-off-by: Frediano Ziglio --- python_modules/demarshal.py | 14 ++ python_modules/marshal.py | 7 +++ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py index 7e73985

[Spice-devel] [PATCH spice-common 0/3] Fix some possible overflows in client

2018-03-19 Thread Frediano Ziglio
This fix https://bugzilla.redhat.com/show_bug.cgi?id=1501200. Frediano Ziglio (3): Fix integer overflows computing sizes Write a small test to test possible crash Avoid integer overflow computing image sizes python_modules/demarshal.py | 52 ++-- python_modules/mars

[Spice-devel] [PATCH spice-common 1/3] Fix integer overflows computing sizes

2018-03-19 Thread Frediano Ziglio
Make code safe using both 32 and 64 bit machine. Consider that this code can be compiled for machines with 32 bit. There are some arrays length which are 32 bit. If size_t this can cause easily an overflow. For instance message_len sending SPICE_MSG_NOTIFY messages are 32 bit and code add a small

[Spice-devel] [PATCH spice-common 2/3] Write a small test to test possible crash

2018-03-19 Thread Frediano Ziglio
This small test prove a that current generated demarshaller code is not safe to integer overflows leading to buffer overflows. Actually from a quick look at the protocol it seems that client can't cause these overflows but server can quite easily at demonstrated by this test. Signed-off-by: Fredia

[Spice-devel] [PATCH spice-server] video-stream: Improve RedUpgradeItem documentation

2018-03-19 Thread Frediano Ziglio
Artifacts are due to lossy compression of streaming Signed-off-by: Frediano Ziglio --- server/video-stream.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/video-stream.h b/server/video-stream.h index e1bd0d5a..b733771b 100644 --- a/server/video-stream.h +++ b/ser

Re: [Spice-devel] [PATCH spice-server 1/2] Change ENABLE_EXTRA_CHECKS statements to #ifdef

2018-03-19 Thread Frediano Ziglio
> > On 15/03/18 14:20, Christophe Fergeau wrote: > > On Tue, Mar 13, 2018 at 10:37:46AM -0300, Eduardo Lima (Etrunko) wrote: > >> On 13/03/18 04:21, Frediano Ziglio wrote: > > This patch makes it clear that this is a configure switch and not a > variable defined somewhere else in th