Re: [Spice-devel] [spice-gtk v1 1/2] spice-widget: Use GdkSeat API on Wayland
Hi, On Thu, Feb 14, 2019 at 04:04:45PM +, Victor Toso wrote: > From: Olivier Fourdan > > Using different GDK APIs to grab and ungrab devices leads to > undetermined behavior and can cause the cursor to remain hidden on > ungrab on Wayland because GDK Wayland backend keeps a reference of > the GdkSeat cursor. > > On Wayland, use the GdkSeat API only even for ungrab, by ungrabbing the > seat and immediately re-grabbing the remaining keyboard or pointer if > the grab is to be retained. > > Thanks-to: Peter Hutterer > Signed-off-by: Olivier Fourdan > Fixes: https://gitlab.freedesktop.org/spice/spice-gtk/issues/83 > See-also: https://gitlab.gnome.org/GNOME/gtk/issues/787 IMHO, this two patches are good to be merged so I'll be pushing them in the next hour or so. Acked-by: Victor Toso > --- > src/spice-widget.c | 82 +++--- > 1 file changed, 78 insertions(+), 4 deletions(-) > > diff --git a/src/spice-widget.c b/src/spice-widget.c > index 8adcc38..fd0c935 100644 > --- a/src/spice-widget.c > +++ b/src/spice-widget.c > @@ -32,6 +32,9 @@ > #include > #endif > #endif > +#ifdef GDK_WINDOWING_WAYLAND > +#include > +#endif > #ifdef G_OS_WIN32 > #include > #include > @@ -887,12 +890,46 @@ static void try_keyboard_grab(SpiceDisplay *display) > } > } > > -static void ungrab_keyboard(G_GNUC_UNUSED SpiceDisplay *display) > +static void ungrab_keyboard(SpiceDisplay *display) > { > +GdkSeat *seat = spice_display_get_default_seat(display); > +GdkDevice *keyboard = gdk_seat_get_keyboard(seat); > + > +#ifdef GDK_WINDOWING_WAYLAND > +/* On Wayland, use the GdkSeat API alone. > + * We simply issue a gdk_seat_ungrab() followed immediately by another > + * gdk_seat_grab() on the pointer if the pointer grab is to be kept. > + */ > +if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) { > +SpiceDisplayPrivate *d = display->priv; > + > +gdk_seat_ungrab(seat); > + > +if (d->mouse_grab_active) { > +GdkGrabStatus status; > +GdkCursor *blank = spice_display_get_blank_cursor(display); > + > +status = gdk_seat_grab(seat, > + > gtk_widget_get_window(GTK_WIDGET(display)), > + GDK_SEAT_CAPABILITY_ALL_POINTING, > + TRUE, > + blank, > + NULL, > + NULL, > + NULL); > +if (status != GDK_GRAB_SUCCESS) { > +g_warning("pointer grab failed %u", status); > +d->mouse_grab_active = false; > +} > +} > + > +return; > +} > +#endif > + > G_GNUC_BEGIN_IGNORE_DEPRECATIONS > /* we want to ungrab just the keyboard - it is not possible using > gdk_seat_ungrab(). > See also https://bugzilla.gnome.org/show_bug.cgi?id=780133 */ > -GdkDevice *keyboard = > gdk_seat_get_keyboard(spice_display_get_default_seat(display)); > gdk_device_ungrab(keyboard, GDK_CURRENT_TIME); > G_GNUC_END_IGNORE_DEPRECATIONS > } > @@ -1148,12 +1185,49 @@ static void mouse_wrap(SpiceDisplay *display, > GdkEventMotion *motion) > > } > > -static void ungrab_pointer(G_GNUC_UNUSED SpiceDisplay *display) > +static void ungrab_pointer(SpiceDisplay *display) > { > +GdkSeat *seat = spice_display_get_default_seat(display); > +GdkDevice *pointer = gdk_seat_get_pointer(seat); > + > +#ifdef GDK_WINDOWING_WAYLAND > +/* On Wayland, mixing the GdkSeat and the GdkDevice APIs leave the > + * cursor unchanged because the GDK Wayland backend keeps a reference > + * of the cursor set previously using gdk_seat_grab() attached to the > + * GdkSeat. > + * To avoid that issue, we simply issue a gdk_seat_ungrab() followed > + * immediately by another gdk_seat_grab() on the keyboard if the > + * keyboard grab is to be kept. > + */ > +if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) { > +SpiceDisplayPrivate *d = display->priv; > + > +gdk_seat_ungrab(seat); > + > +if (d->keyboard_grab_active) { > +GdkGrabStatus status; > + > +status = gdk_seat_grab(seat, > + > gtk_widget_get_window(GTK_WIDGET(display)), > + GDK_SEAT_CAPABILITY_KEYBOARD, > + FALSE, > + NULL, > + NULL, > + NULL, > + NULL); > +if (status != GDK_GRAB_SUCCESS) { > +g_warning("keyboard grab failed %u", status); > +d->keyboard_grab_active = false; > +} > +} > + > +return; > +} > +#endif > + > G_GNUC_BEGIN_IGNORE_DEPRECATIONS > /* we
Re: [Spice-devel] [vdagent-linux] x11: invalidate requests for targets on grab from client
Hi, On Thu, Feb 21, 2019 at 09:25:57PM +0100, Jakub Janků wrote: > 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. Thanks, seems fine :) > Otherwise we end up in a situation when vdagent holds > the clipboard grab in the guest but cannot provide data to the > apps that request it - this can be observed in the log: > > clipboard: received selection request event for target *, while not > owning client clipboard > > Signed-off-by: Jakub Janků I'll be testing a little bit more this with previous patch and if all is good, I'll proposed a release later Today. > --- > > This addresses the same issue as [0], just in the X11 clipboard > implementation. > > [0] > https://lists.freedesktop.org/archives/spice-devel/2019-February/048075.html > > --- > src/vdagent/x11-priv.h | 1 + > src/vdagent/x11.c | 11 +++ > 2 files changed, 12 insertions(+) > > diff --git a/src/vdagent/x11-priv.h b/src/vdagent/x11-priv.h > index e487aa2..99676d2 100644 > --- a/src/vdagent/x11-priv.h > +++ b/src/vdagent/x11-priv.h > @@ -92,6 +92,7 @@ struct vdagent_x11 { > int xfixes_event_base; > int max_prop_size; > int expected_targets_notifies[256]; > +int ignore_targets_notifies[256]; > int clipboard_owner[256]; > int clipboard_type_count[256]; > uint32_t clipboard_agent_types[256][256]; > diff --git a/src/vdagent/x11.c b/src/vdagent/x11.c > index 484be5e..c2515a8 100644 > --- a/src/vdagent/x11.c > +++ b/src/vdagent/x11.c > @@ -945,6 +945,12 @@ static void vdagent_x11_handle_targets_notify(struct > vdagent_x11 *x11, > > x11->expected_targets_notifies[selection]--; > > +if (x11->ignore_targets_notifies[selection] > 0) { > +x11->ignore_targets_notifies[selection]--; > +VSELPRINTF("ignoring selection notify TARGETS"); > +return; > +} > + > /* If we have more targets_notifies pending, ignore this one, we > are only interested in the targets list of the current owner > (which is the last one we've requested a targets list from) */ > @@ -1246,6 +1252,11 @@ void vdagent_x11_clipboard_grab(struct vdagent_x11 > *x11, uint8_t selection, > x11->selection_window, CurrentTime); > vdagent_x11_set_clipboard_owner(x11, selection, owner_client); > > +/* If there're pending requests for targets, ignore the returned > + * targets as the XSetSelectionOwner() call above made them invalid */ > +x11->ignore_targets_notifies[selection] = > +x11->expected_targets_notifies[selection]; > + Acked-by: Victor Toso Victor > /* Flush output buffers and consume any pending events */ > vdagent_x11_do_read(x11); > } > -- > 2.20.1 > > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/spice-devel signature.asc Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH] drm/qxl: unbind vgacon
Hi Gerd, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.0-rc4 next-20190221] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Gerd-Hoffmann/drm-qxl-unbind-vgacon/20190222-030117 config: x86_64-randconfig-l3-02212045 (attached as .config) compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): >> ERROR: "dummy_con" [drivers/gpu/drm/qxl/qxl.ko] undefined! >> ERROR: "do_take_over_console" [drivers/gpu/drm/qxl/qxl.ko] undefined! --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH] drm/qxl: unbind vgacon
Hi Gerd, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.0-rc4 next-20190221] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Gerd-Hoffmann/drm-qxl-unbind-vgacon/20190222-030117 config: x86_64-randconfig-m2-02211051 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): ld: drivers/gpu/drm/qxl/qxl_drv.o: in function `qxl_pci_probe': >> drivers/gpu/drm/qxl/qxl_drv.c:94: undefined reference to `dummy_con' >> ld: drivers/gpu/drm/qxl/qxl_drv.c:94: undefined reference to >> `do_take_over_console' vim +94 drivers/gpu/drm/qxl/qxl_drv.c 61 62 static int 63 qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 64 { 65 struct qxl_device *qdev; 66 int ret; 67 68 if (pdev->revision < 4) { 69 DRM_ERROR("qxl too old, doesn't support client_monitors_config," 70" use xf86-video-qxl in user mode"); 71 return -EINVAL; /* TODO: ENODEV ? */ 72 } 73 74 qdev = kzalloc(sizeof(struct qxl_device), GFP_KERNEL); 75 if (!qdev) 76 return -ENOMEM; 77 78 ret = pci_enable_device(pdev); 79 if (ret) 80 goto free_dev; 81 82 ret = qxl_device_init(qdev, &qxl_driver, pdev); 83 if (ret) 84 goto disable_pci; 85 86 ret = qxl_modeset_init(qdev); 87 if (ret) 88 goto unload; 89 90 drm_kms_helper_poll_init(&qdev->ddev); 91 92 /* unbind vgacon to make sure it doesn't touch our vga registers */ 93 console_lock(); > 94 ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, true); 95 console_unlock(); 96 97 /* Complete initialization. */ 98 ret = drm_dev_register(&qdev->ddev, ent->driver_data); 99 if (ret) 100 goto modeset_cleanup; 101 102 return 0; 103 104 modeset_cleanup: 105 qxl_modeset_fini(qdev); 106 unload: 107 qxl_device_fini(qdev); 108 disable_pci: 109 pci_disable_device(pdev); 110 free_dev: 111 kfree(qdev); 112 return ret; 113 } 114 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [spice-gtk v2] smartcard: Warn if multiple readers are detected
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 --- Alternate version using g_list_length rather than manually counting the elements. src/smartcard-manager.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/src/smartcard-manager.c b/src/smartcard-manager.c index ceecfdc7..144caf9b 100644 --- a/src/smartcard-manager.c +++ b/src/smartcard-manager.c @@ -389,6 +389,24 @@ typedef struct { GError *err; } SmartcardManagerInitArgs; + +static void unref_smartcard_reader(gpointer data) +{ +g_boxed_free(SPICE_TYPE_SMARTCARD_READER, data); +} + +/* spice-server only supports one smartcard reader being in use */ +static void smartcard_check_reader_count(void) +{ +GList *readers; + +readers = spice_smartcard_manager_get_readers(spice_smartcard_manager_get()); +if (g_list_length(readers) > 1) { +g_warning("Multiple smartcard readers are plugged in, only the first one will be shared with the VM"); +} +g_list_free_full(readers, unref_smartcard_reader); +} + static gboolean smartcard_manager_init(SmartcardManagerInitArgs *args) { gchar *emul_args = NULL; @@ -442,6 +460,7 @@ init: "Failed to initialize smartcard"); goto end; } +smartcard_check_reader_count(); retval = TRUE; -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk v2] smartcard: Warn if multiple readers are detected
> > 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 > --- > > Alternate version using g_list_length rather than manually counting the > elements. > > src/smartcard-manager.c | 19 +++ > 1 file changed, 19 insertions(+) > > diff --git a/src/smartcard-manager.c b/src/smartcard-manager.c > index ceecfdc7..144caf9b 100644 > --- a/src/smartcard-manager.c > +++ b/src/smartcard-manager.c > @@ -389,6 +389,24 @@ typedef struct { > GError *err; > } SmartcardManagerInitArgs; > > + > +static void unref_smartcard_reader(gpointer data) We usually use verbs after the name, like smartcard_reader_unref. > +{ > +g_boxed_free(SPICE_TYPE_SMARTCARD_READER, data); > +} > + > +/* spice-server only supports one smartcard reader being in use */ > +static void smartcard_check_reader_count(void) > +{ > +GList *readers; > + > +readers = > spice_smartcard_manager_get_readers(spice_smartcard_manager_get()); > +if (g_list_length(readers) > 1) { > +g_warning("Multiple smartcard readers are plugged in, only the first > one will be shared with the VM"); > +} > +g_list_free_full(readers, unref_smartcard_reader); > +} > + > static gboolean smartcard_manager_init(SmartcardManagerInitArgs *args) > { > gchar *emul_args = NULL; > @@ -442,6 +460,7 @@ init: > "Failed to initialize smartcard"); > goto end; > } > +smartcard_check_reader_count(); > > retval = TRUE; > I think the ack from Marc-andre is still valid, nothing against it. Frediano ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH v4 2/2] drm/qxl: remove conflicting framebuffers earlier
On Fri, Feb 22, 2019 at 08:16:04AM +0100, Gerd Hoffmann wrote: > Add error checking while being at it. > > Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter > --- > 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 > --- a/drivers/gpu/drm/qxl/qxl_drv.c > +++ b/drivers/gpu/drm/qxl/qxl_drv.c > @@ -79,6 +79,10 @@ qxl_pci_probe(struct pci_dev *pdev, const struct > pci_device_id *ent) > if (ret) > goto free_dev; > > + ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl"); > + if (ret) > + goto disable_pci; > + > ret = qxl_device_init(qdev, &qxl_driver, pdev); > if (ret) > goto disable_pci; > @@ -94,7 +98,6 @@ qxl_pci_probe(struct pci_dev *pdev, const struct > pci_device_id *ent) > if (ret) > goto modeset_cleanup; > > - drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl"); > drm_fbdev_generic_setup(&qdev->ddev, 32); > return 0; > > -- > 2.9.3 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk v2] smartcard: Warn if multiple readers are detected
Hi On Fri, Feb 22, 2019 at 10:44 AM Frediano Ziglio 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 > > --- > > > > Alternate version using g_list_length rather than manually counting the > > elements. > > > > src/smartcard-manager.c | 19 +++ > > 1 file changed, 19 insertions(+) > > > > diff --git a/src/smartcard-manager.c b/src/smartcard-manager.c > > index ceecfdc7..144caf9b 100644 > > --- a/src/smartcard-manager.c > > +++ b/src/smartcard-manager.c > > @@ -389,6 +389,24 @@ typedef struct { > > GError *err; > > } SmartcardManagerInitArgs; > > > > + > > +static void unref_smartcard_reader(gpointer data) > > We usually use verbs after the name, like smartcard_reader_unref. And in this case, it should probably be smartcard_reader_free() (otherwise I expect _ref to exist!) > > > +{ > > +g_boxed_free(SPICE_TYPE_SMARTCARD_READER, data); > > +} > > + > > +/* spice-server only supports one smartcard reader being in use */ > > +static void smartcard_check_reader_count(void) > > +{ > > +GList *readers; > > + > > +readers = > > spice_smartcard_manager_get_readers(spice_smartcard_manager_get()); > > +if (g_list_length(readers) > 1) { > > +g_warning("Multiple smartcard readers are plugged in, only the > > first > > one will be shared with the VM"); > > +} > > +g_list_free_full(readers, unref_smartcard_reader); > > +} > > + > > static gboolean smartcard_manager_init(SmartcardManagerInitArgs *args) > > { > > gchar *emul_args = NULL; > > @@ -442,6 +460,7 @@ init: > > "Failed to initialize smartcard"); > > goto end; > > } > > +smartcard_check_reader_count(); > > > > retval = TRUE; > > > > I think the ack from Marc-andre is still valid, nothing against it. > > Frediano > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/spice-devel -- Marc-André Lureau ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [PATCH spice-common] proto: Remove obsolete TunnelChannel
No reason to keep it, spice-gtk and spice-server don't implement it and was removed for security reasons. Signed-off-by: Frediano Ziglio --- common/messages.h | 99 spice.proto | 113 +- 2 files changed, 2 insertions(+), 210 deletions(-) diff --git a/common/messages.h b/common/messages.h index 3e37235..43d3602 100644 --- a/common/messages.h +++ b/common/messages.h @@ -489,105 +489,6 @@ typedef struct SpiceMsgcRecordStartMark { uint32_t time; } SpiceMsgcRecordStartMark; -typedef struct SpiceMsgTunnelInit { -uint16_t max_num_of_sockets; -uint32_t max_socket_data_size; -} SpiceMsgTunnelInit; - -typedef uint8_t SpiceTunnelIPv4[4]; - -typedef struct SpiceMsgTunnelIpInfo { -uint16_t type; -union { - SpiceTunnelIPv4 ipv4; -} u; -uint8_t data[0]; -} SpiceMsgTunnelIpInfo; - -typedef struct SpiceMsgTunnelServiceIpMap { -uint32_t service_id; -SpiceMsgTunnelIpInfo virtual_ip; -} SpiceMsgTunnelServiceIpMap; - -typedef struct SpiceMsgTunnelSocketOpen { -uint16_t connection_id; -uint32_t service_id; -uint32_t tokens; -} SpiceMsgTunnelSocketOpen; - -/* connection id must be the first field in msgs directed to a specific connection */ - -typedef struct SpiceMsgTunnelSocketFin { -uint16_t connection_id; -} SpiceMsgTunnelSocketFin; - -typedef struct SpiceMsgTunnelSocketClose { -uint16_t connection_id; -} SpiceMsgTunnelSocketClose; - -typedef struct SpiceMsgTunnelSocketData { -uint16_t connection_id; -uint8_t data[0]; -} SpiceMsgTunnelSocketData; - -typedef struct SpiceMsgTunnelSocketTokens { -uint16_t connection_id; -uint32_t num_tokens; -} SpiceMsgTunnelSocketTokens; - -typedef struct SpiceMsgTunnelSocketClosedAck { -uint16_t connection_id; -} SpiceMsgTunnelSocketClosedAck; - -typedef struct SpiceMsgcTunnelAddGenericService { -uint32_t type; -uint32_t id; -uint32_t group; -uint32_t port; -uint64_t name; -uint64_t description; -union { -SpiceMsgTunnelIpInfo ip; -} u; -} SpiceMsgcTunnelAddGenericService; - -typedef struct SpiceMsgcTunnelRemoveService { -uint32_t id; -} SpiceMsgcTunnelRemoveService; - -/* connection id must be the first field in msgs directed to a specific connection */ - -typedef struct SpiceMsgcTunnelSocketOpenAck { -uint16_t connection_id; -uint32_t tokens; -} SpiceMsgcTunnelSocketOpenAck; - -typedef struct SpiceMsgcTunnelSocketOpenNack { -uint16_t connection_id; -} SpiceMsgcTunnelSocketOpenNack; - -typedef struct SpiceMsgcTunnelSocketData { -uint16_t connection_id; -uint8_t data[0]; -} SpiceMsgcTunnelSocketData; - -typedef struct SpiceMsgcTunnelSocketFin { -uint16_t connection_id; -} SpiceMsgcTunnelSocketFin; - -typedef struct SpiceMsgcTunnelSocketClosed { -uint16_t connection_id; -} SpiceMsgcTunnelSocketClosed; - -typedef struct SpiceMsgcTunnelSocketClosedAck { -uint16_t connection_id; -} SpiceMsgcTunnelSocketClosedAck; - -typedef struct SpiceMsgcTunnelSocketTokens { -uint16_t connection_id; -uint32_t num_tokens; -} SpiceMsgcTunnelSocketTokens; - #ifdef USE_SMARTCARD typedef struct SpiceMsgSmartcard { VSCMsgType type; diff --git a/spice.proto b/spice.proto index 02ab4df..51ce3ca 100644 --- a/spice.proto +++ b/spice.proto @@ -1235,115 +1235,6 @@ channel RecordChannel : BaseChannel { } start_mark; }; -enum16 tunnel_service_type { -INVALID, -GENERIC, -IPP, -}; - -enum16 tunnel_ip_type { -INVALID, -IPv4, -}; - -struct TunnelIpInfo { -tunnel_ip_type type; -switch (type) { -case IPv4: -uint8 ipv4[4]; -} u; -} @ctype(SpiceMsgTunnelIpInfo); - -channel TunnelChannel : BaseChannel { - server: -message { -uint16 max_num_of_sockets; -uint32 max_socket_data_size; -} init = 101; - -message { -uint32 service_id; -TunnelIpInfo virtual_ip; -} service_ip_map; - -message { -uint16 connection_id; -uint32 service_id; -uint32 tokens; -} socket_open; - -message { -uint16 connection_id; -} socket_fin; - -message { -uint16 connection_id; -} socket_close; - -message { -uint16 connection_id; -uint8 data[] @end; -} socket_data; - -message { -uint16 connection_id; -} socket_closed_ack; - -message { -uint16 connection_id; -uint32 num_tokens; -} @ctype(SpiceMsgTunnelSocketTokens) socket_token; - - client: -message { -tunnel_service_type type; -uint32 id; -uint32 group; -uint32 port; -uint8 *name[cstring()] @nocopy; -uint8 *description[cstring()] @nocopy; -switch (type) { -case IPP: -TunnelIpInfo ip @ctype(SpiceMsgTunnelIpInfo); -} u; -} @ctype(SpiceMsgcTunnelAddGenericService) service_add = 101; - -message { -uint32 id; -} @ctype(SpiceMs
[Spice-devel] [PATCH spice-server] char-device: Make RedClient an opaque structure again
RedClient was an opaque structure for RedCharDevice. It started to be used when RedsState started to contain all the global state. Make it opaque again. Signed-off-by: Frediano Ziglio --- server/char-device.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/server/char-device.c b/server/char-device.c index 040b91147..465c1a125 100644 --- a/server/char-device.c +++ b/server/char-device.c @@ -22,8 +22,8 @@ #include #include + #include "char-device.h" -#include "red-client.h" #include "reds.h" #include "glib-compat.h" @@ -703,11 +703,10 @@ void red_char_device_destroy(RedCharDevice *char_dev) g_object_unref(char_dev); } -static RedCharDeviceClient *red_char_device_client_new(RedClient *client, - int do_flow_control, - uint32_t max_send_queue_size, - uint32_t num_client_tokens, - uint32_t num_send_tokens) +static RedCharDeviceClient * +red_char_device_client_new(RedsState *reds, RedClient *client, + int do_flow_control, uint32_t max_send_queue_size, + uint32_t num_client_tokens, uint32_t num_send_tokens) { RedCharDeviceClient *dev_client; @@ -717,8 +716,6 @@ static RedCharDeviceClient *red_char_device_client_new(RedClient *client, dev_client->max_send_queue_size = max_send_queue_size; dev_client->do_flow_control = do_flow_control; if (do_flow_control) { -RedsState *reds = red_client_get_server(client); - dev_client->wait_for_tokens_timer = reds_core_timer_add(reds, device_client_wait_for_tokens_timeout, dev_client); @@ -757,7 +754,8 @@ bool red_char_device_client_add(RedCharDevice *dev, dev->priv->wait_for_migrate_data = wait_for_migrate_data; spice_debug("char device %p, client %p", dev, client); -dev_client = red_char_device_client_new(client, do_flow_control, +dev_client = red_char_device_client_new(dev->priv->reds, client, +do_flow_control, max_send_queue_size, num_client_tokens, num_send_tokens); -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH spice-server] Removed some not necessary headers inclusions
> 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 | 1 - > > 6 files changed, 8 deletions(-) > > > > diff --git a/server/display-channel.h b/server/display-channel.h > > index 948018cf3..be853e891 100644 > > --- a/server/display-channel.h > > +++ b/server/display-channel.h > > @@ -24,13 +24,10 @@ > > > > #include "reds.h" > > #include "red-parse-qxl.h" > > -#include "red-channel.h" > > #include "main-channel.h" > > -#include "spice-bitmap-utils.h" > > #include "tree.h" > > #include "video-stream.h" > > #include "dcc.h" > > -#include "image-encoders.h" > > #include "common-graphics-channel.h" > > Seems that display-channel.h uses a GlzImageRetention type which is > defined in image-encoders.h. And BitmapGradualType which is defined in > spice-bitmap-utils.h. Presumably these headers are indirectly pulled in > via other includes, but it's unwise to rely on that. > > Other ones below have similar issues. How did you decide to remove > these headers? > > Reviewed-by: Jonathon Jongsma > I'll review it, came from an old patch, at a first sight was fine. I think including spice.h and red-common.h does not make sense, including red-common.h means that you know that some headers are included so there's no reason to include them again. Frediano > > > > > G_BEGIN_DECLS > > diff --git a/server/inputs-channel.h b/server/inputs-channel.h > > index 945ba6173..b771eb1af 100644 > > --- a/server/inputs-channel.h > > +++ b/server/inputs-channel.h > > @@ -23,7 +23,6 @@ > > > > #include > > #include > > -#include > > > > #include "red-channel.h" > > > > diff --git a/server/main-dispatcher.h b/server/main-dispatcher.h > > index e1244f836..ba3efa2da 100644 > > --- a/server/main-dispatcher.h > > +++ b/server/main-dispatcher.h > > @@ -19,7 +19,6 @@ > > #ifndef MAIN_DISPATCHER_H_ > > #define MAIN_DISPATCHER_H_ > > > > -#include "spice.h" > > #include "dispatcher.h" > > #include "red-channel.h" > > > > diff --git a/server/red-channel.h b/server/red-channel.h > > index bb3a95e8b..25ade8579 100644 > > --- a/server/red-channel.h > > +++ b/server/red-channel.h > > @@ -29,7 +29,6 @@ > > #include > > #include > > > > -#include "spice.h" > > #include "red-common.h" > > #include "red-stream.h" > > #include "stat.h" > > diff --git a/server/red-parse-qxl.h b/server/red-parse-qxl.h > > index 61c71d6e4..d3cacc08f 100644 > > --- a/server/red-parse-qxl.h > > +++ b/server/red-parse-qxl.h > > @@ -21,7 +21,6 @@ > > > > #include > > > > -#include "red-common.h" > > #include "memslot.h" > > > > typedef struct RedDrawable { > > diff --git a/server/red-record-qxl.h b/server/red-record-qxl.h > > index d19843279..b40922c86 100644 > > --- a/server/red-record-qxl.h > > +++ b/server/red-record-qxl.h > > @@ -21,7 +21,6 @@ > > > > #include > > > > -#include "red-common.h" > > #include "memslot.h" > > #include "utils.h" > > > > ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH spice-server v4 00/20] Port SPICE server to Windows
ping > > Windows support is useful to use with Qemu under Windows as host or > to implement servers like Xspice. > Mainly SPICE server uses lot of libraries to expose a TCP protocol. > As TCP is implemented with socket library which is quite portable was > not that hard to port. > Beside some minor feature (see REAME.Windows) all was ported. > During porting was choosen to keep Unix as the main platform, if a > change would require too much changes some Windows wrapper is > preferred instead. Not too complicated stuff, the main "wrapper" is > that Windows errors from socket are written back into errno to avoid > to change lot of code handling errors. > > Changes since v3: > - reduce compatibility layer size: > - do not change function name if not required; > - use int instead of a new socket_t. > > Changes since v2: > - better %m replacement; > - many comments updates; > - typo and grammar fixes; > - use int to store socket descriptors/handles; > - merge all v2 updates into a single series; > - split formatting string patch. > > Frediano Ziglio (20): > Use proper format strings for spice_log > build: Detect Windows build and change some definitions > Avoids %m in formatting for Windows > windows: Undefine some conflicting preprocessor macros > tests: Provide alarm replacement for Windows > test-stat: Adjust delay checks > sys-socket: Introduce some utility to make sockets more portable > sys-socket: Add socket_newpair utility > net-utils: Use socket compatibility layer > reds: Use socket compatibility layer > red-stream: Use socket compatibility layer > dispatcher: Use socket compatibility layer > test-leaks: Use socket compatibility layer > test-channel: Use socket compatibility layer > windows: Disable code not working on Windows > dispatcher: Port to Windows > tests: Exclude tests that cannot work on Windows > red-stream: Fix SSL connection for Windows > Disable recording filtering for Windows > Add some notes for the Windows port > > README.Windows| 18 ++ > configure.ac | 20 ++- > server/Makefile.am| 2 + > server/char-device.c | 3 +- > server/dispatcher.c | 28 ++- > server/gstreamer-encoder.c| 4 +- > server/main-channel-client.c | 6 +- > server/memslot.c | 2 +- > server/mjpeg-encoder.c| 6 +- > server/net-utils.c| 11 ++ > server/red-channel-client.c | 2 + > server/red-channel.c | 6 +- > server/red-client.c | 6 +- > server/red-common.h | 1 + > server/red-qxl.c | 4 + > server/red-record-qxl.c | 7 + > server/red-replay-qxl.c | 9 +- > server/red-stream.c | 48 - > server/red-stream.h | 2 + > server/red-worker.c | 6 + > server/reds.c | 53 +++--- > server/sound.c| 5 +- > server/stat-file.c| 2 + > server/sys-socket.c | 287 ++ > server/sys-socket.h | 142 +++ > server/tests/Makefile.am | 11 +- > server/tests/basic-event-loop.c | 2 + > server/tests/replay.c | 2 + > server/tests/stat-test.c | 12 +- > server/tests/test-channel.c | 9 +- > server/tests/test-leaks.c | 5 +- > server/tests/test-loop.c | 1 + > server/tests/test-record.c| 7 +- > server/tests/test-stream-device.c | 1 + > server/tests/win-alarm.c | 65 +++ > server/tests/win-alarm.h | 26 +++ > tools/Makefile.am | 2 + > 37 files changed, 753 insertions(+), 70 deletions(-) > create mode 100644 README.Windows > create mode 100644 server/sys-socket.c > create mode 100644 server/sys-socket.h > create mode 100644 server/tests/win-alarm.c > create mode 100644 server/tests/win-alarm.h > ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH spice-common] proto: Remove obsolete TunnelChannel
Hi On Fri, Feb 22, 2019 at 10:54 AM Frediano Ziglio wrote: > > No reason to keep it, spice-gtk and spice-server don't > implement it and was removed for security reasons. > > Signed-off-by: Frediano Ziglio ack (I think this could eventually be hacked together again when slirp is made a standalone project. Without modifying much of qemu or spice-gtk, you could let a guest access the client network.. that could be fun, not sure if it should become a real solution ;). > --- > common/messages.h | 99 > spice.proto | 113 +- > 2 files changed, 2 insertions(+), 210 deletions(-) > > diff --git a/common/messages.h b/common/messages.h > index 3e37235..43d3602 100644 > --- a/common/messages.h > +++ b/common/messages.h > @@ -489,105 +489,6 @@ typedef struct SpiceMsgcRecordStartMark { > uint32_t time; > } SpiceMsgcRecordStartMark; > > -typedef struct SpiceMsgTunnelInit { > -uint16_t max_num_of_sockets; > -uint32_t max_socket_data_size; > -} SpiceMsgTunnelInit; > - > -typedef uint8_t SpiceTunnelIPv4[4]; > - > -typedef struct SpiceMsgTunnelIpInfo { > -uint16_t type; > -union { > - SpiceTunnelIPv4 ipv4; > -} u; > -uint8_t data[0]; > -} SpiceMsgTunnelIpInfo; > - > -typedef struct SpiceMsgTunnelServiceIpMap { > -uint32_t service_id; > -SpiceMsgTunnelIpInfo virtual_ip; > -} SpiceMsgTunnelServiceIpMap; > - > -typedef struct SpiceMsgTunnelSocketOpen { > -uint16_t connection_id; > -uint32_t service_id; > -uint32_t tokens; > -} SpiceMsgTunnelSocketOpen; > - > -/* connection id must be the first field in msgs directed to a specific > connection */ > - > -typedef struct SpiceMsgTunnelSocketFin { > -uint16_t connection_id; > -} SpiceMsgTunnelSocketFin; > - > -typedef struct SpiceMsgTunnelSocketClose { > -uint16_t connection_id; > -} SpiceMsgTunnelSocketClose; > - > -typedef struct SpiceMsgTunnelSocketData { > -uint16_t connection_id; > -uint8_t data[0]; > -} SpiceMsgTunnelSocketData; > - > -typedef struct SpiceMsgTunnelSocketTokens { > -uint16_t connection_id; > -uint32_t num_tokens; > -} SpiceMsgTunnelSocketTokens; > - > -typedef struct SpiceMsgTunnelSocketClosedAck { > -uint16_t connection_id; > -} SpiceMsgTunnelSocketClosedAck; > - > -typedef struct SpiceMsgcTunnelAddGenericService { > -uint32_t type; > -uint32_t id; > -uint32_t group; > -uint32_t port; > -uint64_t name; > -uint64_t description; > -union { > -SpiceMsgTunnelIpInfo ip; > -} u; > -} SpiceMsgcTunnelAddGenericService; > - > -typedef struct SpiceMsgcTunnelRemoveService { > -uint32_t id; > -} SpiceMsgcTunnelRemoveService; > - > -/* connection id must be the first field in msgs directed to a specific > connection */ > - > -typedef struct SpiceMsgcTunnelSocketOpenAck { > -uint16_t connection_id; > -uint32_t tokens; > -} SpiceMsgcTunnelSocketOpenAck; > - > -typedef struct SpiceMsgcTunnelSocketOpenNack { > -uint16_t connection_id; > -} SpiceMsgcTunnelSocketOpenNack; > - > -typedef struct SpiceMsgcTunnelSocketData { > -uint16_t connection_id; > -uint8_t data[0]; > -} SpiceMsgcTunnelSocketData; > - > -typedef struct SpiceMsgcTunnelSocketFin { > -uint16_t connection_id; > -} SpiceMsgcTunnelSocketFin; > - > -typedef struct SpiceMsgcTunnelSocketClosed { > -uint16_t connection_id; > -} SpiceMsgcTunnelSocketClosed; > - > -typedef struct SpiceMsgcTunnelSocketClosedAck { > -uint16_t connection_id; > -} SpiceMsgcTunnelSocketClosedAck; > - > -typedef struct SpiceMsgcTunnelSocketTokens { > -uint16_t connection_id; > -uint32_t num_tokens; > -} SpiceMsgcTunnelSocketTokens; > - > #ifdef USE_SMARTCARD > typedef struct SpiceMsgSmartcard { > VSCMsgType type; > diff --git a/spice.proto b/spice.proto > index 02ab4df..51ce3ca 100644 > --- a/spice.proto > +++ b/spice.proto > @@ -1235,115 +1235,6 @@ channel RecordChannel : BaseChannel { > } start_mark; > }; > > -enum16 tunnel_service_type { > -INVALID, > -GENERIC, > -IPP, > -}; > - > -enum16 tunnel_ip_type { > -INVALID, > -IPv4, > -}; > - > -struct TunnelIpInfo { > -tunnel_ip_type type; > -switch (type) { > -case IPv4: > -uint8 ipv4[4]; > -} u; > -} @ctype(SpiceMsgTunnelIpInfo); > - > -channel TunnelChannel : BaseChannel { > - server: > -message { > -uint16 max_num_of_sockets; > -uint32 max_socket_data_size; > -} init = 101; > - > -message { > -uint32 service_id; > -TunnelIpInfo virtual_ip; > -} service_ip_map; > - > -message { > -uint16 connection_id; > -uint32 service_id; > -uint32 tokens; > -} socket_open; > - > -message { > -uint16 connection_id; > -} socket_fin; > - > -message { > -uint16 connection_id; > -} socket_close; > - > -message { > -uint16 connection_id; > -uint8 data[] @end; > -
[Spice-devel] [spice-gtk v3] smartcard: Warn if multiple readers are detected
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 --- src/smartcard-manager.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/src/smartcard-manager.c b/src/smartcard-manager.c index ceecfdc7..35bb2757 100644 --- a/src/smartcard-manager.c +++ b/src/smartcard-manager.c @@ -389,6 +389,24 @@ typedef struct { GError *err; } SmartcardManagerInitArgs; + +static void smartcard_reader_free(gpointer data) +{ +g_boxed_free(SPICE_TYPE_SMARTCARD_READER, data); +} + +/* spice-server only supports one smartcard reader being in use */ +static void smartcard_check_reader_count(void) +{ +GList *readers; + +readers = spice_smartcard_manager_get_readers(spice_smartcard_manager_get()); +if (g_list_length(readers) > 1) { +g_warning("Multiple smartcard readers are plugged in, only the first one will be shared with the VM"); +} +g_list_free_full(readers, smartcard_reader_free); +} + static gboolean smartcard_manager_init(SmartcardManagerInitArgs *args) { gchar *emul_args = NULL; @@ -442,6 +460,7 @@ init: "Failed to initialize smartcard"); goto end; } +smartcard_check_reader_count(); retval = TRUE; -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [PATCH v5 3/3] drm/qxl: remove conflicting framebuffers earlier
Add error checking while being at it. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- 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 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -79,6 +79,10 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (ret) goto free_dev; + ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl"); + if (ret) + goto disable_pci; + ret = qxl_device_init(qdev, &qxl_driver, pdev); if (ret) goto disable_pci; @@ -94,7 +98,6 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (ret) goto modeset_cleanup; - drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl"); drm_fbdev_generic_setup(&qdev->ddev, 32); return 0; -- 2.9.3 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk] usb-redir: use persistent libusb device on Windows
Hi, On Thu, Feb 21, 2019 at 09:37:06AM +0200, Yuri Benditovich wrote: > On Wed, Feb 20, 2019 at 6:03 PM Christophe Fergeau > wrote: > > > static SpiceUsbDevice* > > > spice_usb_device_manager_find_device(SpiceUsbDeviceManager *self, > > > const int bus, const int address) > > > @@ -970,6 +914,16 @@ static void > > > spice_usb_device_manager_add_dev(SpiceUsbDeviceManager *self, > > > if (desc.bDeviceClass == LIBUSB_CLASS_HUB) > > > return; > > > > > > +if (spice_usb_device_manager_find_device(self, > > > +libusb_get_bus_number(libdev), > > > +libusb_get_device_address(libdev))) { > > > +SPICE_DEBUG("device not added %04x:%04x (%p)", > > > +desc.idVendor, > > > +desc.idProduct, > > > +libdev); > > > +return; > > > +} > > > + > > > > I did not understand why we need this? > > There are several reasons: > 1. It is possible that the hot plug procedure for Linux might be > called more than once for the same device (this is mentioned in libusb > API). It's http://libusb.sourceforge.net/api-1.0/group__hotplug.html#gae6c5f1add6cc754005549c7259dc35ea and this can happen at coldplug time (ie when using LIBUSB_HOTPLUG_ENUMERATE), so exactly the race I was worried about before. > 2. If second instance of usb-device-manager created (as it happens at > time of remote-viewer termination), It sounds weird that we create a new one when exiting, probably something we can/should get rid of if this starts causing problems. > existing one receives each device that already present. > 3. It is much simpler to exclude device duplication than later look > why they present. All of these explanations would be very useful to have in the log of a separate commit. > > > +#ifdef G_OS_WIN32 > > > static void spice_usb_device_manager_uevent_cb(GUdevClient *client, > > > - const gchar *action, > > > - GUdevDevice *udevice, > > > + libusb_device *libdev, > > > + gboolean add, > > > gpointer > > > user_data) > > > { > > > SpiceUsbDeviceManager *self = SPICE_USB_DEVICE_MANAGER(user_data); > > > > > > -if (g_str_equal(action, "add")) > > > -spice_usb_device_manager_add_udev(self, udevice); > > > -else if (g_str_equal (action, "remove")) > > > -spice_usb_device_manager_remove_udev(self, udevice); > > > +if (add) > > > +spice_usb_device_manager_add_dev(self, libdev); > > > +else > > > +spice_usb_device_manager_remove_dev(self, > > > +libusb_get_bus_number(libdev), > > > +libusb_get_device_address(libdev)); > > > > This could almost reuse spice_usb_device_manager_hotplug_cb somehow, but > > I'm not sure this is worth it. > > What I'm expected to do to address this note? Just random thoughts, maybe you'll think this could be a useful improvement, maybe you already considered it and rejected it, maybe it's not a good idea, I don't know. I don't have any expectations, just something that could be useful to mention. > > > @@ -1889,9 +1751,7 @@ static SpiceUsbDeviceInfo > > > *spice_usb_device_new(libusb_device *libdev) > > > info->pid = pid; > > > info->ref = 1; > > > info->isochronous = probe_isochronous_endpoint(libdev); > > > -#ifndef G_OS_WIN32 > > > info->libdev = libusb_ref_device(libdev); > > > -#endif > > > > > > return info; > > > } > > > @@ -2027,14 +1887,11 @@ static void spice_usb_device_unref(SpiceUsbDevice > > > *device) > > > > > > ref_count_is_0 = g_atomic_int_dec_and_test(&info->ref); > > > if (ref_count_is_0) { > > > -#ifndef G_OS_WIN32 > > > libusb_unref_device(info->libdev); > > > -#endif > > > > Most of the 'persistent' libusb_device changes for Windows are in the > > hunks before this, but they also depend on some rework of the hotplug > > detection in GUdevClient. > > What I'm expected to do to address this note? Just a comment that could be useful to me in the future, or to other people looking at that mail. > > > diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c > > > index 327976d..ef6804f 100644 > > > --- a/src/win-usb-dev.c > > > +++ b/src/win-usb-dev.c > > > @@ -49,31 +49,6 @@ G_DEFINE_TYPE_WITH_CODE(GUdevClient, g_udev_client, > > > G_TYPE_OBJECT, > > > G_ADD_PRIVATE(GUdevClient) > > > G_IMPLEMENT_INTERFACE(G_TYPE_INITABLE, > > > g_udev_client_initable_iface_init)) > > > > > > - > > > -typedef struct _GUdevDeviceInfo GUdevDeviceInfo; > > > - > > > -struct _GUdevDeviceInfo { > > > -guint16 bus; > > > -guint
[Spice-devel] [PATCH spice-protocol] protocol: Generate enums.h again to remove old protocol definitions
spice.proto was updated to remove really old definitions, update enums.h accordingly. Signed-off-by: Frediano Ziglio --- spice/enums.h | 57 --- 1 file changed, 57 deletions(-) diff --git a/spice/enums.h b/spice/enums.h index 34e84c3..172cc4d 100644 --- a/spice/enums.h +++ b/spice/enums.h @@ -119,21 +119,6 @@ typedef enum SpiceMouseMode { SPICE_MOUSE_MODE_MASK = 0x3 } SpiceMouseMode; -typedef enum SpicePubkeyType { -SPICE_PUBKEY_TYPE_INVALID, -SPICE_PUBKEY_TYPE_RSA, -SPICE_PUBKEY_TYPE_RSA2, -SPICE_PUBKEY_TYPE_DSA, -SPICE_PUBKEY_TYPE_DSA1, -SPICE_PUBKEY_TYPE_DSA2, -SPICE_PUBKEY_TYPE_DSA3, -SPICE_PUBKEY_TYPE_DSA4, -SPICE_PUBKEY_TYPE_DH, -SPICE_PUBKEY_TYPE_EC, - -SPICE_PUBKEY_TYPE_ENUM_END -} SpicePubkeyType; - typedef enum SpiceDataCompressionType { SPICE_DATA_COMPRESSION_TYPE_NONE, SPICE_DATA_COMPRESSION_TYPE_LZ4, @@ -397,21 +382,6 @@ typedef enum SpiceAudioFmt { SPICE_AUDIO_FMT_ENUM_END } SpiceAudioFmt; -typedef enum SpiceTunnelServiceType { -SPICE_TUNNEL_SERVICE_TYPE_INVALID, -SPICE_TUNNEL_SERVICE_TYPE_GENERIC, -SPICE_TUNNEL_SERVICE_TYPE_IPP, - -SPICE_TUNNEL_SERVICE_TYPE_ENUM_END -} SpiceTunnelServiceType; - -typedef enum SpiceTunnelIpType { -SPICE_TUNNEL_IP_TYPE_INVALID, -SPICE_TUNNEL_IP_TYPE_IPv4, - -SPICE_TUNNEL_IP_TYPE_ENUM_END -} SpiceTunnelIpType; - typedef enum SpiceVscMessageType { SPICE_VSC_MESSAGE_TYPE_Init = 1, SPICE_VSC_MESSAGE_TYPE_Error, @@ -613,33 +583,6 @@ enum { SPICE_MSGC_END_RECORD }; -enum { -SPICE_MSG_TUNNEL_INIT = 101, -SPICE_MSG_TUNNEL_SERVICE_IP_MAP, -SPICE_MSG_TUNNEL_SOCKET_OPEN, -SPICE_MSG_TUNNEL_SOCKET_FIN, -SPICE_MSG_TUNNEL_SOCKET_CLOSE, -SPICE_MSG_TUNNEL_SOCKET_DATA, -SPICE_MSG_TUNNEL_SOCKET_CLOSED_ACK, -SPICE_MSG_TUNNEL_SOCKET_TOKEN, - -SPICE_MSG_END_TUNNEL -}; - -enum { -SPICE_MSGC_TUNNEL_SERVICE_ADD = 101, -SPICE_MSGC_TUNNEL_SERVICE_REMOVE, -SPICE_MSGC_TUNNEL_SOCKET_OPEN_ACK, -SPICE_MSGC_TUNNEL_SOCKET_OPEN_NACK, -SPICE_MSGC_TUNNEL_SOCKET_FIN, -SPICE_MSGC_TUNNEL_SOCKET_CLOSED, -SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK, -SPICE_MSGC_TUNNEL_SOCKET_DATA, -SPICE_MSGC_TUNNEL_SOCKET_TOKEN, - -SPICE_MSGC_END_TUNNEL -}; - enum { SPICE_MSG_SMARTCARD_DATA = 101, -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH v3 spice-gtk] gstreamer: set timestamp in buffer's GstReferenceTimestampMeta
> > Currently we set timestamps as buffer's PTS, this value may be changed by > the pipeline in some cases and cause an unexpected buffer warnings (when > GstVideoOverlay is not used). Use GstReferenceTimestampMeta when > synchronization is made by spice. > > Before applying this patch you can reproduce the warnings by runing with > DISABLE_GSTVIDEOOVERLAY=1 and starting some audio playback in the guest. > > Signed-off-by: Snir Sheriber Acked-by: Frediano Ziglio It does not conflict with the other proposal, although both are not solving all the cases. But this should not add regressions. Frediano > --- > > Changes from v2: > -Use buffer's PTS value, if GstReferenceTimestampMeta exists, use its > timestamp instead. > > --- > src/channel-display-gst.c | 32 +--- > 1 file changed, 29 insertions(+), 3 deletions(-) > > diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c > index 2f556fe..a281032 100644 > --- a/src/channel-display-gst.c > +++ b/src/channel-display-gst.c > @@ -33,6 +33,10 @@ typedef struct SpiceGstFrame SpiceGstFrame; > > /* GStreamer decoder implementation */ > > +#if GST_CHECK_VERSION(1,14,0) > +static GstStaticCaps stream_reference = > GST_STATIC_CAPS("timestamp/spice-stream"); > +#endif > + > typedef struct SpiceGstDecoder { > VideoDecoder base; > > @@ -86,7 +90,16 @@ struct SpiceGstFrame { > static SpiceGstFrame *create_gst_frame(GstBuffer *buffer, SpiceFrame *frame) > { > SpiceGstFrame *gstframe = g_new(SpiceGstFrame, 1); > + > gstframe->timestamp = GST_BUFFER_PTS(buffer); > +#if GST_CHECK_VERSION(1,14,0) > +GstReferenceTimestampMeta *time_meta; > + > +time_meta = gst_buffer_get_reference_timestamp_meta(buffer, > gst_static_caps_get(&stream_reference)); > +if (time_meta) { > +gstframe->timestamp = time_meta->timestamp; > +} > +#endif > gstframe->frame = frame; > gstframe->sample = NULL; > return gstframe; > @@ -211,6 +224,15 @@ static void fetch_pending_sample(SpiceGstDecoder > *decoder) > decoder->pending_samples--; > > GstBuffer *buffer = gst_sample_get_buffer(sample); > +GstClockTime buffer_ts = GST_BUFFER_PTS(buffer); > +#if GST_CHECK_VERSION(1,14,0) > +GstReferenceTimestampMeta *time_meta; > + > +time_meta = gst_buffer_get_reference_timestamp_meta(buffer, > gst_static_caps_get(&stream_reference)); > +if (time_meta) { > +buffer_ts = time_meta->timestamp; > +} > +#endif > > /* gst_app_sink_pull_sample() sometimes returns the same buffer > twice > * or buffers that have a modified, and thus unrecognizable, PTS. > @@ -223,7 +245,7 @@ static void fetch_pending_sample(SpiceGstDecoder > *decoder) > GList *l = g_queue_peek_head_link(decoder->decoding_queue); > while (l) { > gstframe = l->data; > -if (gstframe->timestamp == GST_BUFFER_PTS(buffer)) { > +if (gstframe->timestamp == buffer_ts) { > /* The frame is now ready for display */ > gstframe->sample = sample; > decoder->display_frame = gstframe; > @@ -232,7 +254,7 @@ static void fetch_pending_sample(SpiceGstDecoder > *decoder) > * frames from the decoding queue. > */ > while ((gstframe = > g_queue_pop_head(decoder->decoding_queue))) { > -if (gstframe->timestamp == GST_BUFFER_PTS(buffer)) { > +if (gstframe->timestamp == buffer_ts) { > break; > } > /* The GStreamer pipeline dropped the corresponding > @@ -626,9 +648,13 @@ static gboolean > spice_gst_decoder_queue_frame(VideoDecoder *video_decoder, > frame->data, > frame->size, 0, > frame->size, > frame->data_opaque, > frame->unref_data); > > +GstClockTime pts = gst_clock_get_time(decoder->clock) - > gst_element_get_base_time(decoder->pipeline) + ((uint64_t)MAX(0, latency)) * > 1000 * 1000; > GST_BUFFER_DURATION(buffer) = GST_CLOCK_TIME_NONE; > GST_BUFFER_DTS(buffer) = GST_CLOCK_TIME_NONE; > -GST_BUFFER_PTS(buffer) = gst_clock_get_time(decoder->clock) - > gst_element_get_base_time(decoder->pipeline) + ((uint64_t)MAX(0, latency)) * > 1000 * 1000; > +GST_BUFFER_PTS(buffer) = pts; > +#if GST_CHECK_VERSION(1,14,0) > +gst_buffer_add_reference_timestamp_meta(buffer, gst_static_caps_get > (&stream_reference), pts, GST_CLOCK_TIME_NONE); > +#endif > > if (decoder->appsink != NULL) { > SpiceGstFrame *gst_frame = create_gst_frame(buffer, frame); ___ Spice-devel m
Re: [Spice-devel] [spice-gtk v1] widget: mouse: Fix getting coordinates
On Tue, Feb 12, 2019 at 04:36:17PM +, Victor Toso wrote: > From: Victor Toso > > Documentation for gdk_display_get_primary_monitor() says that it > returns "the primary monitor, or NULL if no primary monitor is > configured by the user". > > If monitor endup being NULL, we endup using unitialized GdkRectangle > geom later on as gdk_monitor_get_geometry() will fail with: > > | gdk_monitor_get_geometry: assertion 'GDK_IS_MONITOR (monitor)' failed > > This patch tries gdk_display_get_monitor_at_point() and will fail if > no GdkMonitor is set. > > Signed-off-by: Victor Toso > --- > src/spice-widget.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/src/spice-widget.c b/src/spice-widget.c > index 8adcc38..e69b808 100644 > --- a/src/spice-widget.c > +++ b/src/spice-widget.c > @@ -1129,6 +1129,11 @@ static void mouse_wrap(SpiceDisplay *display, > GdkEventMotion *motion) > GdkWindow *gdk_window = gtk_widget_get_window(GTK_WIDGET(display)); > GdkDisplay *gdk_display = gdk_window_get_display(gdk_window); > GdkMonitor *monitor = gdk_display_get_primary_monitor(gdk_display); > +if (monitor == NULL) { > +/* No primary monitor set, using last mouse coordinates */ > +monitor = gdk_display_get_monitor_at_point(gdk_display, > d->mouse_last_x, d->mouse_last_y); > +} > +g_return_if_fail(monitor != NULL); > gdk_monitor_get_geometry(monitor, &geom); > > xr = geom.width / 2; > -- > 2.20.1 > > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/spice-devel signature.asc Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk v1] widget: mouse: Fix getting coordinates
> > On Tue, Feb 12, 2019 at 04:36:17PM +, Victor Toso wrote: > > From: Victor Toso > > > > Documentation for gdk_display_get_primary_monitor() says that it > > returns "the primary monitor, or NULL if no primary monitor is > > configured by the user". > > > > If monitor endup being NULL, we endup using unitialized GdkRectangle typo: endup -> end up typo: unitialized -> uninitialized > > geom later on as gdk_monitor_get_geometry() will fail with: > > > > | gdk_monitor_get_geometry: assertion 'GDK_IS_MONITOR (monitor)' failed > > > > This patch tries gdk_display_get_monitor_at_point() and will fail if > > no GdkMonitor is set. > > > > > Signed-off-by: Victor Toso Were you be able to reproduce it? > > --- > > src/spice-widget.c | 5 + > > 1 file changed, 5 insertions(+) > > > > diff --git a/src/spice-widget.c b/src/spice-widget.c > > index 8adcc38..e69b808 100644 > > --- a/src/spice-widget.c > > +++ b/src/spice-widget.c > > @@ -1129,6 +1129,11 @@ static void mouse_wrap(SpiceDisplay *display, > > GdkEventMotion *motion) > > GdkWindow *gdk_window = gtk_widget_get_window(GTK_WIDGET(display)); > > GdkDisplay *gdk_display = gdk_window_get_display(gdk_window); > > GdkMonitor *monitor = gdk_display_get_primary_monitor(gdk_display); > > +if (monitor == NULL) { > > +/* No primary monitor set, using last mouse coordinates */ > > +monitor = gdk_display_get_monitor_at_point(gdk_display, > > d->mouse_last_x, d->mouse_last_y); > > +} > > +g_return_if_fail(monitor != NULL); > > gdk_monitor_get_geometry(monitor, &geom); > > > > xr = geom.width / 2; Patch seems good. Frediano ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk v1] widget: mouse: Fix getting coordinates
Hi, On Fri, Feb 22, 2019 at 08:47:42AM -0500, Frediano Ziglio wrote: > > > > On Tue, Feb 12, 2019 at 04:36:17PM +, Victor Toso wrote: > > > From: Victor Toso > > > > > > Documentation for gdk_display_get_primary_monitor() says that it > > > returns "the primary monitor, or NULL if no primary monitor is > > > configured by the user". > > > > > > If monitor endup being NULL, we endup using unitialized GdkRectangle > > typo: endup -> end up > typo: unitialized -> uninitialized Ack > > > > geom later on as gdk_monitor_get_geometry() will fail with: > > > > > > | gdk_monitor_get_geometry: assertion 'GDK_IS_MONITOR (monitor)' failed > > > > > > This patch tries gdk_display_get_monitor_at_point() and will fail if > > > no GdkMonitor is set. > > > > > > > > Signed-off-by: Victor Toso > > Were you be able to reproduce it? Yes, patch fixes it > > > --- > > > src/spice-widget.c | 5 + > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/src/spice-widget.c b/src/spice-widget.c > > > index 8adcc38..e69b808 100644 > > > --- a/src/spice-widget.c > > > +++ b/src/spice-widget.c > > > @@ -1129,6 +1129,11 @@ static void mouse_wrap(SpiceDisplay *display, > > > GdkEventMotion *motion) > > > GdkWindow *gdk_window = gtk_widget_get_window(GTK_WIDGET(display)); > > > GdkDisplay *gdk_display = gdk_window_get_display(gdk_window); > > > GdkMonitor *monitor = gdk_display_get_primary_monitor(gdk_display); > > > +if (monitor == NULL) { > > > +/* No primary monitor set, using last mouse coordinates */ > > > +monitor = gdk_display_get_monitor_at_point(gdk_display, > > > d->mouse_last_x, d->mouse_last_y); > > > +} > > > +g_return_if_fail(monitor != NULL); > > > gdk_monitor_get_geometry(monitor, &geom); > > > > > > xr = geom.width / 2; > > Patch seems good. > > Frediano Thanks signature.asc Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk v1] widget: mouse: Fix getting coordinates
> Hi, > > On Fri, Feb 22, 2019 at 08:47:42AM -0500, Frediano Ziglio wrote: > > > > > > On Tue, Feb 12, 2019 at 04:36:17PM +, Victor Toso wrote: > > > > From: Victor Toso > > > > > > > > Documentation for gdk_display_get_primary_monitor() says that it > > > > returns "the primary monitor, or NULL if no primary monitor is > > > > configured by the user". > > > > > > > > If monitor endup being NULL, we endup using unitialized GdkRectangle > > > > typo: endup -> end up > > typo: unitialized -> uninitialized > > Ack > > > > > > > geom later on as gdk_monitor_get_geometry() will fail with: > > > > > > > > | gdk_monitor_get_geometry: assertion 'GDK_IS_MONITOR (monitor)' > > > > | failed > > > > > > > > This patch tries gdk_display_get_monitor_at_point() and will fail if > > > > no GdkMonitor is set. > > > > > > > > > > > Signed-off-by: Victor Toso > > > > Were you be able to reproduce it? > > Yes, patch fixes it > How? xrandr? > > > > --- > > > > src/spice-widget.c | 5 + > > > > 1 file changed, 5 insertions(+) > > > > > > > > diff --git a/src/spice-widget.c b/src/spice-widget.c > > > > index 8adcc38..e69b808 100644 > > > > --- a/src/spice-widget.c > > > > +++ b/src/spice-widget.c > > > > @@ -1129,6 +1129,11 @@ static void mouse_wrap(SpiceDisplay *display, > > > > GdkEventMotion *motion) > > > > GdkWindow *gdk_window = > > > > gtk_widget_get_window(GTK_WIDGET(display)); > > > > GdkDisplay *gdk_display = gdk_window_get_display(gdk_window); > > > > GdkMonitor *monitor = > > > > gdk_display_get_primary_monitor(gdk_display); > > > > +if (monitor == NULL) { > > > > +/* No primary monitor set, using last mouse coordinates */ > > > > +monitor = gdk_display_get_monitor_at_point(gdk_display, > > > > d->mouse_last_x, d->mouse_last_y); > > > > +} > > > > +g_return_if_fail(monitor != NULL); > > > > gdk_monitor_get_geometry(monitor, &geom); > > > > > > > > xr = geom.width / 2; > > > > Patch seems good. > > > > Frediano > > Thanks > ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] Video stream low performance on raspberry pi while using h264
Hi, I am testing video stream on raspberry pi. My spice-gtk version is 0.34 and spice server is 0.14, video encode type is h264. On raspberry pi I use omxh264dec as hardware accelerated decoder. When I play video on VM, the video looks fine if the video is set to default size, but if the video is set to fullscreen, the video looks awful, the frame rate is less than 10. I try to change gstreamer sink from 'appsink' to 'glimagesink', the video looks ok but a new window is popped up to play video, which is bad. CPU usage of spicy and xorg are not high(about 50%). I suspect that appsink would copy data from GPU to CPU, so when the data size is big, this operation will affect performance greatly. Is there anyone who can give me any suggestion? Best Regards, Don___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk v1] widget: mouse: Fix getting coordinates
Hi, On Fri, Feb 22, 2019 at 09:06:52AM -0500, Frediano Ziglio wrote: > > Hi, > > > > On Fri, Feb 22, 2019 at 08:47:42AM -0500, Frediano Ziglio wrote: > > > > > > > > On Tue, Feb 12, 2019 at 04:36:17PM +, Victor Toso wrote: > > > > > From: Victor Toso > > > > > > > > > > Documentation for gdk_display_get_primary_monitor() says that it > > > > > returns "the primary monitor, or NULL if no primary monitor is > > > > > configured by the user". > > > > > > > > > > If monitor endup being NULL, we endup using unitialized GdkRectangle > > > > > > typo: endup -> end up > > > typo: unitialized -> uninitialized > > > > Ack > > > > > > > > > > geom later on as gdk_monitor_get_geometry() will fail with: > > > > > > > > > > | gdk_monitor_get_geometry: assertion 'GDK_IS_MONITOR (monitor)' > > > > > | failed > > > > > > > > > > This patch tries gdk_display_get_monitor_at_point() and will fail if > > > > > no GdkMonitor is set. > > > > > > > > > > > > > > Signed-off-by: Victor Toso > > > > > > Were you be able to reproduce it? > > > > Yes, patch fixes it > > > > How? xrandr? No need to change anything in the guest. Just uses spicy under wayland and switch to server mode at menu > options > toggle mouse mode, the warnings will follow. Ack with the typo fixes then? Cheers, > > > > > --- > > > > > src/spice-widget.c | 5 + > > > > > 1 file changed, 5 insertions(+) > > > > > > > > > > diff --git a/src/spice-widget.c b/src/spice-widget.c > > > > > index 8adcc38..e69b808 100644 > > > > > --- a/src/spice-widget.c > > > > > +++ b/src/spice-widget.c > > > > > @@ -1129,6 +1129,11 @@ static void mouse_wrap(SpiceDisplay *display, > > > > > GdkEventMotion *motion) > > > > > GdkWindow *gdk_window = > > > > > gtk_widget_get_window(GTK_WIDGET(display)); > > > > > GdkDisplay *gdk_display = gdk_window_get_display(gdk_window); > > > > > GdkMonitor *monitor = > > > > > gdk_display_get_primary_monitor(gdk_display); > > > > > +if (monitor == NULL) { > > > > > +/* No primary monitor set, using last mouse coordinates */ > > > > > +monitor = gdk_display_get_monitor_at_point(gdk_display, > > > > > d->mouse_last_x, d->mouse_last_y); > > > > > +} > > > > > +g_return_if_fail(monitor != NULL); > > > > > gdk_monitor_get_geometry(monitor, &geom); > > > > > > > > > > xr = geom.width / 2; > > > > > > Patch seems good. > > > > > > Frediano > > > > Thanks > > signature.asc Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk v1] widget: mouse: Fix getting coordinates
> > Hi, > > On Fri, Feb 22, 2019 at 09:06:52AM -0500, Frediano Ziglio wrote: > > > Hi, > > > > > > On Fri, Feb 22, 2019 at 08:47:42AM -0500, Frediano Ziglio wrote: > > > > > > > > > > On Tue, Feb 12, 2019 at 04:36:17PM +, Victor Toso wrote: > > > > > > From: Victor Toso > > > > > > > > > > > > Documentation for gdk_display_get_primary_monitor() says that it > > > > > > returns "the primary monitor, or NULL if no primary monitor is > > > > > > configured by the user". > > > > > > > > > > > > If monitor endup being NULL, we endup using unitialized > > > > > > GdkRectangle > > > > > > > > typo: endup -> end up > > > > typo: unitialized -> uninitialized > > > > > > Ack > > > > > > > > > > > > > geom later on as gdk_monitor_get_geometry() will fail with: > > > > > > > > > > > > | gdk_monitor_get_geometry: assertion 'GDK_IS_MONITOR (monitor)' > > > > > > | failed > > > > > > > > > > > > This patch tries gdk_display_get_monitor_at_point() and will fail > > > > > > if > > > > > > no GdkMonitor is set. > > > > > > > > > > > > > > > > > Signed-off-by: Victor Toso > > > > > > > > Were you be able to reproduce it? > > > > > > Yes, patch fixes it > > > > > > > How? xrandr? > > No need to change anything in the guest. Just uses spicy under > wayland and switch to server mode at menu > options > toggle > mouse mode, the warnings will follow. > > Ack with the typo fixes then? > > Cheers, > Yes, Acked-by: Frediano Ziglio Frediano > > > > > > --- > > > > > > src/spice-widget.c | 5 + > > > > > > 1 file changed, 5 insertions(+) > > > > > > > > > > > > diff --git a/src/spice-widget.c b/src/spice-widget.c > > > > > > index 8adcc38..e69b808 100644 > > > > > > --- a/src/spice-widget.c > > > > > > +++ b/src/spice-widget.c > > > > > > @@ -1129,6 +1129,11 @@ static void mouse_wrap(SpiceDisplay > > > > > > *display, > > > > > > GdkEventMotion *motion) > > > > > > GdkWindow *gdk_window = > > > > > > gtk_widget_get_window(GTK_WIDGET(display)); > > > > > > GdkDisplay *gdk_display = gdk_window_get_display(gdk_window); > > > > > > GdkMonitor *monitor = > > > > > > gdk_display_get_primary_monitor(gdk_display); > > > > > > +if (monitor == NULL) { > > > > > > +/* No primary monitor set, using last mouse coordinates */ > > > > > > +monitor = gdk_display_get_monitor_at_point(gdk_display, > > > > > > d->mouse_last_x, d->mouse_last_y); > > > > > > +} > > > > > > +g_return_if_fail(monitor != NULL); > > > > > > gdk_monitor_get_geometry(monitor, &geom); > > > > > > > > > > > > xr = geom.width / 2; > > > > > > > > Patch seems good. > > > > > > > > Frediano > > > > > > Thanks > > > > ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [linux/vd-agent 0/3] rm TODO and README -> README.md
From: Victor Toso Hi, Just some minor changes. We probably want to update README.md for the upcoming release. Victor Toso (3): Remove TODO Make README a markdown file README: Use block quotes for code or paths README => README.md | 17 +++-- TODO| 3 --- 2 files changed, 11 insertions(+), 9 deletions(-) rename README => README.md (89%) delete mode 100644 TODO -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [linux/vd-agent 3/3] README: Use block quotes for code or paths
From: Victor Toso Makes it easier to copy-and-paste. Signed-off-by: Victor Toso --- README.md | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 67a66a5..089c0e5 100644 --- a/README.md +++ b/README.md @@ -44,15 +44,20 @@ All vdagent communications on the guest side run over a single pipe which gets presented to the guest os as a virtio serial port. Under windows this virtio serial port has the following name: -.\\Global\\com.redhat.spice.0 +>>> +.\\Global\\com.redhat.spice.0 +>>> Under Linux this virtio serial port has the following name: -/dev/virtio-ports/com.redhat.spice.0 +>>> +/dev/virtio-ports/com.redhat.spice.0 +>>> To enable the virtio serial port you need to pass the following params on the qemu cmdline: --device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x5 \ --chardev spicevmc,name=vdagent,id=vdagent \ --device \ -virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0 +>>> +-device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x5 \ +-chardev spicevmc,name=vdagent,id=vdagent \ +-device virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0 +>>> -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [linux/vd-agent 1/3] Remove TODO
From: Victor Toso Not something we really use nor we keep it up to date. One should check/update issues at https://gitlab.freedesktop.org/spice/linux/vd_agent/issues Signed-off-by: Victor Toso --- TODO | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 TODO diff --git a/TODO b/TODO deleted file mode 100644 index 3fba254..000 --- a/TODO +++ /dev/null @@ -1,3 +0,0 @@ -Maybe: --Add support for selections with a target of STRING, which are - ISO Latin-1 strings, which we could support through iconv -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [linux/vd-agent 2/3] Make README a markdown file
From: Victor Toso This commit only renames it to have .md suffix as that is recognized by Gitlab. Signed-off-by: Victor Toso --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [linux/vd-agent 0/3] rm TODO and README -> README.md
Hi, while we're at it, what about merging ChangeLog and NEWS into one file and using markdown here as well? Gitlab seems to favour ChangeLog over NEWS, so if you click the "CHANGELOG" button at [0], the ChangeLog file is shown which does not contain the latest updates. [0] https://gitlab.freedesktop.org/spice/linux/vd_agent Cheers, Jakub On Fri, Feb 22, 2019 at 4:19 PM Victor Toso wrote: > > From: Victor Toso > > Hi, > > Just some minor changes. We probably want to update README.md for the > upcoming release. > > Victor Toso (3): > Remove TODO > Make README a markdown file > README: Use block quotes for code or paths > > README => README.md | 17 +++-- > TODO| 3 --- > 2 files changed, 11 insertions(+), 9 deletions(-) > rename README => README.md (89%) > delete mode 100644 TODO > > -- > 2.20.1 > > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/spice-devel ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [linux/vd-agent 0/3] rm TODO and README -> README.md
Hi, On Fri, Feb 22, 2019 at 04:50:30PM +0100, Jakub Janku wrote: > Hi, > > while we're at it, what about merging ChangeLog and NEWS into one file > and using markdown here as well? > > Gitlab seems to favour ChangeLog over NEWS, so if you click the > "CHANGELOG" button at [0], the ChangeLog file is shown which does not > contain the latest updates. > [0] https://gitlab.freedesktop.org/spice/linux/vd_agent Makes sense to me to change it as well :) > > Cheers, > Jakub > > On Fri, Feb 22, 2019 at 4:19 PM Victor Toso wrote: > > > > From: Victor Toso > > > > Hi, > > > > Just some minor changes. We probably want to update README.md for the > > upcoming release. > > > > Victor Toso (3): > > Remove TODO > > Make README a markdown file > > README: Use block quotes for code or paths > > > > README => README.md | 17 +++-- > > TODO| 3 --- > > 2 files changed, 11 insertions(+), 9 deletions(-) > > rename README => README.md (89%) > > delete mode 100644 TODO > > > > -- > > 2.20.1 > > > > ___ > > Spice-devel mailing list > > Spice-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/spice-devel signature.asc Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [PATCH spice-server] red-pipe-item: Removed some not necessary headers inclusions
RedPipeItem is not using the Ring structures anymore. Also is not using GLib functionality. Just include base headers. Signed-off-by: Frediano Ziglio --- server/red-pipe-item.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/red-pipe-item.h b/server/red-pipe-item.h index 8e9115725..2cfb5ddbd 100644 --- a/server/red-pipe-item.h +++ b/server/red-pipe-item.h @@ -19,8 +19,8 @@ #ifndef RED_PIPE_ITEM_H_ #define RED_PIPE_ITEM_H_ -#include -#include +#include +#include typedef struct RedPipeItem RedPipeItem; -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [linux/vd-agent 5/5] CHANGELOG: Move NEWS' content
From: Victor Toso And add some Markdown style. Signed-off-by: Victor Toso --- CHANGELOG.md | 47 +++ NEWS | 46 -- 2 files changed, 47 insertions(+), 46 deletions(-) delete mode 100644 NEWS diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ce7a62..6245f53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,50 @@ +News in spice-vdagent 0.18.0 + + +* Add GTK+ framework to handle x11 backend such as clipboard +* Deprecate X11 backend in favor of GTK+ framework +* Ask pkg-config to appropriate directory to install udev rules +* Fix leak of udscs's file descriptor +* Better quote directory path when calling xdg-open to save file transfer +* Bump GLib to 2.34 +* Add systemd socket activation (rhbz#1340160) +* Add support to detailed errors on file transfers +* Add check for available free space in guest before starting a file transfer +* Use better names for duplicated files on file transfer +* Improve support on big endian guests (#5) +* Use IdleHint to check if a session is locked over console-kit (rhbz#1412673) +* Fixes double free on errors over udscs by improving memory ownership +* Hide autostart file on Unity +* Improve command line messages for vdagentd +* Fix typo in --enable-static-uinput configure option +* Code repository moved to gitlab.freedesktop.org + +News in spice-vdagent 0.17.0 + + +* Denies file-transfer in locked sessions + * systems under systemd (rhbz#1323623) + * systems under console-kit (rhbz#1323630) +* Denies file-transfer in login screen + * systems under systemd (rhbz#1328761) + * systems under console-kit (rhbz#1323640) +* Bump glib version to 2.28 +* Set exit code to 1 instead of 0 when virtio device cannot be opened +* Fix double-free on uinput->screen_info (rhbz#1262635) +* Code improvement over unix domain client server support (udcs) +* Fix build compatiblity with different libsystemd versions (fdo#94209) + +News in spice-vdagent 0.16.0 + + +* Add audio volume synchronization support +* Add support for maximum clipboard size +* Add support for more clipboard targets (STRING and TIMESTAMP) +* Improve handling of transfers of multiple files +* Fix transfer of >2GB files on 32 bit systems +* XSpice improvements +* Various bug fixes related to resolution changes + News in spice-vdagent 0.15.0 diff --git a/NEWS b/NEWS deleted file mode 100644 index 86ee8e9..000 --- a/NEWS +++ /dev/null @@ -1,46 +0,0 @@ -Overview of changes in SPICE vdagent 0.18.0 -=== - -- Add GTK+ framework to handle x11 backend such as clipboard -- Deprecate X11 backend in favor of GTK+ framework -- Ask pkg-config to appropriate directory to install udev rules -- Fix leak of udscs's file descriptor -- Better quote directory path when calling xdg-open to save file transfer -- Bump GLib to 2.34 -- Add systemd socket activation (rhbz#1340160) -- Add support to detailed errors on file transfers -- Add check for available free space in guest before starting a file transfer -- Use better names for duplicated files on file transfer -- Improve support on big endian guests (#5) -- Use IdleHint to check if a session is locked over console-kit (rhbz#1412673) -- Fixes double free on errors over udscs by improving memory ownership -- Hide autostart file on Unity -- Improve command line messages for vdagentd -- Fix typo in --enable-static-uinput configure option -- Code repository moved to gitlab.freedesktop.org - -Overview of changes in SPICE vdagent 0.17.0 -=== - -- Denies file-transfer in locked sessions - * systems under systemd (rhbz#1323623) - * systems under console-kit (rhbz#1323630) -- Denies file-transfer in login screen - * systems under systemd (rhbz#1328761) - * systems under console-kit (rhbz#1323640) -- Bump glib version to 2.28 -- Set exit code to 1 instead of 0 when virtio device cannot be opened -- Fix double-free on uinput->screen_info (rhbz#1262635) -- Code improvement over unix domain client server support (udcs) -- Fix build compatiblity with different libsystemd versions (fdo#94209) - -Overview of changes in SPICE vdagent 0.16.0 -=== - -- Add audio volume synchronization support -- Add support for maximum clipboard size -- Add support for more clipboard targets (STRING and TIMESTAMP) -- Improve handling of transfers of multiple files -- Fix transfer of >2GB files on 32 bit systems -- XSpice improvements -- Various bug fixes related to resolution changes -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [linux/vd-agent 4/5] CHANGELOG: To use markdown
From: Victor Toso We will prefer CHANGELOG over NEWS just as matter of Gitlab's. Followup patch will move NEWS content to CHANGELOG. This patch renames ChangeLog -> CHANGELOG.md and changes some style to follow Markdown. Also adds 'News in' string to the title of each section. Signed-off-by: Victor Toso --- ChangeLog => CHANGELOG.md | 51 +++ 1 file changed, 30 insertions(+), 21 deletions(-) rename ChangeLog => CHANGELOG.md (78%) diff --git a/ChangeLog b/CHANGELOG.md similarity index 78% rename from ChangeLog rename to CHANGELOG.md index da24341..0ce7a62 100644 --- a/ChangeLog +++ b/CHANGELOG.md @@ -1,59 +1,67 @@ -spice-vdagent-0.15.0 - +News in spice-vdagent 0.15.0 + + * Xspice support * Release clipboard on client disconnect if owned by client (rhbz#1003977) * Turn some error messages into debugging messages (rhbz#918310) * Not having the virtio channel is not an error; instead silently do nothing -spice-vdagent-0.14.0 - +News in spice-vdagent 0.14.0 + + * More multi-monitor and arbritary resolution support bugfixes * Add support for file transfers from client to guest * Add support for setups with multiple Screens (multiple qxl devices each mapped to their own screen), limitations: - -Max one monitor per Screen / qxl device - -All monitors / Screens must have the same resolution - -No client -> guest resolution syncing + * Max one monitor per Screen / qxl device + * All monitors / Screens must have the same resolution + * No client -> guest resolution syncing * Add spice-vdagent -X cmdline option, which runtime disables console-kit / systemd-logind integration for setups where these are not used * Add manpages for spice-vdagent and spice-vdagentd -spice-vdagent-0.12.1 - +News in spice-vdagent 0.12.1 + + * Various bugfixes for multi-monitor and arbritary resolution support * Requires libXrandr >= 1.3, Note 0.12.0 also required this, but did not check for it. For older distributions use 0.10.1 -spice-vdagent-0.12.0 - +News in spice-vdagent 0.12.0 + + * Full multi-monitor and arbritary resolution support, this requires a new enough xorg-x11-drv-qxl driver, as well as a new enough host * systemd service support, using systemd hardware acivation * Use syslog for logging, rather then logging to private log files -spice-vdagent-0.10.1 - +News in spice-vdagent 0.10.1 + + * Fix a race condition when opening the vdagent virtio serial port, which caused it to get opened / closed in rapid succession a number of times on vm boot -spice-vdagent-0.10.0 - +News in spice-vdagent 0.10.0 + + * Add limited support for multiple displays, see README * Add support for RHEL-5 (and other distributions with a non hotplug capable Xorg and/or no console-kit), see README.RHEL-5 * Add support for using libsystemd-logind as session information source instead of console-kit -spice-vdagent-0.8.1 +News in spice-vdagent 0.8.1 +=== + * In daemon mode the session vdagent now retries connecting to the system vdagentd every second, once a connection is made a version check is done, if the version differs (which only happens on an upgrade from one version to the next) the sesion vdagent re-execs itself (Marc-André Lureau) -spice-vdagent-0.8.0 +News in spice-vdagent 0.8.0 +=== + * Add support for copy and paste using the primary selection, to use this you need a spice-gtk widget based client and the latest spice-gtk code (Marc-André Lureau and Hans de Goede) @@ -62,8 +70,9 @@ spice-vdagent-0.8.0 as RHEL-5 (Christophe Fergeau) * Various small bugfixes (Hans de Goede) -spice-vdagent-0.6.3 +News in spice-vdagent 0.6.3 +=== + * Initial release, starting with version nr 0.6.3, to indicate that it more or less supports all parts of the cdagent protocol in spice-protocol and spice 0.6.3 -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [spice-gtk 1/2] build-sys: require usbredir 0.7.1 or above
From: Victor Toso usbredir-0.7.1 was released on 29-Oct-2015, relatively wold coompared to most recent usbredir-0.8.0 from 03-Aug-2018. * Debian 9 (stretch) -> 0.7.1 * Fedora 21 to Fedora 27 -> 0.7.1 * Fedora 28 to rawhide -> 0.8.0 Signed-off-by: Victor Toso --- configure.ac | 2 +- meson.build| 6 -- src/channel-usbredir.c | 6 -- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 2e6f7e7..d234822 100644 --- a/configure.ac +++ b/configure.ac @@ -282,7 +282,7 @@ if test "x$enable_usbredir" = "xno"; then have_usbredir="no" else PKG_CHECK_MODULES([USBREDIR], -[libusb-1.0 >= 1.0.16 libusbredirhost libusbredirparser-0.5], +[libusb-1.0 >= 1.0.16 libusbredirhost >= 0.7.1 libusbredirparser-0.5 >= 0.7.1], [have_usbredir=yes], [have_usbredir=no]) if test "x$have_usbredir" = "xno" && test "x$enable_usbredir" = "xyes"; then diff --git a/meson.build b/meson.build index 1863c52..1dedbe1 100644 --- a/meson.build +++ b/meson.build @@ -188,8 +188,10 @@ endif # usbredir spice_gtk_has_usbredir = false -d1 = dependency('libusbredirparser-0.5', required : get_option('usbredir')) -d2 = dependency('libusbredirhost', version : '>= 0.4.2', required : get_option('usbredir')) +usbredir_version = '0.7.1' +usbredir_version_info = '>= @0@'.format(usbredir_version) +d1 = dependency('libusbredirparser-0.5', version: usbredir_version_info, required : get_option('usbredir')) +d2 = dependency('libusbredirhost', version: usbredir_version_info, required : get_option('usbredir')) d3 = dependency('libusb-1.0', version : '>= 1.0.16', required : get_option('usbredir')) if d1.found() and d2.found() and d3.found() spice_glib_deps += [d1, d2, d3] diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c index 182edc4..3562164 100644 --- a/src/channel-usbredir.c +++ b/src/channel-usbredir.c @@ -94,9 +94,7 @@ static void usbredir_log(void *user_data, int level, const char *msg); static int usbredir_read_callback(void *user_data, uint8_t *data, int count); static int usbredir_write_callback(void *user_data, uint8_t *data, int count); static void usbredir_write_flush_callback(void *user_data); -#if USBREDIR_VERSION >= 0x000701 static uint64_t usbredir_buffered_output_size_callback(void *user_data); -#endif static void *usbredir_alloc_lock(void); static void usbredir_lock_lock(void *user_data); @@ -286,9 +284,7 @@ void spice_usbredir_channel_set_context(SpiceUsbredirChannel *channel, if (!priv->host) g_error("Out of memory allocating usbredirhost"); -#if USBREDIR_VERSION >= 0x000701 usbredirhost_set_buffered_output_size_cb(priv->host, usbredir_buffered_output_size_callback); -#endif #ifdef USE_LZ4 spice_channel_set_capability(channel, SPICE_SPICEVMC_CAP_DATA_COMPRESS_LZ4); #endif @@ -589,13 +585,11 @@ void spice_usbredir_channel_get_guest_filter( /* -- */ /* callbacks (any context)*/ -#if USBREDIR_VERSION >= 0x000701 static uint64_t usbredir_buffered_output_size_callback(void *user_data) { g_return_val_if_fail(SPICE_IS_USBREDIR_CHANNEL(user_data), 0); return spice_channel_get_queue_size(SPICE_CHANNEL(user_data)); } -#endif /* Note that this function must be re-entrant safe, as it can get called from both the main thread as well as from the usb event handling thread */ -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [spice-gtk 2/2] win-usb-dev: remove ifdef for libusb on 1.0.13
From: Victor Toso We already require libusb 1.0.16 or above since 8269a5be62f4ce1 (build-sys: drop support for libusb < 1.0.16) Signed-off-by: Victor Toso --- src/win-usb-dev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c index 327976d..934a55b 100644 --- a/src/win-usb-dev.c +++ b/src/win-usb-dev.c @@ -570,9 +570,7 @@ static gboolean g_udev_skip_search(GUdevDevice *udev) g_return_val_if_fail(udevinfo != NULL, FALSE); skip = ((udevinfo->addr == 0xff) || /* root hub (HCD) */ -#if defined(LIBUSBX_API_VERSION) && (LIBUSBX_API_VERSION >= 0x01FF) (udevinfo->addr == 1) || /* root hub addr for libusbx >= 1.0.13 */ -#endif (udevinfo->class == LIBUSB_CLASS_HUB) || /* hub*/ (udevinfo->addr == 0)); /* bad address */ return skip; -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk 1/2] build-sys: require usbredir 0.7.1 or above
On Fri, Feb 22, 2019 at 05:31:32PM +, Victor Toso wrote: > From: Victor Toso > > usbredir-0.7.1 was released on 29-Oct-2015, relatively wold coompared > to most recent usbredir-0.8.0 from 03-Aug-2018. wold -> old coompared -> compared > * Debian 9 (stretch) -> 0.7.1 > * Fedora 21 to Fedora 27 -> 0.7.1 > * Fedora 28 to rawhide -> 0.8.0 > > Signed-off-by: Victor Toso > --- > configure.ac | 2 +- > meson.build| 6 -- > src/channel-usbredir.c | 6 -- > 3 files changed, 5 insertions(+), 9 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 2e6f7e7..d234822 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -282,7 +282,7 @@ if test "x$enable_usbredir" = "xno"; then >have_usbredir="no" > else >PKG_CHECK_MODULES([USBREDIR], > -[libusb-1.0 >= 1.0.16 libusbredirhost > libusbredirparser-0.5], > +[libusb-1.0 >= 1.0.16 libusbredirhost >= 0.7.1 > libusbredirparser-0.5 >= 0.7.1], > [have_usbredir=yes], > [have_usbredir=no]) >if test "x$have_usbredir" = "xno" && test "x$enable_usbredir" = "xyes"; > then > diff --git a/meson.build b/meson.build > index 1863c52..1dedbe1 100644 > --- a/meson.build > +++ b/meson.build > @@ -188,8 +188,10 @@ endif > > # usbredir > spice_gtk_has_usbredir = false > -d1 = dependency('libusbredirparser-0.5', required : get_option('usbredir')) > -d2 = dependency('libusbredirhost', version : '>= 0.4.2', required : > get_option('usbredir')) > +usbredir_version = '0.7.1' > +usbredir_version_info = '>= @0@'.format(usbredir_version) > +d1 = dependency('libusbredirparser-0.5', version: usbredir_version_info, > required : get_option('usbredir')) > +d2 = dependency('libusbredirhost', version: usbredir_version_info, required > : get_option('usbredir')) > d3 = dependency('libusb-1.0', version : '>= 1.0.16', required : > get_option('usbredir')) > if d1.found() and d2.found() and d3.found() >spice_glib_deps += [d1, d2, d3] > diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c > index 182edc4..3562164 100644 > --- a/src/channel-usbredir.c > +++ b/src/channel-usbredir.c > @@ -94,9 +94,7 @@ static void usbredir_log(void *user_data, int level, const > char *msg); > static int usbredir_read_callback(void *user_data, uint8_t *data, int count); > static int usbredir_write_callback(void *user_data, uint8_t *data, int > count); > static void usbredir_write_flush_callback(void *user_data); > -#if USBREDIR_VERSION >= 0x000701 > static uint64_t usbredir_buffered_output_size_callback(void *user_data); > -#endif > > static void *usbredir_alloc_lock(void); > static void usbredir_lock_lock(void *user_data); > @@ -286,9 +284,7 @@ void > spice_usbredir_channel_set_context(SpiceUsbredirChannel *channel, > if (!priv->host) > g_error("Out of memory allocating usbredirhost"); > > -#if USBREDIR_VERSION >= 0x000701 > usbredirhost_set_buffered_output_size_cb(priv->host, > usbredir_buffered_output_size_callback); > -#endif > #ifdef USE_LZ4 > spice_channel_set_capability(channel, > SPICE_SPICEVMC_CAP_DATA_COMPRESS_LZ4); > #endif > @@ -589,13 +585,11 @@ void spice_usbredir_channel_get_guest_filter( > /* -- */ > /* callbacks (any context)*/ > > -#if USBREDIR_VERSION >= 0x000701 > static uint64_t usbredir_buffered_output_size_callback(void *user_data) > { > g_return_val_if_fail(SPICE_IS_USBREDIR_CHANNEL(user_data), 0); > return spice_channel_get_queue_size(SPICE_CHANNEL(user_data)); > } > -#endif > > /* Note that this function must be re-entrant safe, as it can get called > from both the main thread as well as from the usb event handling thread */ > -- > 2.20.1 > > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/spice-devel signature.asc Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [spice-gtk 2/2] win-usb-dev: remove ifdef for libusb on 1.0.13
On Fri, Feb 22, 2019 at 05:31:33PM +, Victor Toso wrote: > From: Victor Toso > > We already require libusb 1.0.16 or above since 8269a5be62f4ce1 > (build-sys: drop support for libusb < 1.0.16) > > Signed-off-by: Victor Toso > --- > src/win-usb-dev.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c > index 327976d..934a55b 100644 > --- a/src/win-usb-dev.c > +++ b/src/win-usb-dev.c > @@ -570,9 +570,7 @@ static gboolean g_udev_skip_search(GUdevDevice *udev) > g_return_val_if_fail(udevinfo != NULL, FALSE); > > skip = ((udevinfo->addr == 0xff) || /* root hub (HCD) */ > -#if defined(LIBUSBX_API_VERSION) && (LIBUSBX_API_VERSION >= 0x01FF) > (udevinfo->addr == 1) || /* root hub addr for libusbx >= 1.0.13 > */ > -#endif Should be fine to remove the comment as well, oh well, better to send v2, sorry about noise > (udevinfo->class == LIBUSB_CLASS_HUB) || /* hub*/ > (udevinfo->addr == 0)); /* bad address */ > return skip; > -- > 2.20.1 > > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/spice-devel signature.asc Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [spice-gtk v2 1/2] build-sys: require usbredir 0.7.1 or above
From: Victor Toso usbredir-0.7.1 was released on 29-Oct-2015, relatively old compared to most recent usbredir-0.8.0 from 03-Aug-2018. * Debian 9 (stretch) -> 0.7.1 * Fedora 21 to Fedora 27 -> 0.7.1 * Fedora 28 to rawhide -> 0.8.0 Signed-off-by: Victor Toso --- configure.ac | 2 +- meson.build| 6 -- src/channel-usbredir.c | 6 -- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 2e6f7e7..d234822 100644 --- a/configure.ac +++ b/configure.ac @@ -282,7 +282,7 @@ if test "x$enable_usbredir" = "xno"; then have_usbredir="no" else PKG_CHECK_MODULES([USBREDIR], -[libusb-1.0 >= 1.0.16 libusbredirhost libusbredirparser-0.5], +[libusb-1.0 >= 1.0.16 libusbredirhost >= 0.7.1 libusbredirparser-0.5 >= 0.7.1], [have_usbredir=yes], [have_usbredir=no]) if test "x$have_usbredir" = "xno" && test "x$enable_usbredir" = "xyes"; then diff --git a/meson.build b/meson.build index 1863c52..1dedbe1 100644 --- a/meson.build +++ b/meson.build @@ -188,8 +188,10 @@ endif # usbredir spice_gtk_has_usbredir = false -d1 = dependency('libusbredirparser-0.5', required : get_option('usbredir')) -d2 = dependency('libusbredirhost', version : '>= 0.4.2', required : get_option('usbredir')) +usbredir_version = '0.7.1' +usbredir_version_info = '>= @0@'.format(usbredir_version) +d1 = dependency('libusbredirparser-0.5', version: usbredir_version_info, required : get_option('usbredir')) +d2 = dependency('libusbredirhost', version: usbredir_version_info, required : get_option('usbredir')) d3 = dependency('libusb-1.0', version : '>= 1.0.16', required : get_option('usbredir')) if d1.found() and d2.found() and d3.found() spice_glib_deps += [d1, d2, d3] diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c index 182edc4..3562164 100644 --- a/src/channel-usbredir.c +++ b/src/channel-usbredir.c @@ -94,9 +94,7 @@ static void usbredir_log(void *user_data, int level, const char *msg); static int usbredir_read_callback(void *user_data, uint8_t *data, int count); static int usbredir_write_callback(void *user_data, uint8_t *data, int count); static void usbredir_write_flush_callback(void *user_data); -#if USBREDIR_VERSION >= 0x000701 static uint64_t usbredir_buffered_output_size_callback(void *user_data); -#endif static void *usbredir_alloc_lock(void); static void usbredir_lock_lock(void *user_data); @@ -286,9 +284,7 @@ void spice_usbredir_channel_set_context(SpiceUsbredirChannel *channel, if (!priv->host) g_error("Out of memory allocating usbredirhost"); -#if USBREDIR_VERSION >= 0x000701 usbredirhost_set_buffered_output_size_cb(priv->host, usbredir_buffered_output_size_callback); -#endif #ifdef USE_LZ4 spice_channel_set_capability(channel, SPICE_SPICEVMC_CAP_DATA_COMPRESS_LZ4); #endif @@ -589,13 +585,11 @@ void spice_usbredir_channel_get_guest_filter( /* -- */ /* callbacks (any context)*/ -#if USBREDIR_VERSION >= 0x000701 static uint64_t usbredir_buffered_output_size_callback(void *user_data) { g_return_val_if_fail(SPICE_IS_USBREDIR_CHANNEL(user_data), 0); return spice_channel_get_queue_size(SPICE_CHANNEL(user_data)); } -#endif /* Note that this function must be re-entrant safe, as it can get called from both the main thread as well as from the usb event handling thread */ -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [spice-gtk v2 2/2] win-usb-dev: remove ifdef for libusb on 1.0.13
From: Victor Toso We already require libusb 1.0.16 or above since 8269a5be62f4ce1 (build-sys: drop support for libusb < 1.0.16) Signed-off-by: Victor Toso --- src/win-usb-dev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c index 327976d..b614af0 100644 --- a/src/win-usb-dev.c +++ b/src/win-usb-dev.c @@ -570,9 +570,7 @@ static gboolean g_udev_skip_search(GUdevDevice *udev) g_return_val_if_fail(udevinfo != NULL, FALSE); skip = ((udevinfo->addr == 0xff) || /* root hub (HCD) */ -#if defined(LIBUSBX_API_VERSION) && (LIBUSBX_API_VERSION >= 0x01FF) -(udevinfo->addr == 1) || /* root hub addr for libusbx >= 1.0.13 */ -#endif +(udevinfo->addr == 1) || /* root hub addr since libusbx 1.0.13 */ (udevinfo->class == LIBUSB_CLASS_HUB) || /* hub*/ (udevinfo->addr == 0)); /* bad address */ return skip; -- 2.20.1 ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH spice-common 1/6] messages: Remove fields not used by the protocol
On Thu, 2019-02-21 at 10:38 +, Frediano Ziglio wrote: > 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 have them). > > Signed-off-by: Frediano Ziglio > --- > common/messages.h | 4 > 1 file changed, 4 deletions(-) > > diff --git a/common/messages.h b/common/messages.h > index 3e37235..91ac7ad 100644 > --- a/common/messages.h > +++ b/common/messages.h > @@ -43,7 +43,6 @@ > SPICE_BEGIN_DECLS > > typedef struct SpiceMsgData { > -uint32_t data_size; > uint8_t data[0]; > } SpiceMsgData; > > @@ -75,9 +74,6 @@ typedef struct SpiceMigrationDstInfo { > uint16_t sport; > uint32_t host_size; > uint8_t *host_data; > -uint16_t pub_key_type; > -uint32_t pub_key_size; > -uint8_t *pub_key_data; > uint32_t cert_subject_size; > uint8_t *cert_subject_data; > } SpiceMigrationDstInfo; Hmm, slightly tricky, this one. It's technically an ABI change, but since we only use spice-common as a submodule, I suppose it's OK to remove. I'd like to see the commit log mention that this is leftover from v1 of the protocol, which we removed support for already. Acked-by: Jonathon Jongsma ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] [PATCH spice-common 6/6] Generate automatically most C message declarations
So, I applied these patches, and generated the messages with the new code and compared it to the old hand-coded message.h file. I had to re- arrange a bunch of the newly-generated code to get a readable diff, but I end up with the attached output. A few notable changes: - Quite a few fields have changed type (uint32_t => uint16_t in most cases, a few cases of uint32_t => uint8_t) - SpiceMsgData lost its data_size field? - SpiceMsgPlaybackPacket seems to have had some fields re-arranged. Old type was { time, data, data_size }. New type is { time, data_size, data } - smartcard messages are gone Jonathon On Thu, 2019-02-21 at 10:38 +, Frediano Ziglio wrote: > 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 > --- a/common/messages.h > +++ b/common/messages.h > @@ -42,10 +42,6 @@ > > SPICE_BEGIN_DECLS > > -typedef struct SpiceMsgData { > -uint8_t data[0]; > -} SpiceMsgData; > - > typedef struct SpiceMsgCompressedData { > uint8_t type; > uint32_t uncompressed_size; > @@ -53,438 +49,8 @@ typedef struct SpiceMsgCompressedData { > uint8_t *compressed_data; > } SpiceMsgCompressedData; > > -typedef struct SpiceMsgEmpty { > -uint8_t padding; > -} SpiceMsgEmpty; > - > -typedef struct SpiceMsgInputsInit { > -uint32_t keyboard_modifiers; > -} SpiceMsgInputsInit; > - > -typedef struct SpiceMsgInputsKeyModifiers { > -uint32_t modifiers; > -} SpiceMsgInputsKeyModifiers; > - > -typedef struct SpiceMsgMainMultiMediaTime { > -uint32_t time; > -} SpiceMsgMainMultiMediaTime; > - > -typedef struct SpiceMigrationDstInfo { > -uint16_t port; > -uint16_t sport; > -uint32_t host_size; > -uint8_t *host_data; > -uint32_t cert_subject_size; > -uint8_t *cert_subject_data; > -} SpiceMigrationDstInfo; > - > -typedef struct SpiceMsgMainMigrationBegin { > -SpiceMigrationDstInfo dst_info; > -} SpiceMsgMainMigrationBegin; > - > -typedef struct SpiceMsgMainMigrateBeginSeamless { > -SpiceMigrationDstInfo dst_info; > -uint32_t src_mig_version; > -} SpiceMsgMainMigrateBeginSeamless; > - > -typedef struct SpiceMsgcMainMigrateDstDoSeamless { > -uint32_t src_version; > -} SpiceMsgcMainMigrateDstDoSeamless; > - > -typedef struct SpiceMsgMainMigrationSwitchHost { > -uint16_t port; > -uint16_t sport; > -uint32_t host_size; > -uint8_t *host_data; > -uint32_t cert_subject_size; > -uint8_t *cert_subject_data; > -} SpiceMsgMainMigrationSwitchHost; > - > - > -typedef struct SpiceMsgMigrate { > -uint32_t flags; > -} SpiceMsgMigrate; > - > -typedef struct SpiceResourceID { > -uint8_t type; > -uint64_t id; > -} SpiceResourceID; > - > -typedef struct SpiceResourceList { > -uint16_t count; > -SpiceResourceID resources[0]; > -} SpiceResourceList; > - > -typedef struct SpiceMsgSetAck { > -uint32_t generation; > -uint32_t window; > -} SpiceMsgSetAck; > - > -typedef struct SpiceMsgcAckSync { > - uint32_t generation; > -} SpiceMsgcAckSync; > - > -typedef struct SpiceWaitForChannel { > -uint8_t channel_type; > -uint8_t channel_id; > -uint64_t message_serial; > -} SpiceWaitForChannel; > - > -typedef struct SpiceMsgWaitForChannels { > -uint8_t wait_count; > -SpiceWaitForChannel wait_list[0]; > -} SpiceMsgWaitForChannels; > - > -typedef struct SpiceChannelId { > -uint8_t type; > -uint8_t id; > -} SpiceChannelId; > - > -typedef struct SpiceMsgMainInit { > -uint32_t session_id; > -uint32_t display_channels_hint; > -uint32_t supported_mouse_modes; > -uint32_t current_mouse_mode; > -uint32_t agent_connected; > -uint32_t agent_tokens; > -uint32_t multi_media_time; > -uint32_t ram_hint; > -} SpiceMsgMainInit; > - > -typedef struct SpiceMsgDisconnect { > -uint64_t time_stamp; > -uint32_t reason; // SPICE_ERR_? > -} SpiceMsgDisconnect; > - > -typedef struct SpiceMsgNotify { > -uint64_t time_stamp; > -uint32_t severity; > -uint32_t visibilty; > -uint32_t what; > -uint32_t message_len; > -uint8_t message[0]; > -} SpiceMsgNotify; > - > -typedef struct SpiceMsgChannels { > -uint32_t num_of_channels; > -SpiceChannelId channels[0]; > -} SpiceMsgChannels; > - > -typedef struct SpiceMsgMainName { > -uint32_t name_len; > -uint8_t name[0]; > -} SpiceMsgMainName; > - > -typedef struct SpiceMsgMainUuid { > -uint8_t uuid[16]; > -} SpiceMsgMainUuid; > - > -typedef struct SpiceMsgMainMouseMode { > -uint32_t supported_modes; > -uint32_t current_mode; > -} SpiceMsgMainMouseMode; > - > -typedef struct SpiceMsgPing { > -uint32_t id; > -uint64_t timestamp; > -void *data; > -uint32_t data_len; > -} SpiceMsgPing; > - > -typedef struct SpiceMsgMainAgentDisconnect { > -
Re: [Spice-devel] [PATCH spice-server] red-pipe-item: Removed some not necessary headers inclusions
Acked-by: Jonathon Jongsma On Fri, 2019-02-22 at 16:12 +, Frediano Ziglio wrote: > RedPipeItem is not using the Ring structures anymore. > Also is not using GLib functionality. > Just include base headers. > > Signed-off-by: Frediano Ziglio > --- > server/red-pipe-item.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/server/red-pipe-item.h b/server/red-pipe-item.h > index 8e9115725..2cfb5ddbd 100644 > --- a/server/red-pipe-item.h > +++ b/server/red-pipe-item.h > @@ -19,8 +19,8 @@ > #ifndef RED_PIPE_ITEM_H_ > #define RED_PIPE_ITEM_H_ > > -#include > -#include > +#include > +#include > > typedef struct RedPipeItem RedPipeItem; > ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel