Re: [Spice-devel] [PATCH spice-streaming-agent v2 3/3] Introduce OutboundMessages for the StreamPort class

2018-10-12 Thread Lukáš Hrázký
On Fri, 2018-10-12 at 06:50 -0400, Frediano Ziglio wrote: > > > > Heavily based on code by Christophe de Dinechin. > > > > Wraps the serialization code in the OutboundMessage class and its > > descendants for each specific message. Uses Cruiously Recurring Template > > Pattern (CRTP) to avoid

[Spice-devel] [PATCH] qxl: store channel id in qxl->id

2018-10-12 Thread Gerd Hoffmann
See qemu_spice_add_display_interface(), the console index is also used as channel id. So put that into the qxl->id field too. In typical use cases (one primary qxl-vga device, optionally one or more secondary qxl devices, no non-qxl display devices) this doesn't change anything. With this in

[Spice-devel] [PATCH] spice: prepare for upcoming spice-server change

2018-10-12 Thread Gerd Hoffmann
Future spice-server versions will call the client_monitors_config callback with the monitors list filtered to only include the monitors of the given display channel (aka QXLInstance). Luckily this is easily detectable at runtime, so we can prepare for that in advance and also make qemu compatible

[Spice-devel] [PATCH spice-common v2 0/4] Remove obsoleted attributes from code generator

2018-10-12 Thread Frediano Ziglio
Changes since v1: - improved commit message on "codegen: Remove minor attribute" - added minor header cleanup Frediano Ziglio (4): codegen: Remove bytes_count attribute codegen: Remove fixedsize attribute codegen: Remove minor attribute client_demarshallers: Remove SPICE protocol 1

[Spice-devel] [PATCH spice-common v2 1/4] codegen: Remove bytes_count attribute

2018-10-12 Thread Frediano Ziglio
This attribute was used only in SPICE version 1. Its usage was confusing, and was replaced by the simple usage of array size. Generated code does not change. Signed-off-by: Frediano Ziglio --- docs/spice_protocol.txt | 5 - python_modules/demarshal.py | 5 +

[Spice-devel] [PATCH spice-common v2 3/4] codegen: Remove minor attribute

2018-10-12 Thread Frediano Ziglio
The idea in version 1 of the protocol was to extend it using the minor version. However this was replaced by the usage of capabilities and the minor attribute (which was not much used in version 1) was abandoned in version 2. This patch create a big difference in the code generated but only

[Spice-devel] [PATCH spice-common v2 4/4] client_demarshallers: Remove SPICE protocol 1 declaration

2018-10-12 Thread Frediano Ziglio
spice_get_server_channel_parser1 function was removed. Signed-off-by: Frediano Ziglio --- common/client_demarshallers.h | 1 - 1 file changed, 1 deletion(-) diff --git a/common/client_demarshallers.h b/common/client_demarshallers.h index af095a0..43c7e7d 100644 ---

[Spice-devel] [PATCH spice-common v2 2/4] codegen: Remove fixedsize attribute

2018-10-12 Thread Frediano Ziglio
This attribute was used only in SPICE version 1. The intention was use fixed size for switch type in the protocol. However this does not bring any improvement, just increase network bytes used. Generated code does not change. Signed-off-by: Frediano Ziglio --- docs/spice_protocol.txt | 6

[Spice-devel] [PATCH spice-common] Create common header for demarshallers declarations

2018-10-12 Thread Frediano Ziglio
Code generated for demarshallers define and declare some types and functions. However these types and functions are also declared separately in other headers resulting in potential ABI mismatch if the different declarations do not match. Using a common header shared between generated code and code

[Spice-devel] [PATCH spice-streaming-agent v3 2/2] Introduce OutboundMessages for the StreamPort class

2018-10-12 Thread Lukáš Hrázký
Heavily based on code by Christophe de Dinechin. Wraps the serialization code in the OutboundMessage class and its descendants for each specific message. Uses Cruiously Recurring Template Pattern (CRTP) to avoid runtime overhead of polymorphism. The messages are placed along with the code that

[Spice-devel] [PATCH spice-streaming-agent v3 0/2] refactor the protocol I/O

2018-10-12 Thread Lukáš Hrázký
Changes since v2: * actually posted the correct patches Changes since v1: * switched from designated initializers to regular initialization * added a generic 4kB inbound message size limit * fixed switch statement formatting * added a comment and made the conversion from num_codecs to the bool

[Spice-devel] [PATCH spice-streaming-agent v3 1/2] Introduce InboundMessages for the StreamPort class

2018-10-12 Thread Lukáš Hrázký
Wraps the deserialization of the received messages in an InboundMessages class. The class is created with the deserialized header and the raw data of the message. A template function get_payload() returns the struct of the concrete message. The function is specialized for each incoming message.

Re: [Spice-devel] [RFC PATCH spice 1/2] QXL interface: add functions to identify monitors in the guest

2018-10-12 Thread Lukáš Hrázký
On Fri, 2018-10-12 at 11:27 +0200, Gerd Hoffmann wrote: > On Thu, Oct 11, 2018 at 05:37:46PM +0200, Lukáš Hrázký wrote: > > On Thu, 2018-10-11 at 17:09 +0200, Gerd Hoffmann wrote: > > > > > Ok. We probably should fix interface_client_monitors_config() to use > > > > > the channel_id instead of

