[Spice-devel] [PATCH spice-server v2 2/7] smartcard-channel-client: Use log instead of printf

2019-10-08 Thread Frediano Ziglio
More coherent. Also it's not good for a library to output on standard output. Signed-off-by: Frediano Ziglio --- server/smartcard-channel-client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/smartcard-channel-client.c b/server/smartcard-channel-client.c index d4

[Spice-devel] [PATCH spice-server v2 5/7] test-stream-device: Factor out VMC emulation

2019-10-08 Thread Frediano Ziglio
Allows to reuse code for emulating a character device. It will be used for Smardcard test. Signed-off-by: Frediano Ziglio Acked-by: Victor Toso --- server/tests/Makefile.am | 2 + server/tests/meson.build | 2 + server/tests/test-stream-device.c | 224 +

[Spice-devel] [PATCH spice-server v2 6/7] test-smartcard: Add test for Smartcard device

2019-10-08 Thread Frediano Ziglio
Create Smardcard device. Connect to it and test some messages are parsed and processed as expected. Signed-off-by: Frediano Ziglio -- Changes since v1: - add more comments - limit time the test executes --- server/tests/.gitignore | 1 + server/tests/Makefile.am | 4 + server/test

[Spice-devel] [PATCH spice-server v2 7/7] test-smardcard: Improve test coverage

2019-10-08 Thread Frediano Ziglio
Using coverage utility exercise more code paths: - message from channel with wrong type; - remove message from channel with already removed reader; - init message from channel (ignored); - data from devices, ADPU; - error from device; - messages split in different ways; - invalid reader_id values.

[Spice-devel] [PATCH spice-server v2 4/7] smartcard: Fix parsing multiple messages from the device

2019-10-08 Thread Frediano Ziglio
If the server is busy or the guest write multiple requests with a single operation it could happen that we receive multiple requests with a single read. This will make "remaining" > 0. Use memmove instead of memcpy as the buffer can overlap if the second request if bigger than the first. "buf_pos"

[Spice-devel] [PATCH spice-server v2 3/7] smartcard: Do not crash if reader_id is invalid

2019-10-08 Thread Frediano Ziglio
Avoid client to trigger crash. The value of smartcard_readers_get is checked for NULL so returning it it's not an issue. Signed-off-by: Frediano Ziglio --- server/smartcard.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/smartcard.c b/server/smartcard.c index 3f51

[Spice-devel] [PATCH spice-server v2 0/7] Multiple improvements for Smartcard code

2019-10-08 Thread Frediano Ziglio
Multiple fixes and automatic test of the device/channel. Improve previous series. Most fixes came from automatic test. Frediano Ziglio (7): smartcard-channel-client: Remove properties code smartcard-channel-client: Use log instead of printf smartcard: Do not crash if reader_id is invalid s

[Spice-devel] [PATCH spice-server v2 1/7] smartcard-channel-client: Remove properties code

2019-10-08 Thread Frediano Ziglio
Not used Signed-off-by: Frediano Ziglio --- server/smartcard-channel-client.c | 26 -- 1 file changed, 26 deletions(-) diff --git a/server/smartcard-channel-client.c b/server/smartcard-channel-client.c index f71b65238..d47b442e4 100644 --- a/server/smartcard-channel-cli

Re: [Spice-devel] [PATCH spice-server 8/8] red-channel-client: Use SpiceMsgcAckSync structure

2019-10-08 Thread Victor Toso
Hi, For the 6-8/8 (pending) Acked-by: Victor Toso On Mon, Oct 07, 2019 at 11:39:06AM +0100, Frediano Ziglio wrote: > red_channel_client_handle_message is called after parsing the > message so it's not necessary to check it again or parse manually. > > Signed-off-by: Frediano Ziglio > --- > se

Re: [Spice-devel] [PATCH spice-server 1/8] test-stream-device: Factor out VMC emulation

2019-10-08 Thread Victor Toso
Hi, On Tue, Oct 08, 2019 at 10:04:25AM -0400, Frediano Ziglio wrote: > > > > On Mon, Oct 07, 2019 at 11:38:59AM +0100, Frediano Ziglio wrote: > > > Allows to reuse code for emulating a character device. > > > It will be used for Smardcard test. > > > > > ... > > > > + > > > +void vmc_emu_reset

Re: [Spice-devel] [PATCH spice-server 3/8] smartcard-channel-client: Remove unused parameter

