|
|
4e1899 |
From 96c00ebf666e044d0b53ad569dde3c24ce7b9b4d Mon Sep 17 00:00:00 2001
|
|
|
4e1899 |
From: Jonathon Jongsma <jjongsma@redhat.com>
|
|
|
4e1899 |
Date: Thu, 19 Dec 2013 11:31:21 -0600
|
|
|
4e1899 |
Subject: [PATCH] Don't abort if XRRSetCrtcConfig fails
|
|
|
4e1899 |
|
|
|
4e1899 |
In certain configurations (Fedora 20 or RHEL7 guests on a RHEL6 host), this call
|
|
|
4e1899 |
fails, which cause the vdagent to abort. This patch prevents the crash, though
|
|
|
4e1899 |
arbitrary resizing is obviously still non-functional in this situation.
|
|
|
4e1899 |
|
|
|
4e1899 |
https://bugzilla.redhat.com/show_bug.cgi?id=1066422
|
|
|
4e1899 |
(cherry picked from commit 6e2e82e6fbb8927d5154f32c83e2b95c08fef18e)
|
|
|
4e1899 |
---
|
|
|
4e1899 |
src/vdagent-x11-randr.c | 4 ++--
|
|
|
4e1899 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
4e1899 |
|
|
|
4e1899 |
diff --git a/src/vdagent-x11-randr.c b/src/vdagent-x11-randr.c
|
|
|
4e1899 |
index b1f9813..46367bc 100644
|
|
|
4e1899 |
--- a/src/vdagent-x11-randr.c
|
|
|
4e1899 |
+++ b/src/vdagent-x11-randr.c
|
|
|
4e1899 |
@@ -366,11 +366,11 @@ static int xrandr_add_and_set(struct vdagent_x11 *x11, int output, int x, int y,
|
|
|
4e1899 |
x11->randr.monitor_sizes[output].width = width;
|
|
|
4e1899 |
x11->randr.monitor_sizes[output].height = height;
|
|
|
4e1899 |
outputs[0] = xid;
|
|
|
4e1899 |
+ vdagent_x11_set_error_handler(x11, error_handler);
|
|
|
4e1899 |
s = XRRSetCrtcConfig(x11->display, x11->randr.res, x11->randr.res->crtcs[output],
|
|
|
4e1899 |
CurrentTime, x, y, mode->id, RR_Rotate_0, outputs,
|
|
|
4e1899 |
1);
|
|
|
4e1899 |
-
|
|
|
4e1899 |
- if (s != RRSetConfigSuccess) {
|
|
|
4e1899 |
+ if (vdagent_x11_restore_error_handler(x11) || (s != RRSetConfigSuccess)) {
|
|
|
4e1899 |
syslog(LOG_ERR, "failed to XRRSetCrtcConfig");
|
|
|
4e1899 |
x11->set_crtc_config_not_functional = 1;
|
|
|
4e1899 |
return 0;
|