Re: [Spice-devel] [cacard v3] tests: Fix 'simpletlv' on i686 arches

2018-08-14 Thread Marc-André Lureau
On Tue, Aug 14, 2018 at 3:01 PM Christophe Fergeau wrote: > > The simpletlv_* functions return lengths as an int, but the test is > casting it to a size_t before comparing it against -1. This is not > giving the expected result on i686, causing the test to fail. The > variables used in the test do

[Spice-devel] [RFC spice-vdagent 18/18] vdagentd: move code to do_agent_file_xfer_status()

2018-08-14 Thread Jakub Janků
Move code handling VDAGENTD_FILE_XFER_STATUS from agent_read_complete() to a separate function to make the switch statement less cluttered. Improve formatting a bit. --- src/vdagentd/vdagentd.c | 61 + 1 file changed, 37 insertions(+), 24 deletions(-) diff

[Spice-devel] [RFC spice-vdagent 16/18] move to GLib memory functions

2018-08-14 Thread Jakub Janků
Some older parts of the code currently use memory functions defined in stdlib.h and usually handle allocation errors. On the other hand, newer parts of the code and GLib/GTK+ functions themselves commonly use wrappers provided by GLib that terminate the program when there isn't enough memory. So

[Spice-devel] [RFC spice-vdagent 17/18] vdagentd: move code to do_guest_xorg_resolution()

2018-08-14 Thread Jakub Janků
Move code handling VDAGENTD_GUEST_XORG_RESOLUTION from agent_read_complete() to a separate function to make the switch statement less cluttered. Remove unnecessary res variable. --- src/vdagentd/vdagentd.c | 61 + 1 file changed, 31 insertions(+), 30 deleti

[Spice-devel] [RFC spice-vdagent 12/18] console-kit: use GDBus

2018-08-14 Thread Jakub Janků
Rewrite console-kit.c using GDBus instead of libdbus. GDBus provides a more convenient way to access DBus objects. All DBus method calls share a fair amount of common code here, so add a helper function dbus_call_method_for_string(). --- src/vdagentd/console-kit.c | 597 --

[Spice-devel] [RFC spice-vdagent 09/18] udscs: simplify logging

2018-08-14 Thread Jakub Janků
Remove type_to_string, no_types arguments from udscs_connect() and udscs_server_new(). udscs is used only in vdagent.c and vdagentd.c and in both cases the args are the same (vdagentd_messages, VDAGENTD_NO_MESSAGES). Add debug_print_message_header(). --- src/udscs.c | 52 +

[Spice-devel] [RFC spice-vdagent 06/18] udscs: add udscs_get_peer_pid()

2018-08-14 Thread Jakub Janků
udscs_get_peer_cred() is currently used only in vdagentd.c to obtain PID, so let's drop udscs_get_peer_cred() and add udscs_get_peer_pid() instead. --- src/udscs.c | 6 +++--- src/udscs.h | 4 ++-- src/vdagentd/vdagentd.c | 2 +- 3 files changed, 6 insertions(+), 6 deletion

[Spice-devel] [RFC spice-vdagent 15/18] build: drop DBus dependency

2018-08-14 Thread Jakub Janků
Both console-kit.c and systemd-login.c have been moved to GDBus. --- Makefile.am | 2 -- configure.ac | 1 - 2 files changed, 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index b291b19..64ed406 100644 --- a/Makefile.am +++ b/Makefile.am @@ -47,7 +47,6 @@ src_spice_vdagent_SOURCES =

[Spice-devel] [RFC spice-vdagent 10/18] vport: use VDAgentConnection

2018-08-14 Thread Jakub Janků
Rewrite virtio-port.c using VDAgentConnection to integrate it into GMainLoop and simplify the code. virtio_port_destroy() does NOT close the underlying FD immediately. GSources attached to GMainContext can be processed during vdagent_virtio_port_flush() call. Apart from that, the behavior stays th