2019-10-08 Thread Frediano Ziglio
> > Hi, > > On Mon, Oct 07, 2019 at 11:39:01AM +0100, Frediano Ziglio wrote: > > "name" parameter of smartcard_channel_client_add_reader it's not > > used. > > > > Signed-off-by: Frediano Ziglio > > I guess it was used for debugging? > As far as I can see was never used since the initial com

Re: [Spice-devel] [PATCH spice-server 2/8] test-smartcard: Add test for Smartcard device

2019-10-08 Thread Frediano Ziglio
> > Hi, > > On Mon, Oct 07, 2019 at 11:39:00AM +0100, Frediano Ziglio wrote: > > Create Smardcard device. > > Connect to it and test some messages are parsed and processed > > as expected. > > > > Signed-off-by: Frediano Ziglio > > --- > > server/tests/.gitignore | 1 + > > server/test

Re: [Spice-devel] [PATCH spice-server 1/8] test-stream-device: Factor out VMC emulation

2019-10-08 Thread Frediano Ziglio
> > On Mon, Oct 07, 2019 at 11:38:59AM +0100, Frediano Ziglio wrote: > > Allows to reuse code for emulating a character device. > > It will be used for Smardcard test. > > ... > > + > > +void vmc_emu_reset(VmcEmu *vmc) > > +{ > > +vmc->pos = 0; > > +vmc->write_pos = 0; > > +vmc->mes

Re: [Spice-devel] [PATCH spice-server 5/8] smartcard: Use generated parse for messages

2019-10-08 Thread Victor Toso
Hi, On Mon, Oct 07, 2019 at 11:39:03AM +0100, Frediano Ziglio wrote: > The generated code handle possible endianess mismatch and check > for message format. > The copy back to "write_buf" allows to use that buffer to send > data back to device. > > Signed-off-by: Frediano Ziglio Looks fine as w

Re: [Spice-devel] [PATCH spice-server 4/8] Update spice-common submodule

2019-10-08 Thread Victor Toso
Hi, On Mon, Oct 07, 2019 at 11:39:02AM +0100, Frediano Ziglio wrote: > This brings in the following changes: > > Frediano Ziglio (1): > proto: Demarshal Smartcard data field > > Kevin Pouget (1): > common/recorder.h: do not complain on unused (dummy) recorders > > This is in prepara

Re: [Spice-devel] [PATCH spice-server 3/8] smartcard-channel-client: Remove unused parameter

2019-10-08 Thread Victor Toso
Hi, On Mon, Oct 07, 2019 at 11:39:01AM +0100, Frediano Ziglio wrote: > "name" parameter of smartcard_channel_client_add_reader it's not > used. > > Signed-off-by: Frediano Ziglio I guess it was used for debugging? Acked-by: Victor Toso > --- > server/smartcard-channel-client.c | 5 ++---

Re: [Spice-devel] [PATCH spice-server 2/8] test-smartcard: Add test for Smartcard device

2019-10-08 Thread Victor Toso
Hi, On Mon, Oct 07, 2019 at 11:39:00AM +0100, Frediano Ziglio wrote: > Create Smardcard device. > Connect to it and test some messages are parsed and processed > as expected. > > Signed-off-by: Frediano Ziglio > --- > server/tests/.gitignore | 1 + > server/tests/Makefile.am | 4

Re: [Spice-devel] [PATCH spice-common] proto: Demarshal Smartcard data field

2019-10-08 Thread Victor Toso
Hi, On Mon, Oct 07, 2019 at 11:38:58AM +0100, Frediano Ziglio wrote: > Currently the demarshaler code is not used by spice-server. > Demarshal all the fields of the header message, not only the header. > Using generated code allows to easily check data and support > big endian machines. Generated

Re: [Spice-devel] [PATCH spice-server 1/8] test-stream-device: Factor out VMC emulation

2019-10-08 Thread Victor Toso
On Mon, Oct 07, 2019 at 11:38:59AM +0100, Frediano Ziglio wrote: > Allows to reuse code for emulating a character device. > It will be used for Smardcard test. > > Signed-off-by: Frediano Ziglio > --- > server/tests/Makefile.am | 2 + > server/tests/meson.build | 2 + > ser

[Spice-devel] [PATCH -next] drm/qxl: Fix randbuild error

2019-10-08 Thread YueHaibing
If DEM_QXL is y and DRM_TTM_HELPER is m, building fails: drivers/gpu/drm/qxl/qxl_object.o: undefined reference to `drm_gem_ttm_print_info' Select DRM_TTM_HELPER to fix this. Fixes: 78d54f1f6a33 ("drm/qxl: use drm_gem_ttm_print_info") Signed-off-by: YueHaibing --- drivers/gpu/drm/qxl/Kconfig |