[Spice-devel] [PATCH spice-streaming-agent v2 1/3] stream-port: make StreamPort::fd const

2018-10-12 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký --- src/stream-port.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream-port.hpp b/src/stream-port.hpp index 9187cf5..48f843c 100644 --- a/src/stream-port.hpp +++ b/src/stream-port.hpp @@ -23,7 +23,7 @@ public: void read(void *buf,

[Spice-devel] [PATCH spice-streaming-agent v2 0/3] refactor the protocol I/O

2018-10-12 Thread Lukáš Hrázký
Hello, here's version 2 of the streaming agent I/O refactor. I've dropped the Poll patch, there's less incentive for it now, I may post it again or rework it later. Cheers, Lukas Changes since v1: * added a patch to make StreamPort::fd const * switched from designated initializers to regular

[Spice-devel] [PATCH spice-streaming-agent v2 3/3] Introduce OutboundMessages for the StreamPort class

2018-10-12 Thread Lukáš Hrázký
Heavily based on code by Christophe de Dinechin. Wraps the serialization code in the OutboundMessage class and its descendants for each specific message. Uses Cruiously Recurring Template Pattern (CRTP) to avoid runtime overhead of polymorphism. The messages are placed along with the code that

[Spice-devel] [PATCH spice-streaming-agent v2 2/3] Introduce InboundMessages for the StreamPort class

2018-10-12 Thread Lukáš Hrázký
Wraps the deserialization of the received messages in an InboundMessages class. The class is created with the deserialized header and the raw data of the message. A template function get_payload() returns the struct of the concrete message. The function is specialized for each incoming message.

Re: [Spice-devel] [PATCH spice-streaming-agent v2 1/3] stream-port: make StreamPort::fd const

2018-10-12 Thread Frediano Ziglio
> > Signed-off-by: Lukáš Hrázký > --- > src/stream-port.hpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/stream-port.hpp b/src/stream-port.hpp > index 9187cf5..48f843c 100644 > --- a/src/stream-port.hpp > +++ b/src/stream-port.hpp > @@ -23,7 +23,7 @@ public: >

Re: [Spice-devel] [RFC PATCH spice 1/2] QXL interface: add functions to identify monitors in the guest

2018-10-12 Thread Gerd Hoffmann
Hi, > > When using qemu_console_get_head() it doesn't work correctly, it would > > use the qxl card's data. It would work if spice-server would filter the > > list to only include the entries for the given display channel before > > calling the ->client_monitors_config() callback. But it

Re: [Spice-devel] [PATCH spice-streaming-agent v2 3/3] Introduce OutboundMessages for the StreamPort class

2018-10-12 Thread Frediano Ziglio
> > Heavily based on code by Christophe de Dinechin. > > Wraps the serialization code in the OutboundMessage class and its > descendants for each specific message. Uses Cruiously Recurring Template > Pattern (CRTP) to avoid runtime overhead of polymorphism. > > The messages are placed along

Re: [Spice-devel] [Qemu-devel] [RFC PATCH spice 1/2] QXL interface: add functions to identify monitors in the guest

2018-10-12 Thread Frediano Ziglio
> > Hi, > > > > When using qemu_console_get_head() it doesn't work correctly, it would > > > use the qxl card's data. It would work if spice-server would filter the > > > list to only include the entries for the given display channel before > > > calling the ->client_monitors_config() callback.

Re: [Spice-devel] [RFC PATCH spice 1/2] QXL interface: add functions to identify monitors in the guest

2018-10-12 Thread Gerd Hoffmann
On Thu, Oct 11, 2018 at 05:37:46PM +0200, Lukáš Hrázký wrote: > On Thu, 2018-10-11 at 17:09 +0200, Gerd Hoffmann wrote: > > > > Ok. We probably should fix interface_client_monitors_config() to use > > > > the channel_id instead of qemu_console_get_head() then. > > > > > > It's not that simple.

Re: [Spice-devel] [RFC PATCH spice 1/2] QXL interface: add functions to identify monitors in the guest

2018-10-12 Thread Frediano Ziglio
> On Thu, Oct 11, 2018 at 05:37:46PM +0200, Lukáš Hrázký wrote: > > On Thu, 2018-10-11 at 17:09 +0200, Gerd Hoffmann wrote: > > > > > Ok. We probably should fix interface_client_monitors_config() to use > > > > > the channel_id instead of qemu_console_get_head() then. > > > > > > > > It's not

Re: [Spice-devel] [Qemu-devel] [RFC PATCH spice 1/2] QXL interface: add functions to identify monitors in the guest

2018-10-12 Thread Gerd Hoffmann
On Fri, Oct 12, 2018 at 06:46:37AM -0400, Frediano Ziglio wrote: > > > > Hi, > > > > > > When using qemu_console_get_head() it doesn't work correctly, it would > > > > use the qxl card's data. It would work if spice-server would filter the > > > > list to only include the entries for the given

Re: [Spice-devel] [PATCH] spice: prepare for upcoming spice-server change

2018-10-12 Thread Lukáš Hrázký
On Fri, 2018-10-12 at 13:45 +0200, Gerd Hoffmann wrote: > Future spice-server versions will call the client_monitors_config > callback with the monitors list filtered to only include the monitors > of the given display channel (aka QXLInstance). Luckily this is easily > detectable at runtime, so