[Spice-devel] [RFC spice-vdagent 05/18] add VDAgentConnection

2018-08-14 Thread Jakub Janků
Add a set of helper functions built around GIO that can be used to easily write messages to and read from the given FD. Since VDAgentConnection uses GIO, it integrates well with GMainLoop. Read messages must begin with a header of a fixed size. Message body size can vary. User of VDAgentConnecti

[Spice-devel] [RFC spice-vdagent 14/18] session-info: remove session_info_get_fd()

2018-08-14 Thread Jakub Janků
In console-kit.c, FD polling is handled internally by GDBus. In systemd-login.c, FD is integrated into the GMainLoop using GIOChannel. Users of session-info.h are notified by ActiveSessionChangeCb when the active session changes. This renders the session_info_get_fd() obsolete. --- src/vdagentd

[Spice-devel] [RFC spice-vdagent 08/18] udscs-server: split initialization

2018-08-14 Thread Jakub Janků
Divide creation of udscs_server into 2 steps: 1) udscs_server_new() - allocates new udscs_server struct and inits it 2) udscs_server_listen_to_fd(), udscs_server_listen_to_address() - starts accepting new connections udscs_server_listen_to_address() creates a new socket and binds it to the giv

[Spice-devel] [RFC spice-vdagent 04/18] build: add GIO dependency

2018-08-14 Thread Jakub Janků
Require UNIX-specific GIO package to build spice-vdagent. This includes - GDBus which is going to be used instead of libdbus in console-kit.c and systemd-login.c - I/O stream classes and networking APIs that are going to be used in udscs.c and virtio-port.c instead of low-level POSIX I/O f

[Spice-devel] [RFC spice-vdagent 11/18] session-info: add ActiveSessionChangeCb

2018-08-14 Thread Jakub Janků
This is necessary for the following GDBus integration, which drops session_info_get_fd(). The vdagentd therefore won't be able to detect session changes using select(). --- src/vdagentd/console-kit.c| 2 +- src/vdagentd/dummy-session-info.c | 2 +- src/vdagentd/session-info.h | 4 +++

[Spice-devel] [RFC spice-vdagent 13/18] systemd-login: use GDBus

2018-08-14 Thread Jakub Janků
Rewrite systemd-login.c using GDBus instead of libdbus. Use GDBusProxy. This is less efficient than the previous impl as it caches all properties and listens to all signals of the given DBus object. But it is just so much more convenient... --- src/vdagentd/systemd-login.c | 254 +++--

[Spice-devel] [RFC spice-vdagent 07/18] udscs: use VDAgentConnection

2018-08-14 Thread Jakub Janků
Rewrite udscs.c using VDAgentConnection to integrate it into GMainLoop and simplify the code. udscs_destroy_connection() does NOT close the underlying FD immediately. Apart from that, the behavior stays the same. Drop support for select() in udscs_server, remove udscs_server_fill_fds(), udscs_ser

[Spice-devel] [RFC spice-vdagent 02/18] vport: add by_user param to vdagent_virtio_port_disconnect_callback

2018-08-14 Thread Jakub Janků
If the virtio port is destroyed explicitly by calling vdagent_virtio_port_destroy(), by_user is set to TRUE, otherwise to FALSE. This will be used later with GMainLoop. --- src/vdagentd/virtio-port.c | 24 +++- src/vdagentd/virtio-port.h | 10 +- 2 files changed, 20 in

[Spice-devel] [RFC spice-vdagent 01/18] vdagentd: parse argv using GLib

2018-08-14 Thread Jakub Janků
All command line options now have long names as they are required by GLib. Change types of some global variables that hold the options: - const char * --> gchar * - int --> gboolean Define DEFAULT_UINPUT_DEVICE as "/dev/uinput", since there's already DEFAULT_VIRTIO_PORT_PATH, VDAGENTD_SO

[Spice-devel] [RFC spice-vdagent 03/18] vdagentd: use GMainLoop

