[Spice-devel] [PATCH v4 2/2] drm/qxl: remove conflicting framebuffers earlier

2019-02-21 Thread Gerd Hoffmann
Add error checking while being at it. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index bb81e310eb6d..578d867a81d5 100644 ---

Re: [Spice-devel] [PATCH v2 2/2] drm/qxl: kick out vgacon

2019-02-21 Thread Gerd Hoffmann
Hi, > PCI_COMMAND_MEM and PCI_COMMAND_IO. There doesn't seem to be any > separate bits really. That's at least what I've gleaned from vgaarb.c. > The magic legacy vga decode bits only seem to exist on bridges, maybe > we can extract that logic from vgaarb.c (yes this is all a bit > spiralling

[Spice-devel] [PATCH] fixup! display: add -display spice-app launching a Spice client

2019-02-21 Thread Marc-André Lureau
--- ui/spice-app.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/spice-app.c b/ui/spice-app.c index 4f5229f3ee..925b27b708 100644 --- a/ui/spice-app.c +++ b/ui/spice-app.c @@ -181,6 +181,8 @@ static void spice_app_display_init(DisplayState *ds, DisplayOptions *opts)

[Spice-devel] [vdagent-linux] x11: invalidate requests for targets on grab from client

2019-02-21 Thread Jakub Janků
If XSetSelectionOwner() is invoked during the time we are waiting for the requested clipboard targets, the targets we eventually receive are no longer valid. To solve this, ignore the same count of target notifications as we expected at the time we received grab from the client. Otherwise we end

Re: [Spice-devel] [PATCH spice-server] Removed some not necessary headers inclusions

2019-02-21 Thread Jonathon Jongsma
On Thu, 2019-02-21 at 14:41 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/display-channel.h | 3 --- > server/inputs-channel.h | 1 - > server/main-dispatcher.h | 1 - > server/red-channel.h | 1 - > server/red-parse-qxl.h | 1 - > server/red-record-qxl.h

Re: [Spice-devel] [PATCH spice-gtk v2] build-sys: Use always --buildtype=release

2019-02-21 Thread Jonathon Jongsma
On additional minor change that I would like: it would be nice if the commit summary indicated that this is only for the gitlab CI configuration. "build-sys: Use always --buildtype=release" makes it sound like the change forces all developers to build in release mode. Otherwise, Acked-by:

Re: [Spice-devel] [spice-gtk] smartcard: Warn if multiple readers are detected

2019-02-21 Thread Frediano Ziglio
> > Hi > > On Thu, Feb 21, 2019 at 4:21 PM Christophe Fergeau > wrote: > > > > On Thu, Feb 21, 2019 at 03:59:00PM +0100, Marc-André Lureau wrote: > > > Hi > > > > > > On Wed, Feb 20, 2019 at 5:17 PM Christophe Fergeau > > > wrote: > > > > > > > > spice-server does not deal properly with

Re: [Spice-devel] [spice-gtk] smartcard: Warn if multiple readers are detected

2019-02-21 Thread Marc-André Lureau
Hi On Thu, Feb 21, 2019 at 4:21 PM Christophe Fergeau wrote: > > On Thu, Feb 21, 2019 at 03:59:00PM +0100, Marc-André Lureau wrote: > > Hi > > > > On Wed, Feb 20, 2019 at 5:17 PM Christophe Fergeau > > wrote: > > > > > > spice-server does not deal properly with multiple smartcard readers, > >

[Spice-devel] [PATCH spice-gtk v2] build-sys: Use always --buildtype=release

2019-02-21 Thread Frediano Ziglio
Allows the compiler to catch some errors which are only triggered when building with optimizations enabled. Signed-off-by: Frediano Ziglio --- .gitlab-ci.yml | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8ffc6542..adf53e1c

Re: [Spice-devel] [PATCH spice-gtk] build-sys: Use always --buildtype=release

2019-02-21 Thread Jonathon Jongsma
On Wed, 2019-02-20 at 15:50 -0500, Frediano Ziglio wrote: > > > > On Thu, 2019-02-14 at 12:56 +, Frediano Ziglio wrote: > > > Allows to catch some errors which the compiler is not able to > > > detect in debug mode (the default). > > > > Seems fine, but what kind of errors are you talking

Re: [Spice-devel] [spice-gtk] smartcard: Warn if multiple readers are detected

2019-02-21 Thread Christophe Fergeau
On Thu, Feb 21, 2019 at 03:59:00PM +0100, Marc-André Lureau wrote: > Hi > > On Wed, Feb 20, 2019 at 5:17 PM Christophe Fergeau > wrote: > > > > spice-server does not deal properly with multiple smartcard readers, > > only the first one will be working. Add a warning when this happens to > >

Re: [Spice-devel] [PATCH spice-gtk] channel-main: Do not use not present protocol fields

