Skip to contentSkip to conversation

xenconfig: use local variable for graphics def

PATCH In review Jim Fehlig 3 participants 9 messages May 8, 2015 – May 18, 2015 3 messages not in the archive

lore
Share & tools
lore

Jim Fehlig

author
#1 lore raw

PATCH 1/4 xenconfig: use local variable for graphics def

In reply to a message not in the archive

'graphics->' is a bit easier to read and type, and makes for shorter lines than 'def->graphics[0]->'.

---
 src/xenconfig/xen_xl.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
src/xenconfig/xen_xl.c +13 -10
index db554b2..bfd6d6b 100644
@@ -667,9 +667,12 @@ static int
 xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
 {
     const char *listenAddr = NULL;
+    virDomainGraphicsDefPtr graphics;
 
     if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
-        if (def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
+        graphics = def->graphics[0];
+
+        if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
             /* set others to false but may not be necessary */
             if (xenConfigSetInt(conf, "sdl", 0) < 0)
                 return -1;
@@ -681,37 +684,37 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
                 return -1;
 
             if (xenConfigSetInt(conf, "spiceport",
-                                def->graphics[0]->data.spice.port) < 0)
+                                graphics->data.spice.port) < 0)
                 return -1;
 
             if (xenConfigSetInt(conf, "spicetls_port",
-                                def->graphics[0]->data.spice.tlsPort) < 0)
+                                graphics->data.spice.tlsPort) < 0)
                 return -1;
 
-            if (def->graphics[0]->data.spice.auth.passwd) {
+            if (graphics->data.spice.auth.passwd) {
                 if (xenConfigSetInt(conf, "spicedisable_ticketing", 1) < 0)
                     return -1;
 
-                if (def->graphics[0]->data.spice.auth.passwd &&
+                if (graphics->data.spice.auth.passwd &&
                     xenConfigSetString(conf, "spicepasswd",
-                                def->graphics[0]->data.spice.auth.passwd) < 0)
+                                graphics->data.spice.auth.passwd) < 0)
                     return -1;
             }
 
-            listenAddr = virDomainGraphicsListenGetAddress(def->graphics[0], 0);
+            listenAddr = virDomainGraphicsListenGetAddress(graphics, 0);
             if (listenAddr &&
                 xenConfigSetString(conf, "spicehost", listenAddr) < 0)
                 return -1;
 
             if (xenConfigSetInt(conf, "spiceagent_mouse",
-                                def->graphics[0]->data.spice.mousemode) < 0)
+                                graphics->data.spice.mousemode) < 0)
                 return -1;
 
-            if (def->graphics[0]->data.spice.copypaste) {
+            if (graphics->data.spice.copypaste) {
                 if (xenConfigSetInt(conf, "spicedvagent", 1) < 0)
                     return -1;
                 if (xenConfigSetInt(conf, "spice_clipboard_sharing",
-                                def->graphics[0]->data.spice.copypaste) < 0)
+                                graphics->data.spice.copypaste) < 0)
                 return -1;
             }
         }
Signature · 1 line
1.8.4.5
author
#2 lore raw

PATCH 2/4 xenconfig: format spice listenAddr when formating ports

In reply to a message not in the archive

Move formating of spice listenAddr to the section of code where spice ports are formatted. It is more logical to format address and ports together. Account for the change in spice cfg test file by moving 'spicehost'.

---
 src/xenconfig/xen_xl.c            | 10 +++++-----
 tests/xlconfigdata/test-spice.cfg |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
src/xenconfig/xen_xl.c +5 -5
index bfd6d6b..7f3cd89 100644
@@ -683,6 +683,11 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
             if (xenConfigSetInt(conf, "spice", 1) < 0)
                 return -1;
 
+            listenAddr = virDomainGraphicsListenGetAddress(graphics, 0);
+            if (listenAddr &&
+                xenConfigSetString(conf, "spicehost", listenAddr) < 0)
+                return -1;
+
             if (xenConfigSetInt(conf, "spiceport",
                                 graphics->data.spice.port) < 0)
                 return -1;
@@ -701,11 +706,6 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
                     return -1;
             }
 
-            listenAddr = virDomainGraphicsListenGetAddress(graphics, 0);
-            if (listenAddr &&
-                xenConfigSetString(conf, "spicehost", listenAddr) < 0)
-                return -1;
-
             if (xenConfigSetInt(conf, "spiceagent_mouse",
                                 graphics->data.spice.mousemode) < 0)
                 return -1;
tests/xlconfigdata/test-spice.cfg +1 -1
index 21f0e55..b2b9742 100644
@@ -22,9 +22,9 @@ disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,
 sdl = 0
 vnc = 0
 spice = 1
+spicehost = "127.0.0.1"
 spiceport = 590
 spicetls_port = 500
 spicedisable_ticketing = 1
 spicepasswd = "thebeast"
-spicehost = "127.0.0.1"
 spiceagent_mouse = 0
Signature · 1 line
1.8.4.5
author
#3 lore raw

PATCH 3/4 xenconfig: fix spicepasswd handling

