}
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;
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;
}
}
}
--- /dev/null
+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
--- /dev/null
+<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>
<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>
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);