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

[Xen-devel] [PATCH] libxl: disable usbredirection if spice is disabled



Now if usbredirection is enabled in domU's xl cfg is added also
if spice is disabled and then usbredirection remain unused.
This patch if usbredirection is enabled but spice not disable
usbredirection and show a warning.

Signed-off-by: Fabio Fantoni <fabio.fantoni@xxxxxxx>
---
 tools/libxl/libxl_create.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index d015cf4..9a82684 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -292,6 +292,14 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
+        libxl_defbool_setdefault(&b_info->u.hvm.spice.enable, false);
+        if (!libxl_defbool_val(b_info->u.hvm.spice.enable) &&
+            (b_info->u.hvm.spice.usbredirection > 0) ){
+            b_info->u.hvm.spice.usbredirection = 0;
+            LOG(WARN,"usbredirection is used only by spice, spice is disabled"
+            "therefore usbredirection is disabled.");
+        }
+
         if (!b_info->u.hvm.usbversion &&
             (b_info->u.hvm.spice.usbredirection > 0) )
             b_info->u.hvm.usbversion = 2;
@@ -324,7 +332,6 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
             libxl_defbool_setdefault(&b_info->u.hvm.sdl.opengl, false);
         }
 
-        libxl_defbool_setdefault(&b_info->u.hvm.spice.enable, false);
         if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
             libxl_defbool_setdefault(&b_info->u.hvm.spice.disable_ticketing,
                                      false);
-- 
1.7.9.5


_______________________________________________
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®.