In reply to a message not in the archive

The logic related to spicedisable_ticketing and spicepasswd was inverted. As per man xl.cfg(5), 'spicedisable_ticketing = 1' means no passwd is required. On the other hand, a passwd is required if 'spicedisable_ticketing = 0'. Fix the logic and produce and error if 'spicedisable_ticketing = 0' but spicepasswd is not provided. Also fix the spice cfg test file.

---
 src/xenconfig/xen_xl.c            | 18 ++++++++++--------
 tests/xlconfigdata/test-spice.cfg |  2 +-
 2 files changed, 11 insertions(+), 9 deletions(-)
src/xenconfig/xen_xl.c +10 -8
index 7f3cd89..2e9294c 100644
@@ -192,9 +192,9 @@ xenParseXLSpice(virConfPtr conf, virDomainDefPtr def)
 
             if (xenConfigGetBool(conf, "spicedisable_ticketing", &val, 0) < 0)
                 goto cleanup;
-            if (val) {
-                if (xenConfigCopyStringOpt(conf, "spicepasswd",
-                                           &graphics->data.spice.auth.passwd) < 0)
+            if (!val) {
+                if (xenConfigCopyString(conf, "spicepasswd",
+                                        &graphics->data.spice.auth.passwd) < 0)
                     goto cleanup;
             }
 
@@ -697,13 +697,15 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
                 return -1;
 
             if (graphics->data.spice.auth.passwd) {
+                if (xenConfigSetInt(conf, "spicedisable_ticketing", 0) < 0)
+                    return -1;
+
+                if (xenConfigSetString(conf, "spicepasswd",
+                                       graphics->data.spice.auth.passwd) < 0)
+                    return -1;
+            } else {
                 if (xenConfigSetInt(conf, "spicedisable_ticketing", 1) < 0)
                     return -1;
-
-                if (graphics->data.spice.auth.passwd &&
-                    xenConfigSetString(conf, "spicepasswd",
-                                graphics->data.spice.auth.passwd) < 0)
-                    return -1;
             }
 
             if (xenConfigSetInt(conf, "spiceagent_mouse",
tests/xlconfigdata/test-spice.cfg +1 -1
index b2b9742..d89f2ba 100644
@@ -25,6 +25,6 @@ spice = 1
 spicehost = "127.0.0.1"
 spiceport = 590
 spicetls_port = 500
-spicedisable_ticketing = 1
+spicedisable_ticketing = 0
 spicepasswd = "thebeast"
 spiceagent_mouse = 0
Signature · 1 line
1.8.4.5
author
#4 lore raw

PATCH 4/4 xenconfig: fix spice mousemode and copypaste

In reply to a message not in the archive
Quoted 1 line

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.

---
 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(-)
src/xenconfig/xen_xl.c +41 -15
index 2e9294c..b54d5b0 100644
@@ -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;
             }
         }
     }
tests/xlconfigdata/test-spice-features.cfg new file +32 -0
new file mode 100644
index 0000000..c3e7111
@@ -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
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+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
tests/xlconfigdata/test-spice-features.xml new file +48 -0

48 lines not on this page · raw message

tests/xlconfigdata/test-spice.xml +2 -0
index bd004fc..e5b43d9 100644
@@ -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>
tests/xlconfigtest.c +1 -0
index 0b47fbb..952b504 100644
@@ -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);
Signature · 1 line
1.8.4.5
#5 lore raw

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

2015-05-09 0:00 GMT+02:00 Jim Fehlig <[email protected]>:

Quoted 19 lines

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).

Quoted 6 lines

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.

Quoted 1 line

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
There are also other spice settings added for xen 4.6 (image compression and streaming video):
http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=bd71555985efc423b1a119b6a3177de855763453
http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=296c7f3284efe655d95a8ae045a5dc1a20d6fff0
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".

Quoted 223 lines
---
 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(-)
src/xenconfig/xen_xl.c +13 -7
index 2e9294c..b54d5b0 100644
@@ -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;
src/xenconfig/xen_xl.c +28 -8
@@ -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;
             }
         }
     }
tests/xlconfigdata/test-spice-features.cfg new file +16 -0
new file mode 100644
index 0000000..c3e7111
@@ -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
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+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" ]

tests/xlconfigdata/test-spice-features.cfg new file +5 -0
+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" ]

tests/xlconfigdata/test-spice-features.cfg new file +11 -0
+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
tests/xlconfigdata/test-spice-features.xml new file +42 -0
new file mode 100644
index 0000000..8f3fcf5
@@ -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'>

tests/xlconfigdata/test-spice-features.xml new file +6 -0
+      <listen type='address' address='127.0.0.1'/>
+      <mouse mode='client'/>
+      <clipboard copypaste='yes'/>
+    </graphics>
+  </devices>
+</domain>
tests/xlconfigdata/test-spice.xml +0 -0
index bd004fc..e5b43d9 100644
@@ -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'/>
tests/xlconfigdata/test-spice.xml +2 -0
+      <mouse mode='server'/>
+      <clipboard copypaste='no'/>
     </graphics>
   </devices>
 </domain>
