RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1365717 - Spice Guest's resolution doesn't update after login the guest
Summary: Spice Guest's resolution doesn't update after login the guest
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: mutter
Version: 8.1
Hardware: x86_64
OS: Unspecified
low
low
Target Milestone: rc
: 8.1
Assignee: Jonas Ådahl
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-10 02:39 UTC by Xiaodai Wang
Modified: 2020-04-28 16:09 UTC (History)
14 users (show)

Fixed In Version: mutter-3.32.2-32.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:08:59 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
debug & spice debug for the issue (43.31 KB, text/plain)
2016-08-10 10:13 UTC, Pavel Grunt
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:1766 0 None None None 2020-04-28 16:09:20 UTC

Description Xiaodai Wang 2016-08-10 02:39:35 UTC
Description of problem:
Spice Guest's resolution doesn't update after login the guest

Version-Release number of selected component (if applicable):
virt-viewer-2.0-11.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a spice guest(I'm using RHEL7) and make sure spice-vdagentd service is running.
2. Open the guest by "virt-viewer -f $guest", then the guest will opened in fullscreen mode and the resolution is updated to adapt real physical monitors resolution.
3. Keep the guest in fullscreen mode, and modify the guest's resolution manually in system settings. For example, set it to 800x600.
4. Close the guest window and destroy the guest.
5. Restart the guest.
6. Open the guest by "virt-viewer -f $guest" and login.

Actual results:
After login, The guest's resolution is not updated to real physical monitors resolution but still keep the value which is set in step3 (800x600).

Expected results:
The guest's resolution should update to real physical monitor's resolution.

Additional info:

Comment 1 Pavel Grunt 2016-08-10 10:13:04 UTC
Created attachment 1189546 [details]
debug & spice debug for the issue

Comment 2 Pavel Grunt 2016-08-10 10:21:16 UTC
From the debug:
(virt-viewer:19659): virt-viewer-DEBUG: Performing full screen auto-conf, 2 host monitors
(virt-viewer:19659): virt-viewer-DEBUG: Set SPICE display 0 to (0,0)-(1920x1080)
(virt-viewer:19659): virt-viewer-DEBUG: Set SPICE display 1 to (1920,0)-(1920x1080)
(virt-viewer:19659): GSpice-DEBUG: channel-main.c:1160 main-1:0: sending new monitors config to guest
(virt-viewer:19659): GSpice-DEBUG: channel-main.c:1177 main-1:0: monitor #0: 1920x1080+0+0 @ 32 bpp
(virt-viewer:19659): GSpice-DEBUG: channel-main.c:1177 main-1:0: monitor #1: 1920x1080+1920+0 @ 32 bpp
....
(virt-viewer:19659): GSpice-DEBUG: channel-display.c:1713 display-2:0: received new monitors config from guest: n: 2/4
(virt-viewer:19659): GSpice-DEBUG: channel-display.c:1733 display-2:0: monitor id: 0, surface id: 0, +0+0-1920x1080
(virt-viewer:19659): GSpice-DEBUG: channel-display.c:1733 display-2:0: monitor id: 1, surface id: 0, +1920+120-1280x960


There is a race, virt-viewer sends correct size request, but the guest also sends its current display config. It is not a regression, mostlikely changes will be required in other spice components. Lets investigate it for 7.4.

Comment 3 David Blechter 2018-12-10 18:00:52 UTC
Moving to rhel 8

Comment 4 David Blechter 2019-04-10 12:01:03 UTC
Take

Comment 5 David Blechter 2019-04-10 12:01:20 UTC
Take

Comment 6 Jonathon Jongsma 2019-05-17 22:16:00 UTC
So, this is in fact caused by a change in mutter. That change happened here:
 - https://gitlab.gnome.org/GNOME/mutter/commit/183f4b0c13f3dc9565bf5f693f2e5d61ca0199c9
 - https://bugzilla.gnome.org/show_bug.cgi?id=783073

Some background:
Some time in the past, spice guest resolution changes were handled by spice-vdagent. The spice client sent a monitor configuration message to the server, the server passed it to the vdagent, and the vdagent used the xrandr APIs to reconfigure the display resolution. This caused problems because there were two different components that could change the guest's display resolution: 1) the desktop environment (responding to hotplug events, resizing due to explicit requests via the control panel) and 2) spice-vdagent (handling spice monitor config messages). These could sometimes interfere with eachother and cause conflicts. Around the time of RHEL7, this was changed so that the spice vdagent no longer had responsibility for changing the resolution of the guest. Instead, monitor configuration messages from spice were handled by passing the message from the spice server directly to the QXL device. The QXL device would then update its preferred mode (resolution) and emit a hotplug event within the guest OS. To support this, the desktop environment (GNOME/mutter) was changed to respond to these hotplug events and resize the guest resolution to match the new preferred mode of the QXL device. In order for this to work properly, It was necessary to make the desktop environment ignore the monitor resolution configuration file (saved in ~/.config/monitors.xml). 

Why was it necessary to bypass the configuration file? Well, this configuration file was designed with the assumption that if the user explicitly configures the resolution for a particular monitor, the user will always want the desktop to be set to this same resolution when using that particular monitor. This assumption works well when we're talking about physical monitors, because they generally have a single specific native resolution. However, the QXL device is quite different than a physical monitor. The "native" resolution of the QXL device will change whenever the spice server sends it a monitor config message (i.e. whenever the user resizes the window of their spice client display). Assuming that the user wants to continue using the previous resolution for this monitor after it has changed size doesn't really make sense, and in fact prevents the automatic resize feature from working at all. The way that the desktop environment (mutter) determines that the device can change size is via the 'hotplug_mode_update" udev property. Therefore, mutter ignored the monitors.xml configuration file whenver we were using a device with 'hotplug_mode_update'.

Sometime in the past year, apparently somebody made a change to this logic and started using the local configuration file for hotplug_mode_update devices, but only when first logging into the desktop (see links mentioned above). Presumably they had a good reason for doing this, but the effect is that it restores the previously-set resolution for this device rather than simply using the 'native' resolution of the device at login. This is not such a big deal when the client is viewing the spice display in windowed mode: the client window simply gets resized. But when the client is viewing the spice display in fullscreen mode, the window can no longer be resized, and so it ends up displaying a scaled up or scaled down version of the desktop.

It is my opinion that the mutter change mentioned above is misguided, and perhaps should be reverted. The bug report that caused the change was justified because they said that the existing behavior "causes the saved monitor settings not to be properly recovered". But it's not obvious to me that we *want* to recover saved monitor settings for monitors (such as the QXL device) that may have a different 'native' resolution based on the size of your client window. It seems a lot friendlier to me to just allow the desktop to always use the preferred resolution rather than trying to restore a previous setting that may not even work well with the monitors of the client machine that you're currently connecting from.

Comment 8 Jonas Ådahl 2020-02-21 16:56:21 UTC
I think your reasoning is valid, and I agree that the patch should be reverted to the previous behavior where VM guests don't load the configuration file on the filesystem.

Comment 13 Radek Duda 2020-02-25 13:41:32 UTC
Hi I am trying to verify this.
The result depends on whether I force reset/shutdown or do not make this forcibly.
a) reset/shutdown guest by force (e.g. virt-manager-> right mouse click->'Shut Down'->'Force *'):
Resolution after boot is set according to the physical monitor resolution of client - so this works ok
(~/.config/monitor.xml file does not exist)

