[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 4/4] xenconfig: fix spice mousemode and copypaste



2015-05-09 0:00 GMT+02:00 Jim Fehlig <jfehlig@xxxxxxxx>:
From xl.cfg950 man page:

spiceagent_mouse=BOOLEAN
Whether SPICE agent is used for client mouse mode. The default is
true (1) (turn on)

spicevdagent=BOOLEAN
Enables spice vdagent. The Spice vdagent is an optional component for
enhancing user experience and performing guest-oriented management
tasks. Its features includes: client mouse mode (no need to grab
mouse by client, no mouse lag), automatic adjustment of screen
resolution, copy and paste (text and image) between client and domU.
It also requires vdagent service installed on domU o.s. to work.
The default is 0.

spice_clipboard_sharing=BOOLEAN
Enables Spice clipboard sharing (copy/paste). It requires spicevdagent
enabled. The default is false (0).

So if spiceagent_mouse is enabled (client mouse mode) or
spice_clipboard_sharing is enabled, spicevdagent must be enabled.
Along with this change, s/spicedvagent/spicevdagent, set
spiceagent_mouse correctly, and add a test for these spice
features.

Thanks for your work in libvirt about improve/fix support for xen with spice.
From a fast look to code seems there is spice usbredirection support missed, a feature that I think very useful:
http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=f5414ee57a17500e650ea11766474b11da940da2
And also another important that you already know and accepted today:
http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=161212ef02312c0681d2d809c8ff1e1f0ea6f6f9
Latest version have also LIBXL_HAVE_QXL useful for libvirt.
I think is good add also qxl and usbredir to spice-features test or create a new one "full features".

Â

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
Âsrc/xenconfig/xen_xl.c          Â| 56 ++++++++++++++++++++++--------
Âtests/xlconfigdata/test-spice-features.cfg | 32 +++++++++++++++++
Âtests/xlconfigdata/test-spice-features.xml | 48 +++++++++++++++++++++++++
Âtests/xlconfigdata/test-spice.xml     | 2 ++
Âtests/xlconfigtest.c           Â| 1 +
Â5 files changed, 124 insertions(+), 15 deletions(-)

diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c
index 2e9294c..b54d5b0 100644
--- a/src/xenconfig/xen_xl.c
+++ b/src/xenconfig/xen_xl.c
@@ -199,17 +199,23 @@ xenParseXLSpice(virConfPtr conf, virDomainDefPtr def)
      Â}

      Âif (xenConfigGetBool(conf, "spiceagent_mouse",
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â&graphics->data.spice.mousemode, 0) < 0)
-Â Â Â Â Â Â Â Â goto cleanup;
-Â Â Â Â Â Â if (xenConfigGetBool(conf, "spicedvagent", &val, 0) < 0)
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â&val, 0) < 0)
        Âgoto cleanup;
      Âif (val) {
-Â Â Â Â Â Â Â Â if (xenConfigGetBool(conf, "spice_clipboard_sharing",
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â&graphics->data.spice.copypaste,
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â0) < 0)
-Â Â Â Â Â Â Â Â Â Â goto cleanup;
+Â Â Â Â Â Â Â Â graphics->data.spice.mousemode =
+Â Â Â Â Â Â Â Â Â Â VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_CLIENT;
+Â Â Â Â Â Â } else {
+Â Â Â Â Â Â Â Â graphics->data.spice.mousemode =
+Â Â Â Â Â Â Â Â Â Â VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER;
      Â}

+Â Â Â Â Â Â if (xenConfigGetBool(conf, "spice_clipboard_sharing", &val, 0) < 0)
+Â Â Â Â Â Â Â Â goto cleanup;
+Â Â Â Â Â Â if (val)
+Â Â Â Â Â Â Â Â graphics->data.spice.copypaste = VIR_TRISTATE_BOOL_YES;
+Â Â Â Â Â Â else
+Â Â Â Â Â Â Â Â graphics->data.spice.copypaste = VIR_TRISTATE_BOOL_NO;
+
      Âif (VIR_ALLOC_N(def->graphics, 1) < 0)
        Âgoto cleanup;
      Âdef->graphics[0] = graphics;