2018-08-14 Thread Jakub Janků
This is purely a preparatory patch as it renders the vdagentd non-functional. Remove main while loop with FD polling. udscs, virtio-port and session-info will be integrated into the GMainLoop in the following commits. Use g_unix_signal_add() to handle SIGINT, SIGHUP, SIGTERM. SIGQUIT handling is

[Spice-devel] [RFC spice-vdagent 00/18] GLib integration

2018-08-14 Thread Jakub Janků
Hi all, as the subject suggests, this series further deepens the integration of GLib into spice-vdagent(d). Change summary: * udscs.c and virtio-port.c are built upon common base, VDAgentConnection, that handles the lower-level I/O operations * systemd-login.c and console-kit.c use GDBus inste

Re: [Spice-devel] [spice-server v2 2/2] build: Prepare for 0.14.1 release

2018-08-14 Thread Jonathon Jongsma
On Mon, 2018-08-13 at 12:18 +0200, Christophe Fergeau wrote: > Signed-off-by: Christophe Fergeau > --- > NEWS | 33 + > configure.ac | 2 +- > 2 files changed, 34 insertions(+), 1 deletion(-) > > diff --git a/NEWS b/NEWS > index 51bb4a2e6..1577b013f 10064

Re: [Spice-devel] [spice-server v2 1/2] docs: Add documentation for the streaming device

2018-08-14 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Mon, 2018-08-13 at 12:18 +0200, Christophe Fergeau wrote: > Signed-off-by: Christophe Fergeau > --- > docs/manual/manual.txt | 51 > ++ > 1 file changed, 51 insertions(+) > > diff --git a/docs/manual/manual.txt b/docs/manua

Re: [Spice-devel] [PATCH] win-usb-dev: Set UsbDk backend on libusb 1.0.22

2018-08-14 Thread Christophe Fergeau
On Tue, Aug 14, 2018 at 09:03:30AM +0200, Jorge Olmos wrote: > Hi, > On Mon, 2018-08-13 at 17:25 +0200, Christophe Fergeau wrote: > > Hey, > > > > On Mon, Aug 13, 2018 at 03:45:06PM +0200, Jorge Olmos wrote: > > > This patch configures libusb in the context used in win-usb-dev, > > > with > > > th

Re: [Spice-devel] [PATCH spice-server] Support h265 in stream-channel

2018-08-14 Thread Christophe Fergeau
On Mon, Aug 13, 2018 at 12:28:32PM -0400, Frediano Ziglio wrote: > > > > On Mon, Aug 13, 2018 at 11:41:31AM -0400, Frediano Ziglio wrote: > > > > > > > > Hey, > > > > > > > > At this point, I don't think we have anything which is going to give us > > > > an h265 encoded stream, and latest spice-

[Spice-devel] [PATCH spice-gtk v5 1/3] Rename generated vncdisplaykeymap_*.c files to .h

2018-08-14 Thread Eduardo Lima (Etrunko)
Ninja parallel build fails in certain environments, so it is required specify those files as a dependency so that vncdisplaykeymap.c will only be built after all files it depends on are generated. The problem is that, when using meson declare_dependency() function, only header files should be used

[Spice-devel] [PATCH spice-gtk v5 3/3] Update gitlab-ci to use meson

2018-08-14 Thread Eduardo Lima (Etrunko)
Signed-off-by: Eduardo Lima (Etrunko) --- .gitlab-ci.yml | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a34eb0e..e5e90af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ image: fedora:latest before_

[Spice-devel] [PATCH spice-gtk v5 0/3] Add suppor for building with meson/ninja

2018-08-14 Thread Eduardo Lima (Etrunko)
in v5: * Added missing -Wno-cast-function-type build flag * No need to declare_dependency() for generated vncdisplaykeymap files now that extension has been renamed to '.h' Eduardo Lima (Etrunko) (3): Rename generated vncdisplaykeymap_*.c files to .h Add support for building with meson/ni