2019-02-21 Thread Christophe Fergeau
On Thu, Feb 21, 2019 at 08:58:19AM -0500, Frediano Ziglio wrote: > > On Wed, Feb 20, 2019 at 05:57:30PM +, Frediano Ziglio wrote: > > > Commit 9cf6d39b369f9c22615fc329e307126721125ecd ("server,proto: > > > tell the clients to connect to the migration target before migraton > > > starts", dated

Re: [Spice-devel] [PATCH v2 2/2] drm/qxl: kick out vgacon

2019-02-21 Thread Daniel Vetter
On Thu, Feb 21, 2019 at 4:11 PM Gerd Hoffmann wrote: > > Hi, > > > I was thinking of checking whether pdev is a VGA class device and whether > > it decodes vga access, and in that case automatically calling > > How can I figure that? Ok, class is easy, but decode? pci.h offers > functions to

Re: [Spice-devel] [PATCH v2 2/2] drm/qxl: kick out vgacon

2019-02-21 Thread Gerd Hoffmann
Hi, > I was thinking of checking whether pdev is a VGA class device and whether > it decodes vga access, and in that case automatically calling How can I figure that? Ok, class is easy, but decode? pci.h offers functions to set vga decode but not to get that info ... thanks, Gerd

Re: [Spice-devel] [spice-gtk] smartcard: Warn if multiple readers are detected

2019-02-21 Thread Marc-André Lureau
Hi On Wed, Feb 20, 2019 at 5:17 PM Christophe Fergeau wrote: > > spice-server does not deal properly with multiple smartcard readers, > only the first one will be working. Add a warning when this happens to > make it easier to diagnose such issues. > > Signed-off-by: Christophe Fergeau > --- >

[Spice-devel] [PATCH spice-server] Removed some not necessary headers inclusions

2019-02-21 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/display-channel.h | 3 --- server/inputs-channel.h | 1 - server/main-dispatcher.h | 1 - server/red-channel.h | 1 - server/red-parse-qxl.h | 1 - server/red-record-qxl.h | 1 - 6 files changed, 8 deletions(-) diff --git

Re: [Spice-devel] [PATCH v2 2/2] drm/qxl: kick out vgacon

2019-02-21 Thread Daniel Vetter
On Thu, Feb 21, 2019 at 02:06:23PM +0100, Gerd Hoffmann wrote: > On Thu, Feb 21, 2019 at 01:20:11PM +0100, Daniel Vetter wrote: > > On Thu, Feb 21, 2019 at 12:35:34PM +0100, Gerd Hoffmann wrote: > > > Problem: qxl switches from native mode back into vga compatibility mode > > > when it notices

Re: [Spice-devel] [PATCH spice-gtk] channel-main: Do not use not present protocol fields

2019-02-21 Thread Frediano Ziglio
> On Wed, Feb 20, 2019 at 05:57:30PM +, Frediano Ziglio wrote: > > Commit 9cf6d39b369f9c22615fc329e307126721125ecd ("server,proto: > > tell the clients to connect to the migration target before migraton > > starts", dated 18th September 2011) removed these fields. > > Avoid to use them. If

Re: [Spice-devel] [PATCH spice-gtk] channel-main: Do not use not present protocol fields

2019-02-21 Thread Christophe Fergeau
On Wed, Feb 20, 2019 at 05:57:30PM +, Frediano Ziglio wrote: > Commit 9cf6d39b369f9c22615fc329e307126721125ecd ("server,proto: > tell the clients to connect to the migration target before migraton > starts", dated 18th September 2011) removed these fields. > Avoid to use them. If nobody

Re: [Spice-devel] [PATCH spice-common] log: Remove useless includes

2019-02-21 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Thu, Feb 21, 2019 at 10:49:20AM +, Frediano Ziglio wrote: > Now the function almost uses GLib function, no reason to include > some system headers. > > Signed-off-by: Frediano Ziglio > --- > common/log.c | 6 -- > 1 file changed, 6 deletions(-) > >

Re: [Spice-devel] [PATCH spice-common] mem: Fix compile error if alignment-checks option is used

2019-02-21 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Thu, Feb 21, 2019 at 10:49:19AM +, Frediano Ziglio wrote: > Domain name argument to spice_log was removed time ago. > > Signed-off-by: Frediano Ziglio > --- > common/mem.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git

Re: [Spice-devel] [PATCH v2 2/2] drm/qxl: kick out vgacon

2019-02-21 Thread Gerd Hoffmann
On Thu, Feb 21, 2019 at 01:20:11PM +0100, Daniel Vetter wrote: > On Thu, Feb 21, 2019 at 12:35:34PM +0100, Gerd Hoffmann wrote: > > Problem: qxl switches from native mode back into vga compatibility mode > > when it notices someone is accessing vga registers. And vgacon does > > exactly that

Re: [Spice-devel] [PATCH v2 2/2] drm/qxl: kick out vgacon

2019-02-21 Thread Daniel Vetter
On Thu, Feb 21, 2019 at 12:35:34PM +0100, Gerd Hoffmann wrote: > Problem: qxl switches from native mode back into vga compatibility mode > when it notices someone is accessing vga registers. And vgacon does > exactly that before fbcon takes over. So make sure we kick out vgacon > early enough

Re: [Spice-devel] [PATCH -next] drm/qxl: remove set but not used variable 'bo_old'

2019-02-21 Thread Gerd Hoffmann
On Mon, Feb 18, 2019 at 08:54:59AM +, YueHaibing wrote: > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/gpu/drm/qxl/qxl_display.c: In function 'qxl_primary_atomic_update': > drivers/gpu/drm/qxl/qxl_display.c:538:17: warning: > variable 'bo_old' set but not used

[Spice-devel] [PATCH v2 2/2] drm/qxl: kick out vgacon

2019-02-21 Thread Gerd Hoffmann
Problem: qxl switches from native mode back into vga compatibility mode when it notices someone is accessing vga registers. And vgacon does exactly that before fbcon takes over. So make sure we kick out vgacon early enough that it wouldn't disturb us. Signed-off-by: Gerd Hoffmann ---

[Spice-devel] spice-server: Windows agent broken with master

2019-02-21 Thread Frediano Ziglio
Hi, looks like the Windows agent does not like that much the additional message sent (VDAgentGraphicsDeviceInfo) causing it to exit. Obviously a guest update cannot be forced and VM should continue to run so this should be fixed in the server not sending that message if the guest does not

Re: [Spice-devel] [PATCH] drm/qxl: unbind vgacon

2019-02-21 Thread Gerd Hoffmann
> > + /* unbind vgacon to make sure it doesn't touch our vga registers */ > > + console_lock(); > > + ret = do_take_over_console(_con, 0, MAX_NR_CONSOLES - 1, true); > > + console_unlock(); > > Still seems very late, in i915 we kick out vgacon as pretty much the first > thing in driver

[Spice-devel] [PATCH spice-common] mem: Fix compile error if alignment-checks option is used

2019-02-21 Thread Frediano Ziglio
Domain name argument to spice_log was removed time ago. Signed-off-by: Frediano Ziglio --- common/mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/mem.c b/common/mem.c index 8779282..ff11e5e 100644 --- a/common/mem.c +++ b/common/mem.c @@ -300,7 +300,7 @@

[Spice-devel] [PATCH spice-common] log: Remove useless includes

2019-02-21 Thread Frediano Ziglio
Now the function almost uses GLib function, no reason to include some system headers. Signed-off-by: Frediano Ziglio --- common/log.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/common/log.c b/common/log.c index 054fd7f..b73da71 100644 --- a/common/log.c +++ b/common/log.c @@

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

2019-02-21 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

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

2019-02-21 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 3/6] codegen: Generate headers while generating code