b) reset/shutdown guest (e.g. from within guest):
Display resolution which was set before is preserved across reboot (~/.config/monitor.xml file exists). Resolution even does not change if remote-viewer display area size is modified. IMHO and my research, the only cure for such a state (when resolution of guest is not set according to remote-viewer display area size) is to delete '~/config/monitor.xml' file and reboot guest.

Given b), I can not verify this.

tested with:
guest (rhel8.2):
mutter-3.32.2-33.el8
xorg-x11-drv-qxl-0.1.5-11.el8.x86_64
spice-vdagent-0.19.0-3.el8.x86_64

client/host (rhel8.2):
spice-gtk3-0.37-1.el8.x86_64
spice-server-0.14.2-1.el8.x86_64

Comment 14 Tomas Pelka 2020-02-27 15:23:48 UTC
(In reply to Radek Duda from comment #13)
> Hi I am trying to verify this.
> The result depends on whether I force reset/shutdown or do not make this
> forcibly.
> a) reset/shutdown guest by force (e.g. virt-manager-> right mouse
> click->'Shut Down'->'Force *'):
> Resolution after boot is set according to the physical monitor resolution of
> client - so this works ok
> (~/.config/monitor.xml file does not exist)
> 
> b) reset/shutdown guest (e.g. from within guest):
> Display resolution which was set before is preserved across reboot
> (~/.config/monitor.xml file exists). Resolution even does not change if
> remote-viewer display area size is modified. IMHO and my research, the only
> cure for such a state (when resolution of guest is not set according to
> remote-viewer display area size) is to delete '~/config/monitor.xml' file
> and reboot guest.
> 
> Given b), I can not verify this.
> 
> tested with:
> guest (rhel8.2):
> mutter-3.32.2-33.el8
> xorg-x11-drv-qxl-0.1.5-11.el8.x86_64
> spice-vdagent-0.19.0-3.el8.x86_64
> 
> client/host (rhel8.2):
> spice-gtk3-0.37-1.el8.x86_64
> spice-server-0.14.2-1.el8.x86_64

Radku do you think this is a blocking issue, meaning it need to be fully fixed in 8.2? Or can we move to 8.3?

Comment 15 Radek Duda 2020-02-28 09:35:11 UTC
We can move this to 8.3

Comment 16 Tomas Pelka 2020-02-28 09:40:13 UTC
(In reply to Radek Duda from comment #15)
> We can move this to 8.3

OK moving to verified (partially) and cloning for 8.3.

Comment 18 errata-xmlrpc 2020-04-28 16:08:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1766


Note You need to log in before you can comment on or make changes to this bug.