Re: [Spice-devel] [vdagent-win PATCH] file-xfer: handle_start: use snprintf instead of sprintf_s

2019-03-03 Thread Uri Lublin
On 3/3/19 12:26 PM, Uri Lublin wrote: On 2/28/19 3:12 PM, Frediano Ziglio wrote: On 2/25/19 4:12 PM, Frediano Ziglio wrote: When building with older mingw, sprintf_s does not always work as expected, but snprintf does. Also it's more consistent in the file. Note that when building with VS,

[Spice-devel] [PATCH spice-common 9/9] codegen: Rename --prefix parameter to --suffix

2019-03-03 Thread Frediano Ziglio
The option is used to add a suffix to public functions, not a prefix. Currently the option is not used (it was used to generate protocol 1 code). Signed-off-by: Frediano Ziglio --- python_modules/codegen.py | 2 +- python_modules/demarshal.py | 10 +- python_modules/marshal.py | 4

[Spice-devel] [PATCH spice-common 6/9] Generate automatically most C message declarations

2019-03-03 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- common/messages.h | 495 +- spice.proto | 192 +- 2 files changed, 102 insertions(+), 585 deletions(-) diff --git a/common/messages.h b/common/messages.h index 36ee59d..5cda1d1 100644 ---

[Spice-devel] [PATCH spice-common 5/9] Allow to generate C declarations for spice.proto

2019-03-03 Thread Frediano Ziglio
Generate and include C declarations. Next patch will use this facility. Signed-off-by: Frediano Ziglio --- common/Makefile.am | 6 -- common/meson.build | 10 +- common/messages.h | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/common/Makefile.am

[Spice-devel] [PATCH spice-common 0/9] Miscellaneous code generation improvements

2019-03-03 Thread Frediano Ziglio
Part of the series already sent. Frediano Ziglio (9): messages: Remove fields not used by the protocol codegen: Factor out a function to write output file codegen: Generate headers while generating code codegen: Allows to generate C declarations automatically Allow to generate C

[Spice-devel] [PATCH spice-common 2/9] codegen: Factor out a function to write output file

2019-03-03 Thread Frediano Ziglio
This will be reused to generate C declaration automatically. Signed-off-by: Frediano Ziglio --- spice_codegen.py | 46 +- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/spice_codegen.py b/spice_codegen.py index 76d7c5e..7e22092 100755

[Spice-devel] [PATCH spice-common 7/9] codegen: Remove support for --ptrsize

2019-03-03 Thread Frediano Ziglio
This option was used in protocol 1 to generate 64 bit pointers. A pointer in the protocol is an offset in the current message. This allows the possibility to have messages with pointers with more than 4GB. This feature was removed and not used in protocol 2. The reason is that messages more than

[Spice-devel] [PATCH spice-common 3/9] codegen: Generate headers while generating code

2019-03-03 Thread Frediano Ziglio
Python script generates code and header together however allowed to save only one of them. Allows to save both of them together to reduce number of time we call Python script. Signed-off-by: Frediano Ziglio --- common/Makefile.am | 16 ++-- common/client_marshallers.h | 2

[Spice-devel] [PATCH spice-common 8/9] protocol: Add a dummy TunnelChannel

2019-03-03 Thread Frediano Ziglio
The removal of the channel definition will cause the enumeration to miss this old channel. Add a dummy channel (empty) to avoid having to update spice-gtk and spice-server and possibly breaking other software. Signed-off-by: Frediano Ziglio --- spice.proto | 7 +-- 1 file changed, 5

[Spice-devel] [PATCH spice-common 4/9] codegen: Allows to generate C declarations automatically

2019-03-03 Thread Frediano Ziglio
Allows to specify a @declare attribute for messages and structure that can generate the needed C structures. Signed-off-by: Frediano Ziglio --- python_modules/ptypes.py | 64 spice_codegen.py | 47 + 2 files changed,

[Spice-devel] [PATCH spice-common 1/9] messages: Remove fields not used by the protocol

2019-03-03 Thread Frediano Ziglio
These fields are not used by the protocol. Avoid spice-gtk and spice-server to use them by mistake. This can cause memory errors (data_size is not used or is not set correctly) and useless code (spice-gtk uses the pub_key* fields but these fields are not sent to the server as the protocol does not

Re: [Spice-devel] [PATCH spice-server v4 00/20] Port SPICE server to Windows

2019-03-03 Thread Frediano Ziglio
ping > > ping > > > > > Windows support is useful to use with Qemu under Windows as host or > > to implement servers like Xspice. > > Mainly SPICE server uses lot of libraries to expose a TCP protocol. > > As TCP is implemented with socket library which is quite portable was > > not that hard

Re: [Spice-devel] [vdagent-win PATCH] file-xfer: handle_start: use snprintf instead of sprintf_s

2019-03-03 Thread Frediano Ziglio
> On 2/28/19 3:12 PM, Frediano Ziglio wrote: > >> On 2/25/19 4:12 PM, Frediano Ziglio wrote: > > When building with older mingw, sprintf_s does not > always work as expected, but snprintf does. > > Also it's more consistent in the file. > > Note that when

Re: [Spice-devel] [vdagent-win PATCH] file-xfer: handle_start: use snprintf instead of sprintf_s

2019-03-03 Thread Uri Lublin
On 2/28/19 3:12 PM, Frediano Ziglio wrote: On 2/25/19 4:12 PM, Frediano Ziglio wrote: When building with older mingw, sprintf_s does not always work as expected, but snprintf does. Also it's more consistent in the file. Note that when building with VS, snprintf becomes sprintf_s I think

[Spice-devel] [PATCH spice-gtk] egl: Adjust to window scaling

2019-03-03 Thread Snir Sheriber
When GDK_SCALE is != 1 and egl is used, the presented image does not fit to the window (scale of 2 is often used with hidpi monitors). Usually this is not a problem since all components are adjusted by gdk/gtk but with egl, pixel-based data is not being scaled. In this case window's scale value