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

2019-10-07 Thread Frediano Ziglio
> > 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 mac

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

2019-10-07 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

[Spice-devel] [spice v1 3/8] tests: migrate: simplify wait_active()

2019-10-07 Thread Victor Toso
From: Victor Toso We are only interested in the running state of qmp (or VCPUS) here which is what we check. Moving this check to the try branch allows removing some extra checks. Signed-off-by: Victor Toso --- tests/migrate.py | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-)

[Spice-devel] [spice v1 7/8] tests: migrate: cosmetic changes

2019-10-07 Thread Victor Toso
From: Victor Toso Make one argument per line; Add space after and before '='; Indent with arguments; Signed-off-by: Victor Toso --- tests/migrate.py | 43 --- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/tests/migrate.py b/tests/migrat

[Spice-devel] [spice v1 4/8] tests: migrate: cosmetic changes on start_qemu()

2019-10-07 Thread Victor Toso
From: Victor Toso This function can be tweak quite a bit due all possibilities around QEMU configuration. This patch removes incoming_args and extra_args and move their values to the right place in the function. I'm also applying a more extensive coding style for parameters, so when we need to d

[Spice-devel] [spice v1 8/8] tests: migrate: add seamless-migration option

2019-10-07 Thread Victor Toso
From: Victor Toso Now we always add seamless-migration option to qemu command line and disabled (off) by default although seamless migration is supported for over 7 years already! Signed-off-by: Victor Toso --- tests/migrate.py | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions

[Spice-devel] [spice v1 5/8] tests: migrate: style, break line of qmp's command

2019-10-07 Thread Victor Toso
From: Victor Toso Preparatory patch for adding support to change hostname. Signed-off-by: Victor Toso --- tests/migrate.py | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/migrate.py b/tests/migrate.py index 3ae9e053..742c9fab 100755 --- a/tests/migrate.py

[Spice-devel] [spice v1 1/8] tests: migrate: fix events race

2019-10-07 Thread Victor Toso
From: Victor Toso Currently, when we run migrate.py with --client option we get stuck waiting for SPICE_CONNECTED event on target qmp (while receiving only QMP). Problem is, only after event SPICE_INITIALIZED in the source qmp is that the client will be able to do migration (to properly exchange

[Spice-devel] [spice v1 6/8] tests: migrate: add option for hostname change

2019-10-07 Thread Victor Toso
From: Victor Toso This is used in the migrate message and being able to tweak it allows clients from different machines to test this local migration test. Example of usage: ./migrate.py --hostname 192.168.122.1 --wait-user-connect In a VM with access to 192.168.122.1: remote-viewer spic

[Spice-devel] [spice v1 2/8] tests: migrate: migrate count starts with 1

2019-10-07 Thread Victor Toso
From: Victor Toso As this is not some index but a counter. The first print happens after first migration was done, meaning 1 instead of 0 Signed-off-by: Victor Toso --- tests/migrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/migrate.py b/tests/migrate.py inde

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

2019-10-07 Thread Frediano Ziglio
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 --- server/red-channel-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/red-channel-client.c b/server

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

2019-10-07 Thread Frediano Ziglio
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 --- server/smartcard-channel-client.c | 7 +++ server/smartcard.c| 1 + 2 fil

[Spice-devel] [PATCH spice-server 7/8] red-channel-client: Remove useless check

2019-10-07 Thread Frediano Ziglio
Message is checked by generated message parser. Signed-off-by: Frediano Ziglio --- server/red-channel-client.c | 4 1 file changed, 4 deletions(-) diff --git a/server/red-channel-client.c b/server/red-channel-client.c index 35eafa7a..832b4175 100644 --- a/server/red-channel-client.c +++ b/

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

2019-10-07 Thread Frediano Ziglio
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 preparation to use the generated code for Smartcard (currently not used so won't create regress

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

2019-10-07 Thread Frediano Ziglio
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 + server/tests/test-stream-device.c | 224 +- server/tests

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

2019-10-07 Thread Frediano Ziglio
"name" parameter of smartcard_channel_client_add_reader it's not used. Signed-off-by: Frediano Ziglio --- server/smartcard-channel-client.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/smartcard-channel-client.c b/server/smartcard-channel-client.c index 0b8644

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

2019-10-07 Thread Frediano Ziglio
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 + server/tests/meson.build | 4 + server/tests/test-smartcard.c | 211

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

2019-10-07 Thread Frediano Ziglio
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 code will be used by spice-server. The resulting change is. diff -ru gen/

[Spice-devel] [PATCH spice-server 6/8] red-channel: Make parser function compulsory

2019-10-07 Thread Frediano Ziglio
As base messages require parsing better channels should always use the generated parser. Signed-off-by: Frediano Ziglio --- server/red-channel-client.c | 13 ++--- server/red-channel.c | 1 + server/tests/test-stream-device.c | 3 +++ 3 files changed, 6 insertions(+)

Re: [Spice-devel] [spice/tests/migrate v1 2/4] tests: migrate: wait user launch client option

2019-10-07 Thread Victor Toso
Hi, On Sun, Oct 06, 2019 at 10:49:13AM +0300, Uri Lublin wrote: > On 10/4/19 11:37 AM, Victor Toso > On Thu, Oct 03, 2019 at 05:13:46PM +0300, > Uri Lublin wrote:>> On 10/3/19 1:14 PM, Victor Toso wrote:>>> From: Victor > Toso >> Useful to test different clients running > different tools (gdb,