[Spice-devel] Bug62033 Add support for --spice-disable-effects client option to spice-vdagent on Linux guests with Gnome3

Fedor Lyakhov fedor.lyakhov at gmail.com
Sun Jul 28 13:43:22 PDT 2013


Hi,

Bug62033 is a request by Gnome3 developers. They need means to detect
that spice client runs locally so they shouldn't disable any desktop
effects on the guest running Gnome3. On the other hand, for slow
remote connections, they want to disable the effects.

My solution approaches the question from another side: allow user to
decide whether he needs the effects or not. Sure, he can configure the
guest manually as he wants, but it isn't very convenient.

The user interface for this task already exists in Spice GTK client,
this is CLI option '--spice-disable-effects=<wallpaper, font-smooth,
animation, all>. Right now this options works for Windows guest only.
In next patch series I add following:
0001. Unrelated small fix
0002. Announce capabilities of Display Config in spice-vdagentd system
daemon, handle Display Config message in spice-vdagentd - send it to
spice-vdagent session daemon
0003. Handle Display Config message in spice-vdagent - implementation
uses GSettings API from GIO 2.26+; at run-time: xsettings plugin for
gnome-settings-manager should be installed and enabled - otherwise
font smooth won't be affected.
Better implementation with g_settings_get_range() introspection to get
enum nicks requires GIO 2.28+ - I need approval on this.

Please note patches 2, 3 are for review mostly, the feature isn't
complete yet: user doesn't have convenient means to restore the
effects once they're disabled. I see 2 potential solutions (better
ideas are welcome!):

(i) Introduce '--spice-reset-effects' option.
We don't want to change protocol, and there is one possibility to
explore - send Display Config with empty flags to indicate the reset
is required.
Right now Display Config is sent regardles of --spice-reset-effects
and --spice-color-depth options - i.e. empty one is sent when the
options aren't set. I want to make this empty Display Config to be
sent only when --spice-reset-effects option is enabled (need to check
whether this is acceptable at Windows agent). I've added handling code
of this case to vdagent: reset all the settings we change to default
(it is commented out for now). There are following limitations I know
about:
1. Inability to set color depth and reset effects in one connection
(not that bad - reset can be done once, then re-connect with desired
color depth; also color depth change isn't supported on Linux guests
yet)
2. If new flags are added to Display Config, all them need to be
treated the same way, i.e. reset should reset them all (there can be
only 1 reset message, flags=0).

(ii) Make vdagent stateful - remember that previous connection was
disabling some effects, and if current one isn't disabling these
effects, reset them. No need for '--spice-reset-effects' option in
this case. We can even remember previous states of effects and restore
them instead of resetting them to default. This seems to be the most
user-friendly approach, but it is harder to implement. If this
approach is selected, I see implementation via GSettings (afaik there
is no config for vdagent right now, correct?)

Testing
I've got few test cases for new feature:
1.1. Test --spice-disable-effects=wallpaper on default Gnome3 guest
Steps:
* Start VM
* Connect Spice client with --spice-disable-effects set
* Log in Gnome3 session
Observe:
* Desktop background is of default color (bright blue)
* In dconf-editor:
picture-options='none'
color-shading-type='solid'
primary-color=<default>
secondary-color=<default>

1.2. Test --spice-disable-effects=wallpaper on Gnome3 guest with
selected color background
Steps: Test1.1, then
* System settings -> Background -> Click on image -> Color, select a color
Observe:
* Desktop background is of selected color (probably with texture)
* In dconf-editor:
primary-color=selected color
secondary-color=selected color
Steps:
* Re-connect
Observe:
* Desktop background is of selected color without textures
* In dconf-editor:
picture-options='none'
color-shading-type='solid'
primary-color=selected color
secondary-color=selected color
Steps:
* Restart the VM, login again
Observe: same as above.

