diff --git a/SOURCES/0001-vdagent-d-Add-printing-of-version-to-h-output.patch b/SOURCES/0001-vdagent-d-Add-printing-of-version-to-h-output.patch index 211c0fc..a8d5973 100644 --- a/SOURCES/0001-vdagent-d-Add-printing-of-version-to-h-output.patch +++ b/SOURCES/0001-vdagent-d-Add-printing-of-version-to-h-output.patch @@ -1,10 +1,10 @@ -From 256e01c8c7b0c386525a0fac71537bb7bb05d271 Mon Sep 17 00:00:00 2001 +From e22b6b97a067d7c10bfba64fbef60afa777f6275 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 6 Jun 2013 17:00:22 +0200 -Subject: [linux-vdagent PATCH 1/3] vdagent[d]: Add printing of version to -h - output +Subject: [PATCH] vdagent[d]: Add printing of version to -h output Signed-off-by: Hans de Goede +(cherry picked from commit 256e01c8c7b0c386525a0fac71537bb7bb05d271) --- src/vdagent.c | 6 +++--- src/vdagentd.c | 4 ++-- @@ -34,7 +34,7 @@ index 7e1b474..9e238d3 100644 static void quit_handler(int sig) diff --git a/src/vdagentd.c b/src/vdagentd.c -index 888a80a..da25329 100644 +index fbbe315..1ba957a 100644 --- a/src/vdagentd.c +++ b/src/vdagentd.c @@ -718,7 +718,7 @@ static void usage(FILE *fp) @@ -55,6 +55,3 @@ index 888a80a..da25329 100644 } void daemonize(void) --- -1.8.3.1 - diff --git a/SOURCES/0002-vdagentd-Advertise-VD_AGENT_CAP_GUEST_LINEEND_LF.patch b/SOURCES/0002-vdagentd-Advertise-VD_AGENT_CAP_GUEST_LINEEND_LF.patch index da04db7..c7e3388 100644 --- a/SOURCES/0002-vdagentd-Advertise-VD_AGENT_CAP_GUEST_LINEEND_LF.patch +++ b/SOURCES/0002-vdagentd-Advertise-VD_AGENT_CAP_GUEST_LINEEND_LF.patch @@ -1,8 +1,7 @@ -From 43cde1cbedc56138a857100f634e7cb644477e7e Mon Sep 17 00:00:00 2001 +From b251f710663cbbf4170d98f64d1f0bd4eb70f848 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 24 Jun 2013 10:34:27 +0200 -Subject: [linux-vdagent PATCH 2/3] vdagentd: Advertise - VD_AGENT_CAP_GUEST_LINEEND_LF +Subject: [PATCH] vdagentd: Advertise VD_AGENT_CAP_GUEST_LINEEND_LF Signed-off-by: Hans de Goede --- @@ -10,7 +9,7 @@ Signed-off-by: Hans de Goede 1 file changed, 1 insertion(+) diff --git a/src/vdagentd.c b/src/vdagentd.c -index da25329..f4cea44 100644 +index 1ba957a..6280dfa 100644 --- a/src/vdagentd.c +++ b/src/vdagentd.c @@ -95,6 +95,7 @@ static void send_capabilities(struct vdagent_virtio_port *vport, @@ -21,6 +20,3 @@ index da25329..f4cea44 100644 vdagent_virtio_port_write(vport, VDP_CLIENT_PORT, VD_AGENT_ANNOUNCE_CAPABILITIES, 0, --- -1.8.3.1 - diff --git a/SOURCES/0003-buildsys-Build-vdagentd-as-pie-relro-when-possible.patch b/SOURCES/0003-buildsys-Build-vdagentd-as-pie-relro-when-possible.patch index 9c38452..de5df8f 100644 --- a/SOURCES/0003-buildsys-Build-vdagentd-as-pie-relro-when-possible.patch +++ b/SOURCES/0003-buildsys-Build-vdagentd-as-pie-relro-when-possible.patch @@ -1,17 +1,17 @@ -From 71b8e75c6f1bc6c482d28cf29b82643d6b38cf34 Mon Sep 17 00:00:00 2001 +From 3b4db5a5064909641ad80e0c1678a62f94afb9aa Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 3 Jul 2013 11:16:20 +0200 -Subject: [linux-vdagent PATCH 3/3] buildsys: Build vdagentd as pie + relro - when possible +Subject: [PATCH] buildsys: Build vdagentd as pie + relro when possible Signed-off-by: Hans de Goede +(cherry picked from commit 71b8e75c6f1bc6c482d28cf29b82643d6b38cf34) --- Makefile.am | 6 ++++-- configure.ac | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am -index fa2803a..74cc313 100644 +index ea9bc05..5515ca0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,8 +8,10 @@ src_spice_vdagent_CFLAGS = $(X_CFLAGS) $(SPICE_CFLAGS) $(GLIB2_CFLAGS) @@ -77,6 +77,3 @@ index 91a24ff..a1ce6c0 100644 install RH initscript: ${init_redhat} install systemd service: ${init_systemd} --- -1.8.3.1 - diff --git a/SOURCES/0004-Not-having-the-virtio-channel-is-not-an-error-instea.patch b/SOURCES/0004-Not-having-the-virtio-channel-is-not-an-error-instea.patch index c72822d..051213e 100644 --- a/SOURCES/0004-Not-having-the-virtio-channel-is-not-an-error-instea.patch +++ b/SOURCES/0004-Not-having-the-virtio-channel-is-not-an-error-instea.patch @@ -1,8 +1,8 @@ -From 99a2628b0ff04e0aadd130e45aa2598c4df64690 Mon Sep 17 00:00:00 2001 +From 528a816d2be5fccb531e7711a4c2efea7dbd0348 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 11 Jun 2013 15:21:13 -0400 -Subject: [linux-vdagent PATCH 04/12] Not having the virtio channel is not an - error; instead silently do nothing +Subject: [PATCH] Not having the virtio channel is not an error; instead + silently do nothing Fedora for example bundles the SPICE agent by default; however, we don't want to spew an error when running non-virtualized, or with @@ -38,6 +38,3 @@ index 9e238d3..10ebf6e 100644 } if (do_daemonize) --- -1.8.3.1 - diff --git a/SOURCES/0005-vdagent-x11-Release-clipboard-on-client-disconnect-i.patch b/SOURCES/0005-vdagent-x11-Release-clipboard-on-client-disconnect-i.patch index 8ef6b7b..1970d64 100644 --- a/SOURCES/0005-vdagent-x11-Release-clipboard-on-client-disconnect-i.patch +++ b/SOURCES/0005-vdagent-x11-Release-clipboard-on-client-disconnect-i.patch @@ -1,8 +1,8 @@ -From ad6ea7594a11d8a35be84a8ae2e8403ea3344a3b Mon Sep 17 00:00:00 2001 +From 19f3f91c041ebc4e52e8d287ba6d9c66a85af0d0 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 9 Sep 2013 15:50:39 +0200 -Subject: [linux-vdagent PATCH 5/5] vdagent-x11: Release clipboard on client - disconnect if owned by client +Subject: [PATCH] vdagent-x11: Release clipboard on client disconnect if owned + by client https://bugzilla.redhat.com/show_bug.cgi?id=1003977 @@ -14,10 +14,10 @@ Signed-off-by: Hans de Goede 3 files changed, 13 insertions(+) diff --git a/src/vdagent-x11.c b/src/vdagent-x11.c -index 4588b3d..5ce6000 100644 +index 6a58532..8287421 100644 --- a/src/vdagent-x11.c +++ b/src/vdagent-x11.c -@@ -1305,6 +1305,16 @@ void vdagent_x11_clipboard_release(struct vdagent_x11 *x11, uint8_t selection) +@@ -1301,6 +1301,16 @@ void vdagent_x11_clipboard_release(struct vdagent_x11 *x11, uint8_t selection) vdagent_x11_do_read(x11); } @@ -35,7 +35,7 @@ index 4588b3d..5ce6000 100644 xdg desktop dir or xdg download dir. We error on the save side and use a whitelist approach, so any unknown desktops will end up with saving diff --git a/src/vdagent-x11.h b/src/vdagent-x11.h -index a2a2485..d64a42a 100644 +index baa4ce8..5d949f6 100644 --- a/src/vdagent-x11.h +++ b/src/vdagent-x11.h @@ -46,6 +46,8 @@ void vdagent_x11_clipboard_data(struct vdagent_x11 *x11, uint8_t selection, @@ -48,10 +48,10 @@ index a2a2485..d64a42a 100644 #endif diff --git a/src/vdagent.c b/src/vdagent.c -index f270615..d7f7aba 100644 +index 10ebf6e..c5e09ff 100644 --- a/src/vdagent.c +++ b/src/vdagent.c -@@ -104,6 +104,7 @@ void daemon_read_complete(struct udscs_connection **connp, +@@ -103,6 +103,7 @@ void daemon_read_complete(struct udscs_connection **connp, free(data); break; case VDAGENTD_CLIENT_DISCONNECTED: @@ -59,6 +59,3 @@ index f270615..d7f7aba 100644 vdagent_file_xfers_destroy(vdagent_file_xfers); vdagent_file_xfers = vdagent_file_xfers_create(client, fx_dir, fx_open_dir, debug); --- -1.8.3.1 - diff --git a/SOURCES/0007-clipboard-target_to_type-fix-inner-loop-variable-nam.patch b/SOURCES/0007-clipboard-target_to_type-fix-inner-loop-variable-nam.patch new file mode 100644 index 0000000..f82917c --- /dev/null +++ b/SOURCES/0007-clipboard-target_to_type-fix-inner-loop-variable-nam.patch @@ -0,0 +1,25 @@ +From aff972e4123aa9288a19c34d0e704972e29dd630 Mon Sep 17 00:00:00 2001 +From: Uri Lublin +Date: Wed, 27 Nov 2013 18:38:07 +0200 +Subject: [PATCH] clipboard target_to_type: fix inner loop variable name + +(cherry picked from commit 29022fdc3b70d9cd4a89d5505be989b94aa466b3) + +https://bugzilla.redhat.com/show_bug.cgi?id=1117764 +--- + src/vdagent-x11.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/vdagent-x11.c b/src/vdagent-x11.c +index 8287421..8781d5e 100644 +--- a/src/vdagent-x11.c ++++ b/src/vdagent-x11.c +@@ -753,7 +753,7 @@ static uint32_t vdagent_x11_target_to_type(struct vdagent_x11 *x11, + int i, j; + + for (i = 0; i < clipboard_format_count; i++) { +- for (j = 0; j < x11->clipboard_formats[i].atom_count; i++) { ++ for (j = 0; j < x11->clipboard_formats[i].atom_count; j++) { + if (x11->clipboard_formats[i].atoms[j] == target) { + return x11->clipboard_formats[i].type; + } diff --git a/SOURCES/0008-Reply-to-TIMESTAMP-requests.patch b/SOURCES/0008-Reply-to-TIMESTAMP-requests.patch new file mode 100644 index 0000000..b757866 --- /dev/null +++ b/SOURCES/0008-Reply-to-TIMESTAMP-requests.patch @@ -0,0 +1,60 @@ +From ad6ddbe2857cfc7e7c8657b1eefb91f305012ef5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= +Date: Tue, 15 Jul 2014 13:17:09 +0200 +Subject: [PATCH] Reply to TIMESTAMP requests + +Add TIMESTAMP handling, +This is to please vncviewer. + +https://bugzilla.redhat.com/show_bug.cgi?id=1117764 +(cherry picked from commit b87fab52eb825429e5393ac4c2c073c918d8ed8f) +--- + src/vdagent-x11-priv.h | 1 + + src/vdagent-x11.c | 15 +++++++++++++++ + 2 files changed, 16 insertions(+) + +diff --git a/src/vdagent-x11-priv.h b/src/vdagent-x11-priv.h +index c607850..4a5729b 100644 +--- a/src/vdagent-x11-priv.h ++++ b/src/vdagent-x11-priv.h +@@ -83,6 +83,7 @@ struct vdagent_x11 { + Atom targets_atom; + Atom incr_atom; + Atom multiple_atom; ++ Atom timestamp_atom; + Window root_window[MAX_SCREENS]; + Window selection_window; + struct udscs_connection *vdagentd; +diff --git a/src/vdagent-x11.c b/src/vdagent-x11.c +index 8781d5e..5ac2cf7 100644 +--- a/src/vdagent-x11.c ++++ b/src/vdagent-x11.c +@@ -218,6 +218,7 @@ struct vdagent_x11 *vdagent_x11_create(struct udscs_connection *vdagentd, + x11->targets_atom = XInternAtom(x11->display, "TARGETS", False); + x11->incr_atom = XInternAtom(x11->display, "INCR", False); + x11->multiple_atom = XInternAtom(x11->display, "MULTIPLE", False); ++ x11->timestamp_atom = XInternAtom(x11->display, "TIMESTAMP", False); + for(i = 0; i < clipboard_format_count; i++) { + x11->clipboard_formats[i].type = clipboard_format_templates[i].type; + for(j = 0; clipboard_format_templates[i].atom_names[j]; j++) { +@@ -1033,6 +1034,20 @@ static void vdagent_x11_handle_selection_request(struct vdagent_x11 *x11) + return; + } + ++ if (event->xselectionrequest.target == x11->timestamp_atom) { ++ /* TODO: use more accurate selection time */ ++ guint32 timestamp = event->xselectionrequest.time; ++ ++ XChangeProperty(x11->display, event->xselectionrequest.requestor, ++ event->xselectionrequest.property, ++ event->xselectionrequest.target, 32, PropModeReplace, ++ (guint8*)×tamp, 1); ++ vdagent_x11_send_selection_notify(x11, ++ event->xselectionrequest.property, NULL); ++ return; ++ } ++ ++ + if (event->xselectionrequest.target == x11->targets_atom) { + vdagent_x11_send_targets(x11, selection, event); + return; diff --git a/SOURCES/0009-Handle-STRING-selection-type.patch b/SOURCES/0009-Handle-STRING-selection-type.patch new file mode 100644 index 0000000..57a4619 --- /dev/null +++ b/SOURCES/0009-Handle-STRING-selection-type.patch @@ -0,0 +1,28 @@ +From cc07f85852d9dbb5e160d27804aec445f73f5833 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= +Date: Tue, 15 Jul 2014 16:48:06 +0200 +Subject: [PATCH] Handle STRING selection type + +This is to please vncviewer. + +https://bugzilla.redhat.com/show_bug.cgi?id=1117764 +(cherry picked from commit 658c4d76e2aff9441614dcd09821057b9fd8c8c2) +--- + src/vdagent-x11-priv.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/vdagent-x11-priv.h b/src/vdagent-x11-priv.h +index 4a5729b..38f852e 100644 +--- a/src/vdagent-x11-priv.h ++++ b/src/vdagent-x11-priv.h +@@ -64,8 +64,8 @@ struct monitor_size { + }; + + static const struct clipboard_format_tmpl clipboard_format_templates[] = { +- { VD_AGENT_CLIPBOARD_UTF8_TEXT, { "UTF8_STRING", +- "text/plain;charset=UTF-8", "text/plain;charset=utf-8", NULL }, }, ++ { VD_AGENT_CLIPBOARD_UTF8_TEXT, { "UTF8_STRING", "text/plain;charset=UTF-8", ++ "text/plain;charset=utf-8", "STRING", NULL }, }, + { VD_AGENT_CLIPBOARD_IMAGE_PNG, { "image/png", NULL }, }, + { VD_AGENT_CLIPBOARD_IMAGE_BMP, { "image/bmp", "image/x-bmp", + "image/x-MS-bmp", "image/x-win-bitmap", NULL }, }, diff --git a/SOURCES/0010-randr-Make-resolution-changing-more-robust.patch b/SOURCES/0010-randr-Make-resolution-changing-more-robust.patch new file mode 100644 index 0000000..de59c85 --- /dev/null +++ b/SOURCES/0010-randr-Make-resolution-changing-more-robust.patch @@ -0,0 +1,140 @@ +From 5cf857175d724e399b53d9ce29d09fa7aef5bf36 Mon Sep 17 00:00:00 2001 +From: Christophe Fergeau +Date: Thu, 9 Jan 2014 17:41:07 +0100 +Subject: [PATCH] randr: Make resolution changing more robust + +When running a guest using a KMS QXL driver on a RHEL6 hypervisor, +spice_vdagent would crash on resolution changes with: +X Error of failed request: BadValue (integer parameter out of range for operation) + Major opcode of failed request: 139 (RANDR) + Minor opcode of failed request: 21 (RRSetCrtcConfig) + Value in failed request: 0x0 + Serial number of failed request: 75 + Current serial number in output stream: 75 + +(if using a newer QEMU, this will not crash as the resolution codepath is +totally different, see red_dispatcher_use_client_monitors_config() in +spice-server, when using the UMS QXL driver, the crash will not happen +because of +http://cgit.freedesktop.org/xorg/driver/xf86-video-qxl/commit/?id=907d0ff0 +). + +This crash happens in vdagent_x11_set_monitor_config() because the X server +rejects the request because we are trying to set a CRTC to a size which is +bigger than the current screen (using 'screen' and 'CRTC' as in the RandR +spec at http://www.x.org/releases/X11R7.5/doc/randrproto/randrproto.txt ). + +If we resize the screen before changing the CRTCs resolution, then this +error will no longer happen. However, if we first call XRRSetScreenSize() +and then XRRSetCrtcConfig(), the call to XRRSetScreeSize() will fail when +we try to make the screen smaller as there will be active CRTCs which would +be bigger than the screen. + +In order to solve these issues, we follow the same process as what mutter +does in meta_monitor_manager_xrandr_apply_configuration() +https://git.gnome.org/browse/mutter/tree/src/core/monitor-xrandr.c#n689: + +1. we disable the CRTCs which are off and the ones which are bigger than the + size we want to set the screen to. +2. we resize the screen with a call to XRRSetScreenSize(). +3. we set each CRTCs to their new resolution. + +https://bugzilla.redhat.com/show_bug.cgi?id=1066422 +(cherry picked from commit 9ae51f3702b1fc0d2747e44474c87a818d1e8ec3) +--- + src/vdagent-x11-randr.c | 61 +++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 47 insertions(+), 14 deletions(-) + +diff --git a/src/vdagent-x11-randr.c b/src/vdagent-x11-randr.c +index 5223f88..5fcfcc8 100644 +--- a/src/vdagent-x11-randr.c ++++ b/src/vdagent-x11-randr.c +@@ -688,8 +688,6 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11, + VDAgentMonitorsConfig *mon_config, + int fallback) + { +- int width, height; +- int x, y; + int primary_w, primary_h; + int i, real_num_of_monitors = 0; + VDAgentMonitorsConfig *curr = NULL; +@@ -748,24 +746,38 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11, + for (i = mon_config->num_of_monitors; i < x11->randr.res->noutput; i++) + xrandr_disable_output(x11, i); + ++ /* First, disable disabled CRTCs... */ + for (i = 0; i < mon_config->num_of_monitors; ++i) { + if (!monitor_enabled(&mon_config->monitors[i])) { + xrandr_disable_output(x11, i); +- continue; + } +- /* Try to create the requested resolution */ +- width = mon_config->monitors[i].width; +- height = mon_config->monitors[i].height; +- x = mon_config->monitors[i].x; +- y = mon_config->monitors[i].y; +- if (!xrandr_add_and_set(x11, i, x, y, width, height) && +- enabled_monitors(mon_config) == 1) { +- set_screen_to_best_size(x11, width, height, +- &primary_w, &primary_h); +- goto update; ++ } ++ ++ /* ... and disable the ones that would be bigger than ++ * the new RandR screen once it is resized. If they are enabled the ++ * XRRSetScreenSize call will fail with BadMatch. They will be ++ * reenabled after hanging the screen size. ++ */ ++ for (i = 0; i < curr->num_of_monitors; ++i) { ++ int width, height; ++ int x, y; ++ ++ width = curr->monitors[i].width; ++ height = curr->monitors[i].height; ++ x = curr->monitors[i].x; ++ y = curr->monitors[i].y; ++ ++ if ((x + width > primary_w) || (y + height > primary_h)) { ++ if (x11->debug) ++ syslog(LOG_DEBUG, "Disabling monitor %d: " ++ "%dx%d+%d+%d > (%d,%d)", ++ i, width, height, x, y, primary_w, primary_h); ++ ++ xrandr_disable_output(x11, i); + } + } + ++ /* Then we can resize the RandR screen. */ + if (primary_w != x11->width[0] || primary_h != x11->height[0]) { + if (x11->debug) + syslog(LOG_DEBUG, "Changing screen size to %dx%d", +@@ -793,7 +805,28 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11, + } + } + +-update: ++ /* Finally, we set the new resolutions on RandR CRTCs now that the ++ * RandR screen is big enough to hold these. */ ++ for (i = 0; i < mon_config->num_of_monitors; ++i) { ++ int width, height; ++ int x, y; ++ ++ if (!monitor_enabled(&mon_config->monitors[i])) { ++ continue; ++ } ++ /* Try to create the requested resolution */ ++ width = mon_config->monitors[i].width; ++ height = mon_config->monitors[i].height; ++ x = mon_config->monitors[i].x; ++ y = mon_config->monitors[i].y; ++ if (!xrandr_add_and_set(x11, i, x, y, width, height) && ++ enabled_monitors(mon_config) == 1) { ++ set_screen_to_best_size(x11, width, height, ++ &primary_w, &primary_h); ++ break; ++ } ++ } ++ + update_randr_res(x11, + x11->randr.num_monitors != enabled_monitors(mon_config)); + x11->width[0] = primary_w; diff --git a/SOURCES/0011-Don-t-abort-if-XRRSetCrtcConfig-fails.patch b/SOURCES/0011-Don-t-abort-if-XRRSetCrtcConfig-fails.patch new file mode 100644 index 0000000..2ae000f --- /dev/null +++ b/SOURCES/0011-Don-t-abort-if-XRRSetCrtcConfig-fails.patch @@ -0,0 +1,33 @@ +From 96c00ebf666e044d0b53ad569dde3c24ce7b9b4d Mon Sep 17 00:00:00 2001 +From: Jonathon Jongsma +Date: Thu, 19 Dec 2013 11:31:21 -0600 +Subject: [PATCH] Don't abort if XRRSetCrtcConfig fails + +In certain configurations (Fedora 20 or RHEL7 guests on a RHEL6 host), this call +fails, which cause the vdagent to abort. This patch prevents the crash, though +arbitrary resizing is obviously still non-functional in this situation. + +https://bugzilla.redhat.com/show_bug.cgi?id=1066422 +(cherry picked from commit 6e2e82e6fbb8927d5154f32c83e2b95c08fef18e) +--- + src/vdagent-x11-randr.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/vdagent-x11-randr.c b/src/vdagent-x11-randr.c +index b1f9813..46367bc 100644 +--- a/src/vdagent-x11-randr.c ++++ b/src/vdagent-x11-randr.c +@@ -366,11 +366,11 @@ static int xrandr_add_and_set(struct vdagent_x11 *x11, int output, int x, int y, + x11->randr.monitor_sizes[output].width = width; + x11->randr.monitor_sizes[output].height = height; + outputs[0] = xid; ++ vdagent_x11_set_error_handler(x11, error_handler); + s = XRRSetCrtcConfig(x11->display, x11->randr.res, x11->randr.res->crtcs[output], + CurrentTime, x, y, mode->id, RR_Rotate_0, outputs, + 1); +- +- if (s != RRSetConfigSuccess) { ++ if (vdagent_x11_restore_error_handler(x11) || (s != RRSetConfigSuccess)) { + syslog(LOG_ERR, "failed to XRRSetCrtcConfig"); + x11->set_crtc_config_not_functional = 1; + return 0; diff --git a/SOURCES/0012-Fix-gdm-autostart-path.patch b/SOURCES/0012-Fix-gdm-autostart-path.patch new file mode 100644 index 0000000..6bcea11 --- /dev/null +++ b/SOURCES/0012-Fix-gdm-autostart-path.patch @@ -0,0 +1,40 @@ +From 0758938a5bd824bdd081adf543d6cab927c6d358 Mon Sep 17 00:00:00 2001 +From: Christophe Fergeau +Date: Tue, 4 Feb 2014 17:57:17 +0100 +Subject: [PATCH] Fix gdm autostart path + +gdm 3.1.90 (June 2011) changed the path where .desktop files which should +be autostarted with gdm needs to be located. +This used to be $(datadir)/gdm/autostart/LoginWindow and is now +$(datadir)/gdm/greeter/autostart. +This means that when running gdm in a VM in a recent distribution, +arbitrary resizing the VM window will not cause the resolution to be +adjusted. This used to be working in eg RHEL6. + +This patch installs the .desktop file to both paths in order to work both +with older and newer gdms. + +https://bugzilla.redhat.com/show_bug.cgi?id=1052172 +(cherry picked from commit 7d858d5064fd0c26454b72bf9fe3e0472f31e34f) +--- + Makefile.am | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index 5515ca0..8a65704 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -42,9 +42,12 @@ noinst_HEADERS = src/glib-compat.h \ + xdgautostartdir = $(sysconfdir)/xdg/autostart + xdgautostart_DATA = $(top_srcdir)/data/spice-vdagent.desktop + +-gdmautostartdir = $(datadir)/gdm/autostart/LoginWindow ++gdmautostartdir = $(datadir)/gdm/greeter/autostart + gdmautostart_DATA = $(top_srcdir)/data/spice-vdagent.desktop + ++gdmautostart2dir = $(datadir)/gdm/autostart/LoginWindow ++gdmautostart2_DATA = $(top_srcdir)/data/spice-vdagent.desktop ++ + install-data-local: + $(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd + diff --git a/SOURCES/0013-data-remove-rsyslog-config-files.patch b/SOURCES/0013-data-remove-rsyslog-config-files.patch new file mode 100644 index 0000000..84f2dfd --- /dev/null +++ b/SOURCES/0013-data-remove-rsyslog-config-files.patch @@ -0,0 +1,56 @@ +From 35fbb9fa6341ed81b5eb6a8049d1982b2ecf4aac Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= +Date: Fri, 5 Sep 2014 15:16:34 +0200 +Subject: [PATCH] data: remove rsyslog config files + +Many systems don't use rsyslog, others don't need seperate syslog files +for vdagent. + +With systemd journal, It's possible to filter +spice-vdagent/spice-vdagentd log messages out of /var/log/messages: +journalctl SYSLOG_IDENTIFIER=spice-vdagent SLOG_IDENTIFIER=spice-vdagentd + +This simplify spice-vdagent packaging and updates, since there are no +config files to deal with. + +Related: +https://bugzilla.redhat.com/show_bug.cgi?id=1136881 +(cherry picked from commit 072fb03fa47b18dd6cdd3b5c764d59e06fc5815e) +--- + Makefile.am | 4 ---- + data/rsyslog.d/spice-vdagentd.conf | 4 ---- + 2 files changed, 8 deletions(-) + delete mode 100644 data/rsyslog.d/spice-vdagentd.conf + +diff --git a/Makefile.am b/Makefile.am +index 8a65704..a06a259 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -51,9 +51,6 @@ gdmautostart2_DATA = $(top_srcdir)/data/spice-vdagent.desktop + install-data-local: + $(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd + +-rsyslogdir = $(sysconfdir)/rsyslog.d +-rsyslog_DATA = $(top_srcdir)/data/rsyslog.d/spice-vdagentd.conf +- + if INIT_SCRIPT_RED_HAT + initdir = $(sysconfdir)/rc.d/init.d + init_SCRIPTS = $(top_srcdir)/data/spice-vdagentd +@@ -83,7 +80,6 @@ EXTRA_DIST = \ + README.RHEL-5 \ + data/70-spice-vdagentd.rules \ + data/modules-load.d/spice-vdagentd.conf \ +- data/rsyslog.d/spice-vdagentd.conf \ + data/spice-vdagent.desktop \ + data/spice-vdagentd \ + data/spice-vdagentd.service \ +diff --git a/data/rsyslog.d/spice-vdagentd.conf b/data/rsyslog.d/spice-vdagentd.conf +deleted file mode 100644 +index 2437ba0..0000000 +--- a/data/rsyslog.d/spice-vdagentd.conf ++++ /dev/null +@@ -1,4 +0,0 @@ +-# A template to for higher precision timestamps + severity logging +-$template SpiceTmpl,"%TIMESTAMP%.%TIMESTAMP:::date-subseconds% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +- +-:programname, startswith, "spice-vdagent" /var/log/spice-vdagent.log;SpiceTmpl diff --git a/SPECS/spice-vdagent.spec b/SPECS/spice-vdagent.spec index 10f7d89..810485b 100644 --- a/SPECS/spice-vdagent.spec +++ b/SPECS/spice-vdagent.spec @@ -1,17 +1,28 @@ Name: spice-vdagent Version: 0.14.0 -Release: 7%{?dist} +Release: 9%{?dist} Summary: Agent for Spice guests Group: Applications/System License: GPLv3+ URL: http://spice-space.org/ Source0: http://spice-space.org/download/releases/%{name}-%{version}.tar.bz2 # Fixes from upstream git -Patch1: 0001-vdagent-d-Add-printing-of-version-to-h-output.patch -Patch2: 0002-vdagentd-Advertise-VD_AGENT_CAP_GUEST_LINEEND_LF.patch -Patch3: 0003-buildsys-Build-vdagentd-as-pie-relro-when-possible.patch -Patch4: 0004-Not-having-the-virtio-channel-is-not-an-error-instea.patch -Patch5: 0005-vdagent-x11-Release-clipboard-on-client-disconnect-i.patch +Patch1: 0001-vdagent-d-Add-printing-of-version-to-h-output.patch +Patch2: 0002-vdagentd-Advertise-VD_AGENT_CAP_GUEST_LINEEND_LF.patch +Patch3: 0003-buildsys-Build-vdagentd-as-pie-relro-when-possible.patch +Patch4: 0004-Not-having-the-virtio-channel-is-not-an-error-instea.patch +Patch5: 0005-vdagent-x11-Release-clipboard-on-client-disconnect-i.patch +#This patch is in the RHEL6 build but omitted on purpose from the RHEL7 +#build, see https://bugzilla.redhat.com/show_bug.cgi?id=1131454#c2 for +#details +#Patch6: 0006-randr-set-physical-screen-size-to-keep-a-constant-96.patch +Patch7: 0007-clipboard-target_to_type-fix-inner-loop-variable-nam.patch +Patch8: 0008-Reply-to-TIMESTAMP-requests.patch +Patch9: 0009-Handle-STRING-selection-type.patch +Patch10: 0010-randr-Make-resolution-changing-more-robust.patch +Patch11: 0011-Don-t-abort-if-XRRSetCrtcConfig-fails.patch +Patch12: 0012-Fix-gdm-autostart-path.patch +Patch13: 0013-data-remove-rsyslog-config-files.patch BuildRequires: systemd-devel glib2-devel spice-protocol >= 0.12.6 BuildRequires: libpciaccess-devel libXrandr-devel libXinerama-devel BuildRequires: libXfixes-devel systemd-units desktop-file-utils libtool @@ -39,6 +50,13 @@ Features: %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 autoreconf -fi @@ -65,7 +83,6 @@ rm $RPM_BUILD_ROOT%{_sysconfdir}/modules-load.d/spice-vdagentd.conf %files %doc COPYING ChangeLog README TODO -%config(noreplace) %{_sysconfdir}/rsyslog.d/spice-vdagentd.conf /lib/udev/rules.d/70-spice-vdagentd.rules %{_unitdir}/spice-vdagentd.service %{_unitdir}/spice-vdagentd.target @@ -81,6 +98,20 @@ rm $RPM_BUILD_ROOT%{_sysconfdir}/modules-load.d/spice-vdagentd.conf %changelog +* Tue Sep 23 2014 Christophe Fergeau 0.14.0-9 +- Don't install rsyslog config file. This can cause duplicate logging + to syslog in rhel6->rhel7 upgrades, and is not really useful anyway + as the same functionality can be achieved with journald + Resolves: rhbz#1136881 + +* Tue Aug 19 2014 Christophe Fergeau 0.14.0-8 +- Fix copy and paste issues with vncclient + Resolves: rhbz#1130218 +- Make vdagent more robust against xrandr failures + Resolves: rhbz#1066422 +- Fix autostart of vdagent in gdm + Resolves: rhbz#1052172 + * Fri Jan 24 2014 Daniel Mach - 0.14.0-7 - Mass rebuild 2014-01-24