2019-02-21 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 6/6] Generate automatically most C message declarations

2019-02-21 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 aae3212..43d0661 100644 ---

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

2019-02-21 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 2/6] codegen: Factor out a function to write output file

2019-02-21 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 0/6] Generate C declarations automatically

2019-02-21 Thread Frediano Ziglio
First patch is an already sent patch which conflict. Other patches allows to declare C declarations (that were in common/messages.h) automatically. I added an attribute to: - be compatible; - allows to declare structure in different way than automatic ones; - allows to use different headers (as

Re: [Spice-devel] [PATCH] drm/qxl: unbind vgacon

2019-02-21 Thread Daniel Vetter
On Wed, Feb 20, 2019 at 03:36:40PM +0100, Gerd Hoffmann wrote: > Problem: qxl switches from native mode back into vga compatibility mode > when it notices someone is accessing vga registers. And vgacon does > exactly that before fbcon takes over. > > Before qxl switched to the generic fbdev

Re: [Spice-devel] [PATCH v5] spice: set device address and device display ID in QXL interface

2019-02-21 Thread Gerd Hoffmann
On Fri, Feb 15, 2019 at 04:09:19PM +0100, Lukáš Hrázký wrote: > Calls the new SPICE QXL interface function spice_qxl_set_device_info to > set the hardware address of the graphics device represented by the QXL > interface (e.g. a PCI path) and the device display IDs (the IDs of the > device's

Re: [Spice-devel] [PATCH spice-common 2/7] codegen: Add a test for attribute combination

2019-02-21 Thread Christophe Fergeau
On Wed, Feb 20, 2019 at 12:53:12PM -0500, Frediano Ziglio wrote: > > On Mon, Feb 18, 2019 at 04:01:24PM +, Frediano Ziglio wrote: > > > Does not make sense to specify the same field to have 2 > > > different C implementation at the same time. > > > > > > Signed-off-by: Frediano Ziglio > > >