[Spice-devel] [PATCH spice-gtk v5 2/3] Add support for building with meson/ninja

2018-08-14 Thread Eduardo Lima (Etrunko)
In a comparison with current autotools build system, meson/ninja provides a huge improvement in build speed, while keeping the same functionalities currently available and being considered more user friendly. The new system coexists within the same repository with the current one, so we can do mor

Re: [Spice-devel] [PATCH] Use proper free function for PK11_ReadRawAttribute call

2018-08-14 Thread Jakub Jelen
On Tue, 2018-08-14 at 10:35 +0100, Frediano Ziglio wrote: > As documented in PK11_ReadRawAttribute data should be freed with > PORT_Free, not free or g_free. Good catch. This might even make the valgrind suppression file slimmer in the end. > Signed-off-by: Frediano Ziglio > --- > src/cac.c

[Spice-devel] [cacard v3] tests: Fix 'simpletlv' on i686 arches

2018-08-14 Thread Christophe Fergeau
The simpletlv_* functions return lengths as an int, but the test is casting it to a size_t before comparing it against -1. This is not giving the expected result on i686, causing the test to fail. The variables used in the test do not need to be size_t, and can be changed to int to match the return

[Spice-devel] [PATCH spice-gtk] fixup: Add support for building with meson/ninja

2018-08-14 Thread Eduardo Lima (Etrunko)
Signed-off-by: Eduardo Lima (Etrunko) --- src/meson.build | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/meson.build b/src/meson.build index c9429f5..b9ee039 100644 --- a/src/meson.build +++ b/src/meson.build @@ -301,21 +301,18 @@ if spice_gtk_has_gtk

Re: [Spice-devel] [cacard v2] tests: Fix 'simpletlv' on i686 arches

2018-08-14 Thread Christophe Fergeau
Sorry, this one is missing at least one hunk, will send a v3. Christophe On Tue, Aug 14, 2018 at 02:40:58PM +0200, Christophe Fergeau wrote: > The simpletlv_* functions return lengths as an int, but the test is > casting it to a size_t before comparing it against -1. This is not > giving the expe

Re: [Spice-devel] [PATCH spice-gtk v4 1/3] Rename generated vncdisplaykeymap_*.c files to .h

2018-08-14 Thread Eduardo Lima (Etrunko)
On 14/08/18 04:47, Frediano Ziglio wrote: >> On 13/08/18 07:23, Frediano Ziglio wrote: Ninja parallel build fails in certain environments, so it is required specify those files as a dependency so that vncdisplaykeymap.c will only be built after all files it depends on are genera

Re: [Spice-devel] [cacard] simpletlv: Slight improvement to API documentation

2018-08-14 Thread Jakub Jelen
On Tue, 2018-08-14 at 14:41 +0200, Christophe Fergeau wrote: > Document return value of simpletlv_get_length and simpletlv_encode > and > fix a few typos. Sharp eye or good spellchecker. Looks good to me. Ack. > --- > src/simpletlv.h | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-)

[Spice-devel] [cacard] simpletlv: Slight improvement to API documentation

2018-08-14 Thread Christophe Fergeau
Document return value of simpletlv_get_length and simpletlv_encode and fix a few typos. --- src/simpletlv.h | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/simpletlv.h b/src/simpletlv.h index bf785e4..d12f52d 100644 --- a/src/simpletlv.h +++ b/src/simpletlv.h @@ -48,

[Spice-devel] [cacard v2] tests: Fix 'simpletlv' on i686 arches

2018-08-14 Thread Christophe Fergeau
The simpletlv_* functions return lengths as an int, but the test is casting it to a size_t before comparing it against -1. This is not giving the expected result on i686, causing the test to fail. The variables used in the test do not need to be size_t, and can be changed to int to match the return

[Spice-devel] [PATCH] Fix typo in comment