1.3. Test --spice-disable-effects=wallpaper on Gnome3 guest with
selected wallpaper
Steps: Test1.1, then
* System Settings -> Background -> Click on image -> select a wallpaper
Observe:
* Desktop background is of selected wallpaper
* In dconf-editor (may be specific of Gnome 3.6 at Fedora 18):
primary-color=#ffffff
secondary-color=#000000
Steps:
* Re-connect
Observe:
* Desktop background is of default color (bright blue)
* In dconf-editor:
picture-options='none'
color-shading-type='solid'
primary-color=<default>
secondary-color=<default>
Steps:
* Restart the VM, login again
Observe: same as above.

1.4. Test without --spice-disable-effects on Gnome3 guest
Steps: Test1.1, then
* Connect without option
Observe: same as Test1.1
Steps:
* Change background to wallpaper
* Re-connect without option
Observe:
* Desktop background is selected wallpaper

2.1. Test with --spice-disable-effects=font-smooth on default Gnome3 guest
Steps: Test1.1
Observe:
* Fonts aren't anti-aliased and only slightly hinted (so still readable)
* In dconf-editor:
antialiasing='none'
hinting='slight'

2.2.  Test with --spice-disable-effects=font-smooth on changed Gnome3 guest
Steps: Test2.1, then
* In dconf-editor change antialiasing and hinting to max values
* Re-connect
Observe: as in Test2.1

2.3 Test without --spice-disable-effects on Gnome3 guest
Steps: Test2.1
Observe: Test2.1
Steps:
* In dconf-editor change antialiasing and hinting to max values
* Re-connect
Observe:
* Antialiased and hinted fonts
* In dconf-editor antialiasing and hinting as was set

3.1-3 Test with --spice-disable-effects=animation - as 2.1-3, just
another setting in dconf-editor: enable-animations.

4. Test with --spice-disable-effects=all - as 1.1-4, 2.1-3, but for
all these settings combined.

5. Test with --spice-disable-effects=all on NON-Gnome3 guests
Observe: no effect, but spice-agent works normally

My test infrastructure includes:
PC-1 Dell XPS L502X laptop (CPU Core i7 2630QM 2GHz)
Host-1: OpenSUSE 12.3 x86_64 KDE
qemu 1.3.1
spice-server 0.12.0
spicy 0.14

Guest-1.1: Fedora 18 x86 Gnome 3.6
xorg-x11-drv-qxl 0.1.0
spice-agent - latest from Git with the fix applied

Guest-1.2: OpenSUSE 12.3 x86 KDE

PC-2 CPU Core i3 3.3GHz
Host-2: CentOS 6.4 x86_64 Gnome2
Guest-2.1: Fedora 18 x86 KDE, Gnome 3.6, XFce

Client-1 = Host-1
Client-2 = Windows 7 at PC-1, remote-viewer
Client-3 = Windows XP at PC-2, remote-viewer

So far I've run the tests in following environment:
Client-1 | Guest-1.1

Also I'm going to test final feature version in other environments as well:
Client-1 | Guest-1.2
Client-2 | Guest-2.1

If you want me to run other tests and combinations, please ask here.
Note1: Fedora 19 with Spice graphics at Host-1 crashes at startup,
haven't tried at Host-2.
Note2: I've got 100% reproducible crash at Host-1 Guest1.1: qemu
crashes in following scenario1:
1. Start VM, connect with Spice client, open System
settings->Background, select new background [or just open
dconf-editor], close it
2. Re-connect client
3. Open System settings->Background->select background [or open
dconf-editor] -> VM crashes
Scenario2:
1. Start VM, connect with Spice client, open System
settings->Background->select new background (do not close the window)
2. Re-connect client -> VM crashes
It seems to be unrelated to my changes though, because it is
reproducible even without vdagentd/vdagent running. Does anybody know
whether it is
already reported?

Documenting
I'm willing to write a documentation (e.g. wiki page) about this whole
feature if needed/appropriate.

After completing the feature for Gnome3, my next steps would be adding
support for KDE4. Then maybe Xfce as it is really popular as well.

-- 
Best regards,
Fedor


More information about the Spice-devel mailing list