@@ -708,16 +714,36 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
          Âreturn -1;
      Â}

-Â Â Â Â Â Â if (xenConfigSetInt(conf, "spiceagent_mouse",
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â graphics->data.spice.mousemode) < 0)
-Â Â Â Â Â Â Â Â return -1;
+Â Â Â Â Â Â if (graphics->data.spice.mousemode) {
+Â Â Â Â Â Â Â Â switch (graphics->data.spice.mousemode) {
+Â Â Â Â Â Â Â Â case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER:
+Â Â Â Â Â Â Â Â Â Â if (xenConfigSetInt(conf, "spiceagent_mouse", 0) < 0)
+Â Â Â Â Â Â Â Â Â Â Â Â return -1;
+Â Â Â Â Â Â Â Â Â Â break;
+Â Â Â Â Â Â Â Â case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_CLIENT:
+Â Â Â Â Â Â Â Â Â Â if (xenConfigSetInt(conf, "spiceagent_mouse", 1) < 0)
+Â Â Â Â Â Â Â Â Â Â Â Â return -1;
+Â Â Â Â Â Â Â Â Â Â /*
+Â Â Â Â Â Â Â Â Â Â Â* spicevdagent must be enabled if using client
+Â Â Â Â Â Â Â Â Â Â Â* mode mouse
+Â Â Â Â Â Â Â Â Â Â Â*/
+Â Â Â Â Â Â Â Â Â Â if (xenConfigSetInt(conf, "spicevdagent", 1) < 0)
+Â Â Â Â Â Â Â Â Â Â Â Â return -1;
+Â Â Â Â Â Â Â Â Â Â break;
+Â Â Â Â Â Â Â Â default:
+Â Â Â Â Â Â Â Â Â Â break;
+Â Â Â Â Â Â Â Â }
+Â Â Â Â Â Â }

-Â Â Â Â Â Â if (graphics->data.spice.copypaste) {
-Â Â Â Â Â Â Â Â if (xenConfigSetInt(conf, "spicedvagent", 1) < 0)
+Â Â Â Â Â Â if (graphics->data.spice.copypaste == VIR_TRISTATE_BOOL_YES) {
+Â Â Â Â Â Â Â Â if (xenConfigSetInt(conf, "spice_clipboard_sharing", 1) < 0)
+Â Â Â Â Â Â Â Â Â Â return -1;
+Â Â Â Â Â Â Â Â /*
+Â Â Â Â Â Â Â Â Â* spicevdagent must be enabled if spice_clipboard_sharing
+Â Â Â Â Â Â Â Â Â* is enabled
+Â Â Â Â Â Â Â Â Â*/
+Â Â Â Â Â Â Â Â if (xenConfigSetInt(conf, "spicevdagent", 1) < 0)
          Âreturn -1;
-Â Â Â Â Â Â Â Â if (xenConfigSetInt(conf, "spice_clipboard_sharing",
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â graphics->data.spice.copypaste) < 0)
-Â Â Â Â Â Â Â Â return -1;
      Â}
    Â}
  Â}
