Compare commits

...

No commits in common. 'c9' and 'i9-spice' have entirely different histories.
c9 ... i9-spice

3
.gitignore vendored

@ -1,2 +1 @@
SOURCES/jrope-7FDAB9AF.keyring
SOURCES/spice-vdagent-0.21.0.tar.bz2
SOURCES/spice-vdagent-0.22.1.tar.bz2

@ -1,2 +1 @@
86a182f7da5e6d6da9b4fac5dacbcb5d6a8afe5f SOURCES/jrope-7FDAB9AF.keyring
1e55469fc20efc705b084a7b2a8e2de59bf4d197 SOURCES/spice-vdagent-0.21.0.tar.bz2
2ba3cddecb1cb2da42fbdff34ae30e3538e00112 SOURCES/spice-vdagent-0.22.1.tar.bz2

@ -1,112 +0,0 @@
From 8348ef3c6121247e2b8be0641bbf3df3d55d9bff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
Date: Tue, 4 May 2021 13:20:47 +0400
Subject: [PATCH] Fix g_memdup deprecation warning with glib >= 2.68
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1943059
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
configure.ac | 4 ++++
src/vdagent/vdagent.c | 4 ++--
src/vdagent/x11-randr.c | 2 +-
src/vdagentd/vdagentd.c | 8 ++++----
4 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7b2a99c..3de9b9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,6 +124,10 @@ PKG_CHECK_MODULES(ALSA, [alsa >= 1.0.22])
PKG_CHECK_MODULES([DBUS], [dbus-1])
PKG_CHECK_MODULES([DRM], [libdrm])
+PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.68], [], [
+ AC_DEFINE(g_memdup2, g_memdup, [GLib2 < 2.68 compatibility])
+])
+
if test "$with_session_info" = "auto" || test "$with_session_info" = "systemd"; then
PKG_CHECK_MODULES([LIBSYSTEMD_LOGIN],
[libsystemd >= 209],
diff --git a/src/vdagent/vdagent.c b/src/vdagent/vdagent.c
index 0c69907..fd08522 100644
--- a/src/vdagent/vdagent.c
+++ b/src/vdagent/vdagent.c
@@ -228,7 +228,7 @@ static void daemon_read_complete(UdscsConnection *conn,
break;
case VDAGENTD_AUDIO_VOLUME_SYNC: {
VDAgentAudioVolumeSync *avs = (VDAgentAudioVolumeSync *)data;
- uint16_t *volume = g_memdup(avs->volume, sizeof(uint16_t) * avs->nchannels);
+ uint16_t *volume = g_memdup2(avs->volume, sizeof(uint16_t) * avs->nchannels);
if (avs->is_playback) {
vdagent_audio_playback_sync(avs->mute, avs->nchannels, volume);
@@ -414,7 +414,7 @@ int main(int argc, char *argv[])
GOptionContext *context;
GError *error = NULL;
VDAgent *agent;
- char **orig_argv = g_memdup(argv, sizeof(char*) * (argc+1));
+ char **orig_argv = g_memdup2(argv, sizeof(char*) * (argc+1));
orig_argv[argc] = NULL; /* To avoid clang analyzer false-positive */
context = g_option_context_new(NULL);
diff --git a/src/vdagent/x11-randr.c b/src/vdagent/x11-randr.c
index 27404a1..037aded 100644
--- a/src/vdagent/x11-randr.c
+++ b/src/vdagent/x11-randr.c
@@ -982,7 +982,7 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11,
fullscreen it will keep sending the failing config. */
g_free(x11->randr.failed_conf);
x11->randr.failed_conf =
- g_memdup(mon_config, config_size(mon_config->num_of_monitors));
+ g_memdup2(mon_config, config_size(mon_config->num_of_monitors));
return;
}
}
diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c
index 78378aa..3e59331 100644
--- a/src/vdagentd/vdagentd.c
+++ b/src/vdagentd/vdagentd.c
@@ -216,7 +216,7 @@ static void do_client_monitors(VirtioPort *vport, int port_nr,
vdagentd_write_xorg_conf(new_monitors);
g_free(mon_config);
- mon_config = g_memdup(new_monitors, size);
+ mon_config = g_memdup2(new_monitors, size);
/* Send monitor config to currently active agent */
if (active_session_conn)
@@ -249,7 +249,7 @@ static void do_client_capabilities(VirtioPort *vport,
{
capabilities_size = VD_AGENT_CAPS_SIZE_FROM_MSG_SIZE(message_header->size);
g_free(capabilities);
- capabilities = g_memdup(caps->caps, capabilities_size * sizeof(uint32_t));
+ capabilities = g_memdup2(caps->caps, capabilities_size * sizeof(uint32_t));
if (caps->request) {
/* Report the previous client has disconnected. */
@@ -647,7 +647,7 @@ static void virtio_port_read_complete(
case VD_AGENT_GRAPHICS_DEVICE_INFO: {
// store device info for re-sending when a session agent reconnects
g_free(device_info);
- device_info = g_memdup(data, message_header->size);
+ device_info = g_memdup2(data, message_header->size);
device_info_size = message_header->size;
forward_data_to_session_agent(VDAGENTD_GRAPHICS_DEVICE_INFO, data, message_header->size);
break;
@@ -1090,7 +1090,7 @@ static void do_agent_xorg_resolution(UdscsConnection *conn,
}
g_free(agent_data->screen_info);
- agent_data->screen_info = g_memdup(data, header->size);
+ agent_data->screen_info = g_memdup2(data, header->size);
agent_data->width = header->arg1;
agent_data->height = header->arg2;
agent_data->screen_count = n;
--
2.31.1

@ -44,5 +44,5 @@ index 790d9ad..602ab65 100644
vdagent_x11_destroy(display->x11, vdagentd_disconnected);
--
2.39.0
2.44.0

@ -1,62 +0,0 @@
From 1aa2c06015e15f707ba9f874d5a5ea49fd450745 Mon Sep 17 00:00:00 2001
From: Victor Toso <victortoso@redhat.com>
Date: Wed, 1 Dec 2021 20:07:22 +0100
Subject: [PATCH 2/3] vdagent: udscs: limit retry to connect to vdagentd
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2005802
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2028013
Signed-off-by: Victor Toso <victortoso@redhat.com>
---
src/vdagent/vdagent.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/vdagent/vdagent.c b/src/vdagent/vdagent.c
index fd08522..0d3945e 100644
--- a/src/vdagent/vdagent.c
+++ b/src/vdagent/vdagent.c
@@ -42,11 +42,14 @@
#include "clipboard.h"
#include "display.h"
+#define MAX_RETRY_CONNECT_SYSTEM_AGENT 60
+
typedef struct VDAgent {
VDAgentClipboards *clipboards;
VDAgentDisplay *display;
struct vdagent_file_xfers *xfers;
UdscsConnection *conn;
+ gint udscs_num_retry;
GMainLoop *loop;
} VDAgent;
@@ -378,9 +381,27 @@ static gboolean vdagent_init_async_cb(gpointer user_data)
daemon_read_complete, daemon_error_cb,
debug);
if (agent->conn == NULL) {
+ if (agent->udscs_num_retry == MAX_RETRY_CONNECT_SYSTEM_AGENT) {
+ syslog(LOG_WARNING,
+ "Failed to connect to spice-vdagentd at %s (tried %d times)",
+ vdagentd_socket, agent->udscs_num_retry);
+ goto err_init;
+ }
+ if (agent->udscs_num_retry == 0) {
+ /* Log only when it fails and at the end */
+ syslog(LOG_DEBUG,
+ "Failed to connect with spice-vdagentd. Trying again in 1s");
+ }
+ agent->udscs_num_retry++;
g_timeout_add_seconds(1, vdagent_init_async_cb, agent);
return G_SOURCE_REMOVE;
}
+ if (agent->udscs_num_retry != 0) {
+ syslog(LOG_DEBUG,
+ "Connected with spice-vdagentd after %d attempts",
+ agent->udscs_num_retry);
+ }
+ agent->udscs_num_retry = 0;
g_object_set_data(G_OBJECT(agent->conn), "agent", agent);
agent->display = vdagent_display_create(agent->conn, debug, x11_sync);
--
2.33.1

@ -1,98 +0,0 @@
From 09de02fd5cb12fcda3326e243981750c5358b7b6 Mon Sep 17 00:00:00 2001
From: Victor Toso <victortoso@redhat.com>
Date: Mon, 20 Dec 2021 19:09:37 +0100
Subject: [PATCH 3/3] udscs: udscs_connect: return error to caller
This way we can have the log in one place and avoid flooding the journal.
Signed-off-by: Victor Toso <victortoso@redhat.com>
---
src/udscs.c | 10 ++++------
src/udscs.h | 5 ++++-
src/vdagent/vdagent.c | 12 +++++++++---
3 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/src/udscs.c b/src/udscs.c
index 3df67b3..6c50f76 100644
--- a/src/udscs.c
+++ b/src/udscs.c
@@ -107,16 +107,14 @@ static void udscs_connection_class_init(UdscsConnectionClass *klass)
UdscsConnection *udscs_connect(const char *socketname,
udscs_read_callback read_callback,
VDAgentConnErrorCb error_cb,
- int debug)
+ int debug,
+ GError **err)
{
GIOStream *io_stream;
UdscsConnection *conn;
- GError *err = NULL;
- io_stream = vdagent_socket_connect(socketname, &err);
- if (err) {
- syslog(LOG_ERR, "%s: %s", __func__, err->message);
- g_error_free(err);
+ io_stream = vdagent_socket_connect(socketname, err);
+ if (*err) {
return NULL;
}
diff --git a/src/udscs.h b/src/udscs.h
index 4f7ea36..0d4197b 100644
--- a/src/udscs.h
+++ b/src/udscs.h
@@ -53,11 +53,14 @@ typedef void (*udscs_read_callback)(UdscsConnection *conn,
*
* If debug is true then the events on this connection will be traced.
* This includes the incoming and outgoing message names.
+ *
+ * In case of failure, returns NULL and set @err with reason.
*/
UdscsConnection *udscs_connect(const char *socketname,
udscs_read_callback read_callback,
VDAgentConnErrorCb error_cb,
- int debug);
+ int debug,
+ GError **err);
/* Queue a message for delivery to the client connected through conn.
*/
diff --git a/src/vdagent/vdagent.c b/src/vdagent/vdagent.c
index 0d3945e..05d1a8f 100644
--- a/src/vdagent/vdagent.c
+++ b/src/vdagent/vdagent.c
@@ -376,22 +376,28 @@ static void vdagent_destroy(VDAgent *agent)
static gboolean vdagent_init_async_cb(gpointer user_data)
{
VDAgent *agent = user_data;
+ GError *err = NULL;
agent->conn = udscs_connect(vdagentd_socket,
- daemon_read_complete, daemon_error_cb,
- debug);
+ daemon_read_complete,
+ daemon_error_cb,
+ debug,
+ &err);
if (agent->conn == NULL) {
if (agent->udscs_num_retry == MAX_RETRY_CONNECT_SYSTEM_AGENT) {
syslog(LOG_WARNING,
"Failed to connect to spice-vdagentd at %s (tried %d times)",
vdagentd_socket, agent->udscs_num_retry);
+ g_error_free(err);
goto err_init;
}
if (agent->udscs_num_retry == 0) {
/* Log only when it fails and at the end */
syslog(LOG_DEBUG,
- "Failed to connect with spice-vdagentd. Trying again in 1s");
+ "Failed to connect with spice-vdagentd due '%s'. Trying again in 1s",
+ err->message);
}
+ g_error_free(err);
agent->udscs_num_retry++;
g_timeout_add_seconds(1, vdagent_init_async_cb, agent);
return G_SOURCE_REMOVE;
--
2.33.1

@ -1,33 +0,0 @@
From 0717474feca8753bce7b8933bd10b3bab62a2f14 Mon Sep 17 00:00:00 2001
From: Frediano Ziglio <freddy77@gmail.com>
Date: Sat, 12 Feb 2022 21:12:57 +0000
Subject: [PATCH] Do not process X11 events in vdagent_x11_create
Processing events requires some more initialisation between
VDAgentDisplay and vdagent_x11.
Postpone that after initialisation.
This fix a crash on Fedora 36, see
https://bugzilla.redhat.com/show_bug.cgi?id=2042877.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
---
src/vdagent/x11.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/vdagent/x11.c b/src/vdagent/x11.c
index 05a41d7..4af4bdc 100644
--- a/src/vdagent/x11.c
+++ b/src/vdagent/x11.c
@@ -302,9 +302,6 @@ struct vdagent_x11 *vdagent_x11_create(UdscsConnection *vdagentd,
x11->height[i] = attrib.height;
}
- /* Flush output buffers and consume any pending events */
- vdagent_x11_do_read(x11);
-
return x11;
}
--
2.38.1

@ -1,24 +1,19 @@
Name: spice-vdagent
Version: 0.21.0
Release: 5%{?dist}
Version: 0.22.1
Release: 7%{?dist}.inferit
Summary: Agent for Spice guests
License: GPLv3+
License: GPL-3.0-or-later
URL: https://spice-space.org/
Source0: https://spice-space.org/download/releases/%{name}-%{version}.tar.bz2
Source1: https://spice-space.org/download/releases/%{name}-%{version}.tar.bz2.sig
Source2: jrope-7FDAB9AF.keyring
Patch0001: 0001-Fix-g_memdup-deprecation-warning-with-glib-2.68.patch
Patch0002: 0002-vdagent-udscs-limit-retry-to-connect-to-vdagentd.patch
Patch0003: 0003-udscs-udscs_connect-return-error-to-caller.patch
Patch0004: 0004-Do-not-process-X11-events-in-vdagent_x11_create.patch
Patch0005: 0005-vdagent-Remove-watch-event-on-vdagent_display_destro.patch
Source2: victortoso-E37A484F.keyring
Patch0000: 0001-vdagent-Remove-watch-event-on-vdagent_display_destro.patch
BuildRequires: make
BuildRequires: systemd-devel
BuildRequires: glib2-devel >= 2.50
BuildRequires: spice-protocol >= 0.14.3
BuildRequires: libXrandr-devel libXinerama-devel
BuildRequires: libpciaccess-devel libXrandr-devel libXinerama-devel
BuildRequires: libXfixes-devel systemd desktop-file-utils libtool
BuildRequires: alsa-lib-devel dbus-devel libdrm-devel
# For autoreconf, needed after clipboard patch series
@ -46,16 +41,12 @@ autoreconf -fi
%build
%configure \
--with-session-info=systemd \
--with-init-script=systemd \
--disable-pciaccess
make %{?_smp_mflags} V=2
%configure --with-session-info=systemd --with-init-script=systemd
%make_build V=2
%install
make install DESTDIR=$RPM_BUILD_ROOT V=2
%make_install V=2
%post
@ -74,6 +65,7 @@ make install DESTDIR=$RPM_BUILD_ROOT V=2
%{_unitdir}/spice-vdagentd.service
%{_unitdir}/spice-vdagentd.socket
%{_prefix}/lib/tmpfiles.d/spice-vdagentd.conf
%{_userunitdir}/spice-vdagent.service
%{_bindir}/spice-vdagent
%{_sbindir}/spice-vdagentd
%{_var}/run/spice-vdagentd
@ -85,22 +77,55 @@ make install DESTDIR=$RPM_BUILD_ROOT V=2
%changelog
* Mon Jan 16 2023 Victor Toso <victortoso@redhat.com> 0.21.0-5
- Avoid crash due use before initialisation of X11 events
Related: rhbz#2160750
* Tue Dec 21 2021 Victor Toso <victortoso@redhat.com> 0.21.0-4
- Limit session agent to (re)connect to system agent to a minute
Related: rhbz#2028013
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 0.21.0-3
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Jun 01 2021 Uri Lublin <uril@redhat.com> - 0.21.0-2
- Build without pciaccess
Resolves: rhbz#1964922
- Fix g_memdup deprecation warning with glib >= 2.68
* Tue Nov 26 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.22.1-7.inferit
- Added suffix
* Fri Aug 23 2024 Dmitriy Samoylik <samoylikdv@msvsphere-os.ru> - 0.22.1-7
- Rebuilt for MSVSphere 9.4
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Tue Apr 09 2024 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.22.1-6
- Fix crash with X11 handling code. rhbz#2274147
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Feb 14 2022 Victor Toso <victortoso@redhat.com> 0.22.1-1
- Update to spice-vdagent 0.22.1
* Thu Feb 10 2022 Victor Toso <victortoso@redhat.com> 0.22.0-1
- Update to spice-vdagent 0.22.0
* Mon Feb 07 2022 Stephen Gallagher <sgallagh@redhat.com> - 0.21.0-7
- Fix build against GLib >= 2.68
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.21.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.21.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jul 16 2021 Rex Dieter <rdieter@fedoraproject.org> - 0.21.0-4
- use upstream-able patch (upstream merge request 37)
* Wed Jul 14 2021 Rex Dieter <rdieter@fedoraproject.org> - 0.21.0-3
- add user spice-vdgant.service (#1951580)
- use %%make_build/%%make_install
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.21.0-2
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
* Mon Feb 8 2021 Victor Toso <victortoso@redhat.com> 0.21.0-1
- Update to spice-vdagent 0.21.0

Loading…
Cancel
Save