tests/xlconfigtest.c +1 -1
index 0b47fbb..952b504 100644
@@ -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

Quoted 5 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#6 lore raw

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

Quoted 29 lines · Fabio Fantoni

2015-05-09 0:00 GMT+02:00 Jim Fehlig <[email protected] <mailto:[email protected]>>:

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.

Quoted 9 lines

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
There are also other spice settings added for xen 4.6 (image compression and streaming video):
http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=bd71555985efc423b1a119b6a3177de855763453
http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=296c7f3284efe655d95a8ae045a5dc1a20d6fff0

Right, but those can be added in a follow-up patch. To ease review, I avoided adding support for all features in this patch.

Quoted 3 lines

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.

Yes.

Quoted 2 lines

I think is good add also qxl and usbredir to spice-features test or create a new one "full features".

Agreed. A new test can be added when implementing the addition features in a follow-up. Do you have any interest in working on a libvirt patch for these features?

Regards,
Jim

#8 lore raw

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

In reply to a message not in the archive

Il 09/05/2015 00:40, Jim Fehlig ha scritto:

Quoted 45 lines
Quoted 29 lines · Fabio Fantoni

2015-05-09 0:00 GMT+02:00 Jim Fehlig <[email protected] <mailto:[email protected]>>:

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.

Quoted 9 lines

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
There are also other spice settings added for xen 4.6 (image compression and streaming video):
http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=bd71555985efc423b1a119b6a3177de855763453
http://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=296c7f3284efe655d95a8ae045a5dc1a20d6fff0

Right, but those can be added in a follow-up patch. To ease review, I avoided adding support for all features in this patch.

Quoted 3 lines

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.

Quoted 7 lines

Yes.

Quoted 2 lines

I think is good add also qxl and usbredir to spice-features test or create a new one "full features".

Agreed. A new test can be added when implementing the addition features in a follow-up. Do you have any interest in working on a libvirt patch for these features?

I don't have experience in libvirt and I don't use it on xen server.
I'm trying to improve xen hvm domUs performance and features (not only for hvm) even if probably I don't have enoght knowledge and time to do everything :(
I used libvirt only in fast kvm tests and I saw that with kvm have already support for spice usbredir, image compression and streaming options but I probably not able to implement the same options for xen too fast and in a good and complete way.

Quoted 4 lines

Regards,
Jim

#9 lore raw

Re: [libvirt] [PATCH 0/4] xenconfig: fix SPICE parsing/formatting

In reply to a message not in the archive
Quoted 11 lines · Jim Fehlig

This series fixes several bugs related to SPICE parsing and formatting code in xenconfig. The bugs are mostly due to misinterpretation of the Xen documenation, which I failed to notice when reviewing the initial submission.

Jim Fehlig (4):
xenconfig: use local variable for graphics def
xenconfig: format spice listenAddr when formating ports
xenconfig: fix spicepasswd handling
xenconfig: fix spice mousemode and copypaste

Quoted 10 lines
 src/xenconfig/xen_xl.c                     | 95 ++++++++++++++++++++----------
 tests/xlconfigdata/test-spice-features.cfg | 32 ++++++++++
 tests/xlconfigdata/test-spice-features.xml | 48 +++++++++++++++
 tests/xlconfigdata/test-spice.cfg          |  4 +-
 tests/xlconfigdata/test-spice.xml          |  2 +
 tests/xlconfigtest.c                       |  1 +
 6 files changed, 148 insertions(+), 34 deletions(-)
 create mode 100644 tests/xlconfigdata/test-spice-features.cfg
 create mode 100644 tests/xlconfigdata/test-spice-features.xml

ACK series

Michal

author
#11 lore raw

Re: [libvirt] [PATCH 0/4] xenconfig: fix SPICE parsing/formatting

In reply to a message not in the archive
Quoted 22 lines · Michal Privoznik
Quoted 18 lines · Jim Fehlig

This series fixes several bugs related to SPICE parsing and formatting code in xenconfig. The bugs are mostly due to misinterpretation of the Xen documenation, which I failed to notice when reviewing the initial submission.

Jim Fehlig (4):
xenconfig: use local variable for graphics def
xenconfig: format spice listenAddr when formating ports
xenconfig: fix spicepasswd handling
xenconfig: fix spice mousemode and copypaste

  src/xenconfig/xen_xl.c                     | 95 ++++++++++++++++++++----------
  tests/xlconfigdata/test-spice-features.cfg | 32 ++++++++++
  tests/xlconfigdata/test-spice-features.xml | 48 +++++++++++++++
  tests/xlconfigdata/test-spice.cfg          |  4 +-
  tests/xlconfigdata/test-spice.xml          |  2 +
  tests/xlconfigtest.c                       |  1 +
  6 files changed, 148 insertions(+), 34 deletions(-)
Quoted 3 lines

create mode 100644 tests/xlconfigdata/test-spice-features.cfg create mode 100644 tests/xlconfigdata/test-spice-features.xml

Quoted 1 line

ACK series

Thanks for taking time to review! Pushed now.

Regards,
Jim