diff --git a/tests/xlconfigdata/test-spice-features.cfg b/tests/xlconfigdata/test-spice-features.cfg
new file mode 100644
index 0000000..c3e7111
--- /dev/null
+++ b/tests/xlconfigdata/test-spice-features.cfg
@@ -0,0 +1,32 @@
+name = "XenGuest2"
+uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809"
+maxmem = 579
+memory = 394
+vcpus = 1
+pae = 1
+acpi = 1
+apic = 1
+hap = 0
+viridian = 0
+localtime = 0
+> +> +> +device_model = "/usr/lib/xen/bin/qemu-dm"
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000,type=ioemu" ]
+parallel = "none"
+serial = "none"
+builder = "hvm"
+boot = "d"
+disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
+sdl = 0
+vnc = 0
+spice = 1
+spicehost = "127.0.0.1"
+spiceport = 590
+spicetls_port = 500
+spicedisable_ticketing = 0
+spicepasswd = "thebeast"
+spiceagent_mouse = 1
+spicevdagent = 1
+spice_clipboard_sharing = 1
diff --git a/tests/xlconfigdata/test-spice-features.xml b/tests/xlconfigdata/test-spice-features.xml
new file mode 100644
index 0000000..8f3fcf5
--- /dev/null
+++ b/tests/xlconfigdata/test-spice-features.xml
@@ -0,0 +1,48 @@
+<domain type='xen'>
+Â <name>XenGuest2</name>
+Â <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+Â <memory unit='KiB'>592896</memory>
+Â <currentMemory unit='KiB'>403456</currentMemory>
+Â <vcpu placement='static'>1</vcpu>
+Â <os>
+Â Â <type arch='x86_64' machine='xenfv'>hvm</type>
+Â Â <loader type='rom'>/usr/lib/xen/boot/hvmloader</loader>
+Â Â <boot dev='cdrom'/>
+Â </os>
+Â <features>
+Â Â <acpi/>
+Â Â <apic/>
+Â Â <pae/>
+Â </features>
+Â <clock offset='utc' adjustment='reset'/>
+Â <on_poweroff>destroy</on_poweroff>
+Â <on_reboot>restart</on_reboot>
+Â <on_crash>restart</on_crash>
+Â <devices>
+Â Â <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+Â Â <disk type='block' device='disk'>
+Â Â Â <driver name='phy' type='raw'/>
+Â Â Â <source dev='/dev/HostVG/XenGuest2'/>
+Â Â Â <target dev='hda' bus='ide'/>
+Â Â </disk>
+Â Â <disk type='file' device='cdrom'>
+Â Â Â <driver name='qemu' type='raw'/>
+Â Â Â <source file='/root/boot.iso'/>
+Â Â Â <target dev='hdc' bus='ide'/>
+Â Â Â <readonly/>
+Â Â </disk>
+Â Â <interface type='bridge'>
+Â Â Â <mac address='00:16:3e:66:92:9c'/>
+Â Â Â <source bridge='xenbr1'/>
+Â Â Â <script path='vif-bridge'/>
+Â Â Â <model type='e1000'/>
+Â Â </interface>
+Â Â <input type='mouse' bus='ps2'/>
+Â Â <input type='keyboard' bus='ps2'/>
+Â Â <graphics type='spice' port='590' tlsPort='500' autoport='no' listen='127.0.0.1' passwd='thebeast'>
+Â Â Â <listen type='address' address='127.0.0.1'/>
+Â Â Â <mouse mode='client'/>
+Â Â Â <clipboard copypaste='yes'/>
+Â Â </graphics>
+Â </devices>
+</domain>
diff --git a/tests/xlconfigdata/test-spice.xml b/tests/xlconfigdata/test-spice.xml
index bd004fc..e5b43d9 100644
--- a/tests/xlconfigdata/test-spice.xml
+++ b/tests/xlconfigdata/test-spice.xml
@@ -41,6 +41,8 @@
  Â<input type='keyboard' bus='ps2'/>
  Â<graphics type='spice' port='590' tlsPort='500' autoport='no' listen='127.0.0.1' passwd='thebeast'>
   Â<listen type='address' address='127.0.0.1'/>
+Â Â Â <mouse mode='server'/>
+Â Â Â <clipboard copypaste='no'/>
  Â</graphics>
 Â</devices>
Â</domain>
diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
index 0b47fbb..952b504 100644
--- a/tests/xlconfigtest.c
+++ b/tests/xlconfigtest.c
@@ -195,6 +195,7 @@ mymain(void)

  ÂDO_TEST("new-disk", 3);
  ÂDO_TEST("spice", 3);
+Â Â DO_TEST("spice-features", 3);

Â#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
  ÂDO_TEST("fullvirt-multiusb", 3);
--
1.8.4.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.