2018-08-14 Thread Frediano Ziglio
Porprietary -> Proprietary Signed-off-by: Frediano Ziglio --- src/card_7816.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/card_7816.c b/src/card_7816.c index dc12138..bf8bdce 100644 --- a/src/card_7816.c +++ b/src/card_7816.c @@ -669,7 +669,7 @@ vcard7816_vm_process_a

[Spice-devel] [PATCH] Do not use static buffer to avoid possible races

2018-08-14 Thread Frediano Ziglio
Using a static writeable buffer and threads could lead to race conditions (like multiple threads calling the same function). The fci_template buffer is changed some lines below with a memcpy. Signed-off-by: Frediano Ziglio --- src/card_7816.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[Spice-devel] [PATCH] Use proper free function for PK11_ReadRawAttribute call

2018-08-14 Thread Frediano Ziglio
As documented in PK11_ReadRawAttribute data should be freed with PORT_Free, not free or g_free. Signed-off-by: Frediano Ziglio --- src/cac.c| 3 ++- src/vcard_emul_nss.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cac.c b/src/cac.c index ba63685..6c49d9

Re: [Spice-devel] [cacard 1/2] tests: Add cert.cfg to EXTRA_DIST

2018-08-14 Thread Christophe Fergeau
On Mon, Aug 13, 2018 at 07:12:24PM +0200, Marc-André Lureau wrote: > On Mon, Aug 13, 2018 at 6:11 PM, Christophe Fergeau > wrote: > > Without it, make check from tarballs will fail. > > Actually make distcheck passes, but the tests are skipped, right? When running make check from a tarball in r

Re: [Spice-devel] [cacard 2/2] tests: Fix 'simpletlv' on i686 arches

2018-08-14 Thread Frediano Ziglio
> > The simpletlv_* functions return lengths as an int, but the test is > casting it to a size_t before comparing it against -1. This is not > giving the expected result on i686, causing the test to fail. > > Signed-off-by: Christophe Fergeau Maybe a bit OT. Do we support arm32 ? I'm asking bec

Re: [Spice-devel] [cacard 2/2] tests: Fix 'simpletlv' on i686 arches

2018-08-14 Thread Jakub Jelen
On Mon, 2018-08-13 at 19:15 +0200, Marc-André Lureau wrote: > On Mon, Aug 13, 2018 at 6:11 PM, Christophe Fergeau < > cferg...@redhat.com> wrote: > > The simpletlv_* functions return lengths as an int, but the test is > > casting it to a size_t before comparing it against -1. This is not > > giving

Re: [Spice-devel] [PATCH vd_agent 1/2] vdagent/x11-randr: rename error_handler to ignore_error_handler

2018-08-14 Thread Frediano Ziglio
> > The handler is meant to ignore the X11 error, name it properly. > > Signed-off-by: Lukáš Hrázký For the series Acked-by: Frediano Ziglio Frediano > --- > src/vdagent/x11-randr.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/src/vdagent/x11-randr.c

Re: [Spice-devel] [PATCH spice-gtk v4 1/3] Rename generated vncdisplaykeymap_*.c files to .h

2018-08-14 Thread Frediano Ziglio
> On 13/08/18 07:23, Frediano Ziglio wrote: > >> > >> Ninja parallel build fails in certain environments, so it is required > >> specify those files as a dependency so that vncdisplaykeymap.c will only > >> be built after all files it depends on are generated. > >> > >> The problem is that, when us

Re: [Spice-devel] [PATCH] win-usb-dev: Set UsbDk backend on libusb 1.0.22

2018-08-14 Thread Jorge Olmos
Hi, On Mon, 2018-08-13 at 17:25 +0200, Christophe Fergeau wrote: > Hey, > > On Mon, Aug 13, 2018 at 03:45:06PM +0200, Jorge Olmos wrote: > > This patch configures libusb in the context used in win-usb-dev, > > with > > the same backend as the context initialized in usb-device-manager. > > > > Oth