All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxl: Spice usbredirection support for upstream qemu
@ 2013-07-04 10:05 Fabio Fantoni
  2013-07-04 10:12 ` Wei Liu
  0 siblings, 1 reply; 20+ messages in thread
From: Fabio Fantoni @ 2013-07-04 10:05 UTC (permalink / raw)
  To: xen-devel; +Cc: Fabio Fantoni, Ian.Jackson, Ian.Campbell, Stefano.Stabellini

Usage: spiceusbredirection=1|0 (default=0)
Enables spice usbredirection. The Spice usbredirection creates usb2
controller and 4 usbredirection channels for redirection of up to 4
usb devices from spice client to domU's qemu.

Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
---
 docs/man/xl.cfg.pod.5       |    8 ++++++++
 tools/libxl/libxl_create.c  |    1 +
 tools/libxl/libxl_dm.c      |   18 ++++++++++++++++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 5 files changed, 30 insertions(+)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 766862d..a450800 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1134,6 +1134,14 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
 
 =back
 
+=item B<spiceusbredirection=BOOLEAN>
+
+Enables spice usbredirection. The Spice usbredirection creates usb2
+controller and 4 usbredirection channels for redirection of up to 4 usb
+devices from spice client to domU's qemu. The default is 0.
+
+=back
+
 =head3 Miscellaneous Emulated Hardware
 
 =over 4
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 8db5460..58df106 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -289,6 +289,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                      false);
             libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
             libxl_defbool_setdefault(&b_info->u.hvm.spice.vdagent, false);
+            libxl_defbool_setdefault(&b_info->u.hvm.spice.usbredirection, false);
         }
 
         libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index bc605e4..4f625e0 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -471,6 +471,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                     "virtserialport,chardev=vdagent,name=com.redhat.spice.0",
                     NULL);
             }
+
+            if (libxl_defbool_val(b_info->u.hvm.spice.usbredirection)) {
+                flexarray_vappend(dm_args, "-device","ich9-usb-ehci1,id=usb,"
+                    "bus=pci.0,addr=0x1d.0x7", "-device","ich9-usb-uhci1,"
+                    "masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,"
+                    "addr=0x1d.0x0", "-device","ich9-usb-uhci2,masterbus=usb.0,"
+                    "firstport=2,bus=pci.0,addr=0x1d.0x1", "-device",
+                    "ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,"
+                    "addr=0x1d.0x2", "-chardev","spicevmc,name=usbredir,"
+                    "id=usbrc1","-device","usb-redir,chardev=usbrc1,id=usbrc1,"
+                    "bus=usb.0", "-chardev","spicevmc,name=usbredir,id=usbrc2",
+                    "-device","usb-redir,chardev=usbrc2,id=usbrc2,bus=usb.0",
+                    "-chardev","spicevmc,name=usbredir,id=usbrc3","-device",
+                    "usb-redir,chardev=usbrc3,id=usbrc3,bus=usb.0", "-chardev",
+                    "spicevmc,name=usbredir,id=usbrc4","-device","usb-redir,"
+                    "chardev=usbrc4,id=usbrc4,bus=usb.0", NULL);
+            }
+
         }
 
         switch (b_info->u.hvm.vga.kind) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 14425d1..80aa2b8 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -173,6 +173,7 @@ libxl_spice_info = Struct("spice_info", [
     ("passwd",      string),
     ("agent_mouse", libxl_defbool),
     ("vdagent",     libxl_defbool),
+    ("usbredirection", libxl_defbool),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 44a632c..5dab898 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1493,6 +1493,8 @@ skip_vfb:
                             &b_info->u.hvm.spice.agent_mouse, 0);
         xlu_cfg_get_defbool(config, "spicevdagent",
                             &b_info->u.hvm.spice.vdagent, 0);
+        xlu_cfg_get_defbool(config, "spiceusbredirection",
+                            &b_info->u.hvm.spice.usbredirection, 0);
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
         xlu_cfg_get_defbool(config, "gfx_passthru", 
                             &b_info->u.hvm.gfx_passthru, 0);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH] libxl: Spice usbredirection support for upstream qemu
  2013-07-04 10:05 [PATCH] libxl: Spice usbredirection support for upstream qemu Fabio Fantoni
@ 2013-07-04 10:12 ` Wei Liu
  2013-07-04 10:16   ` Fabio Fantoni
  0 siblings, 1 reply; 20+ messages in thread
From: Wei Liu @ 2013-07-04 10:12 UTC (permalink / raw)
  To: Fabio Fantoni
  Cc: wei.liu2, xen-devel, Ian.Jackson, Ian.Campbell, Stefano.Stabellini

On Thu, Jul 04, 2013 at 12:05:59PM +0200, Fabio Fantoni wrote:
> Usage: spiceusbredirection=1|0 (default=0)
> Enables spice usbredirection. The Spice usbredirection creates usb2
> controller and 4 usbredirection channels for redirection of up to 4
> usb devices from spice client to domU's qemu.
> 
> Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
> ---
>  docs/man/xl.cfg.pod.5       |    8 ++++++++
>  tools/libxl/libxl_create.c  |    1 +
>  tools/libxl/libxl_dm.c      |   18 ++++++++++++++++++
>  tools/libxl/libxl_types.idl |    1 +
>  tools/libxl/xl_cmdimpl.c    |    2 ++
>  5 files changed, 30 insertions(+)
> 
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> index 766862d..a450800 100644
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -1134,6 +1134,14 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
>  
>  =back
>  
> +=item B<spiceusbredirection=BOOLEAN>
> +
> +Enables spice usbredirection. The Spice usbredirection creates usb2
> +controller and 4 usbredirection channels for redirection of up to 4 usb
> +devices from spice client to domU's qemu. The default is 0.
> +
> +=back
> +
>  =head3 Miscellaneous Emulated Hardware
>  
>  =over 4
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 8db5460..58df106 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -289,6 +289,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>                                       false);
>              libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
>              libxl_defbool_setdefault(&b_info->u.hvm.spice.vdagent, false);
> +            libxl_defbool_setdefault(&b_info->u.hvm.spice.usbredirection, false);
>          }
>  
>          libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index bc605e4..4f625e0 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -471,6 +471,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>                      "virtserialport,chardev=vdagent,name=com.redhat.spice.0",
>                      NULL);
>              }
> +
> +            if (libxl_defbool_val(b_info->u.hvm.spice.usbredirection)) {
> +                flexarray_vappend(dm_args, "-device","ich9-usb-ehci1,id=usb,"
> +                    "bus=pci.0,addr=0x1d.0x7", "-device","ich9-usb-uhci1,"
> +                    "masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,"
> +                    "addr=0x1d.0x0", "-device","ich9-usb-uhci2,masterbus=usb.0,"
> +                    "firstport=2,bus=pci.0,addr=0x1d.0x1", "-device",
> +                    "ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,"
> +                    "addr=0x1d.0x2", "-chardev","spicevmc,name=usbredir,"
> +                    "id=usbrc1","-device","usb-redir,chardev=usbrc1,id=usbrc1,"
> +                    "bus=usb.0", "-chardev","spicevmc,name=usbredir,id=usbrc2",
> +                    "-device","usb-redir,chardev=usbrc2,id=usbrc2,bus=usb.0",
> +                    "-chardev","spicevmc,name=usbredir,id=usbrc3","-device",
> +                    "usb-redir,chardev=usbrc3,id=usbrc3,bus=usb.0", "-chardev",
> +                    "spicevmc,name=usbredir,id=usbrc4","-device","usb-redir,"
> +                    "chardev=usbrc4,id=usbrc4,bus=usb.0", NULL);

Any reason for so many hardcoded options?

> +            }
> +
>          }
>  
>          switch (b_info->u.hvm.vga.kind) {
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 14425d1..80aa2b8 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -173,6 +173,7 @@ libxl_spice_info = Struct("spice_info", [
>      ("passwd",      string),
>      ("agent_mouse", libxl_defbool),
>      ("vdagent",     libxl_defbool),
> +    ("usbredirection", libxl_defbool),
>      ])
>  
>  libxl_sdl_info = Struct("sdl_info", [
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 44a632c..5dab898 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -1493,6 +1493,8 @@ skip_vfb:
>                              &b_info->u.hvm.spice.agent_mouse, 0);
>          xlu_cfg_get_defbool(config, "spicevdagent",
>                              &b_info->u.hvm.spice.vdagent, 0);
> +        xlu_cfg_get_defbool(config, "spiceusbredirection",
> +                            &b_info->u.hvm.spice.usbredirection, 0);
>          xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
>          xlu_cfg_get_defbool(config, "gfx_passthru", 
>                              &b_info->u.hvm.gfx_passthru, 0);
> -- 
> 1.7.9.5
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] libxl: Spice usbredirection support for upstream qemu
  2013-07-04 10:12 ` Wei Liu
@ 2013-07-04 10:16   ` Fabio Fantoni
  2013-07-04 10:32     ` Wei Liu
  0 siblings, 1 reply; 20+ messages in thread
From: Fabio Fantoni @ 2013-07-04 10:16 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel, Ian.Jackson, Ian.Campbell, Stefano.Stabellini

Il 04/07/2013 12:12, Wei Liu ha scritto:
> On Thu, Jul 04, 2013 at 12:05:59PM +0200, Fabio Fantoni wrote:
>> Usage: spiceusbredirection=1|0 (default=0)
>> Enables spice usbredirection. The Spice usbredirection creates usb2
>> controller and 4 usbredirection channels for redirection of up to 4
>> usb devices from spice client to domU's qemu.
>>
>> Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
>> ---
>>   docs/man/xl.cfg.pod.5       |    8 ++++++++
>>   tools/libxl/libxl_create.c  |    1 +
>>   tools/libxl/libxl_dm.c      |   18 ++++++++++++++++++
>>   tools/libxl/libxl_types.idl |    1 +
>>   tools/libxl/xl_cmdimpl.c    |    2 ++
>>   5 files changed, 30 insertions(+)
>>
>> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
>> index 766862d..a450800 100644
>> --- a/docs/man/xl.cfg.pod.5
>> +++ b/docs/man/xl.cfg.pod.5
>> @@ -1134,6 +1134,14 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
>>   
>>   =back
>>   
>> +=item B<spiceusbredirection=BOOLEAN>
>> +
>> +Enables spice usbredirection. The Spice usbredirection creates usb2
>> +controller and 4 usbredirection channels for redirection of up to 4 usb
>> +devices from spice client to domU's qemu. The default is 0.
>> +
>> +=back
>> +
>>   =head3 Miscellaneous Emulated Hardware
>>   
>>   =over 4
>> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
>> index 8db5460..58df106 100644
>> --- a/tools/libxl/libxl_create.c
>> +++ b/tools/libxl/libxl_create.c
>> @@ -289,6 +289,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>>                                        false);
>>               libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
>>               libxl_defbool_setdefault(&b_info->u.hvm.spice.vdagent, false);
>> +            libxl_defbool_setdefault(&b_info->u.hvm.spice.usbredirection, false);
>>           }
>>   
>>           libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
>> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
>> index bc605e4..4f625e0 100644
>> --- a/tools/libxl/libxl_dm.c
>> +++ b/tools/libxl/libxl_dm.c
>> @@ -471,6 +471,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>>                       "virtserialport,chardev=vdagent,name=com.redhat.spice.0",
>>                       NULL);
>>               }
>> +
>> +            if (libxl_defbool_val(b_info->u.hvm.spice.usbredirection)) {
>> +                flexarray_vappend(dm_args, "-device","ich9-usb-ehci1,id=usb,"
>> +                    "bus=pci.0,addr=0x1d.0x7", "-device","ich9-usb-uhci1,"
>> +                    "masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,"
>> +                    "addr=0x1d.0x0", "-device","ich9-usb-uhci2,masterbus=usb.0,"
>> +                    "firstport=2,bus=pci.0,addr=0x1d.0x1", "-device",
>> +                    "ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,"
>> +                    "addr=0x1d.0x2", "-chardev","spicevmc,name=usbredir,"
>> +                    "id=usbrc1","-device","usb-redir,chardev=usbrc1,id=usbrc1,"
>> +                    "bus=usb.0", "-chardev","spicevmc,name=usbredir,id=usbrc2",
>> +                    "-device","usb-redir,chardev=usbrc2,id=usbrc2,bus=usb.0",
>> +                    "-chardev","spicevmc,name=usbredir,id=usbrc3","-device",
>> +                    "usb-redir,chardev=usbrc3,id=usbrc3,bus=usb.0", "-chardev",
>> +                    "spicevmc,name=usbredir,id=usbrc4","-device","usb-redir,"
>> +                    "chardev=usbrc4,id=usbrc4,bus=usb.0", NULL);
> Any reason for so many hardcoded options?

I searched and requested for one year on spice-devel and qemu-devel 
about alternative methods but nothing found for now.
Already tried usb=1 which creates usb1 controller that is not working 
with usb redirection.

>
>> +            }
>> +
>>           }
>>   
>>           switch (b_info->u.hvm.vga.kind) {
>> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
>> index 14425d1..80aa2b8 100644
>> --- a/tools/libxl/libxl_types.idl
>> +++ b/tools/libxl/libxl_types.idl
>> @@ -173,6 +173,7 @@ libxl_spice_info = Struct("spice_info", [
>>       ("passwd",      string),
>>       ("agent_mouse", libxl_defbool),
>>       ("vdagent",     libxl_defbool),
>> +    ("usbredirection", libxl_defbool),
>>       ])
>>   
>>   libxl_sdl_info = Struct("sdl_info", [
>> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
>> index 44a632c..5dab898 100644
>> --- a/tools/libxl/xl_cmdimpl.c
>> +++ b/tools/libxl/xl_cmdimpl.c
>> @@ -1493,6 +1493,8 @@ skip_vfb:
>>                               &b_info->u.hvm.spice.agent_mouse, 0);
>>           xlu_cfg_get_defbool(config, "spicevdagent",
>>                               &b_info->u.hvm.spice.vdagent, 0);
>> +        xlu_cfg_get_defbool(config, "spiceusbredirection",
>> +                            &b_info->u.hvm.spice.usbredirection, 0);
>>           xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
>>           xlu_cfg_get_defbool(config, "gfx_passthru",
>>                               &b_info->u.hvm.gfx_passthru, 0);
>> -- 
>> 1.7.9.5
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] libxl: Spice usbredirection support for upstream qemu
  2013-07-04 10:16   ` Fabio Fantoni
@ 2013-07-04 10:32     ` Wei Liu
  2013-07-04 12:04         ` Fabio Fantoni
  0 siblings, 1 reply; 20+ messages in thread
From: Wei Liu @ 2013-07-04 10:32 UTC (permalink / raw)
  To: Fabio Fantoni
  Cc: Ian.Jackson, xen-devel, Wei Liu, Ian.Campbell, Stefano.Stabellini

On Thu, Jul 04, 2013 at 12:16:43PM +0200, Fabio Fantoni wrote:
> Il 04/07/2013 12:12, Wei Liu ha scritto:
> >On Thu, Jul 04, 2013 at 12:05:59PM +0200, Fabio Fantoni wrote:
> >>Usage: spiceusbredirection=1|0 (default=0)
> >>Enables spice usbredirection. The Spice usbredirection creates usb2
> >>controller and 4 usbredirection channels for redirection of up to 4
> >>usb devices from spice client to domU's qemu.
> >>
> >>Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
> >>---
> >>  docs/man/xl.cfg.pod.5       |    8 ++++++++
> >>  tools/libxl/libxl_create.c  |    1 +
> >>  tools/libxl/libxl_dm.c      |   18 ++++++++++++++++++
> >>  tools/libxl/libxl_types.idl |    1 +
> >>  tools/libxl/xl_cmdimpl.c    |    2 ++
> >>  5 files changed, 30 insertions(+)
> >>
> >>diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> >>index 766862d..a450800 100644
> >>--- a/docs/man/xl.cfg.pod.5
> >>+++ b/docs/man/xl.cfg.pod.5
> >>@@ -1134,6 +1134,14 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
> >>  =back
> >>+=item B<spiceusbredirection=BOOLEAN>
> >>+
> >>+Enables spice usbredirection. The Spice usbredirection creates usb2
> >>+controller and 4 usbredirection channels for redirection of up to 4 usb
> >>+devices from spice client to domU's qemu. The default is 0.
> >>+
> >>+=back
> >>+
> >>  =head3 Miscellaneous Emulated Hardware
> >>  =over 4
> >>diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> >>index 8db5460..58df106 100644
> >>--- a/tools/libxl/libxl_create.c
> >>+++ b/tools/libxl/libxl_create.c
> >>@@ -289,6 +289,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
> >>                                       false);
> >>              libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
> >>              libxl_defbool_setdefault(&b_info->u.hvm.spice.vdagent, false);
> >>+            libxl_defbool_setdefault(&b_info->u.hvm.spice.usbredirection, false);
> >>          }
> >>          libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
> >>diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> >>index bc605e4..4f625e0 100644
> >>--- a/tools/libxl/libxl_dm.c
> >>+++ b/tools/libxl/libxl_dm.c
> >>@@ -471,6 +471,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
> >>                      "virtserialport,chardev=vdagent,name=com.redhat.spice.0",
> >>                      NULL);
> >>              }
> >>+
> >>+            if (libxl_defbool_val(b_info->u.hvm.spice.usbredirection)) {
> >>+                flexarray_vappend(dm_args, "-device","ich9-usb-ehci1,id=usb,"
> >>+                    "bus=pci.0,addr=0x1d.0x7", "-device","ich9-usb-uhci1,"
> >>+                    "masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,"
> >>+                    "addr=0x1d.0x0", "-device","ich9-usb-uhci2,masterbus=usb.0,"
> >>+                    "firstport=2,bus=pci.0,addr=0x1d.0x1", "-device",
> >>+                    "ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,"
> >>+                    "addr=0x1d.0x2", "-chardev","spicevmc,name=usbredir,"
> >>+                    "id=usbrc1","-device","usb-redir,chardev=usbrc1,id=usbrc1,"
> >>+                    "bus=usb.0", "-chardev","spicevmc,name=usbredir,id=usbrc2",
> >>+                    "-device","usb-redir,chardev=usbrc2,id=usbrc2,bus=usb.0",
> >>+                    "-chardev","spicevmc,name=usbredir,id=usbrc3","-device",
> >>+                    "usb-redir,chardev=usbrc3,id=usbrc3,bus=usb.0", "-chardev",
> >>+                    "spicevmc,name=usbredir,id=usbrc4","-device","usb-redir,"
> >>+                    "chardev=usbrc4,id=usbrc4,bus=usb.0", NULL);
> >Any reason for so many hardcoded options?
> 
> I searched and requested for one year on spice-devel and qemu-devel
> about alternative methods but nothing found for now.
> Already tried usb=1 which creates usb1 controller that is not
> working with usb redirection.
> 

What if QEMU upstream changes and these options don't work any more? In
that case this functionality is broken and users have no way to
workaround it. IMHO unless they are clearly documented we should not
consider adding in theses hardcoded options in libxl.


> >
> >>+            }
> >>+
> >>          }
> >>          switch (b_info->u.hvm.vga.kind) {
> >>diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> >>index 14425d1..80aa2b8 100644
> >>--- a/tools/libxl/libxl_types.idl
> >>+++ b/tools/libxl/libxl_types.idl
> >>@@ -173,6 +173,7 @@ libxl_spice_info = Struct("spice_info", [
> >>      ("passwd",      string),
> >>      ("agent_mouse", libxl_defbool),
> >>      ("vdagent",     libxl_defbool),
> >>+    ("usbredirection", libxl_defbool),
> >>      ])
> >>  libxl_sdl_info = Struct("sdl_info", [
> >>diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> >>index 44a632c..5dab898 100644
> >>--- a/tools/libxl/xl_cmdimpl.c
> >>+++ b/tools/libxl/xl_cmdimpl.c
> >>@@ -1493,6 +1493,8 @@ skip_vfb:
> >>                              &b_info->u.hvm.spice.agent_mouse, 0);
> >>          xlu_cfg_get_defbool(config, "spicevdagent",
> >>                              &b_info->u.hvm.spice.vdagent, 0);
> >>+        xlu_cfg_get_defbool(config, "spiceusbredirection",
> >>+                            &b_info->u.hvm.spice.usbredirection, 0);
> >>          xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
> >>          xlu_cfg_get_defbool(config, "gfx_passthru",
> >>                              &b_info->u.hvm.gfx_passthru, 0);
> >>-- 
> >>1.7.9.5
> >>
> >>
> >>_______________________________________________
> >>Xen-devel mailing list
> >>Xen-devel@lists.xen.org
> >>http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
  2013-07-04 10:32     ` Wei Liu
@ 2013-07-04 12:04         ` Fabio Fantoni
  0 siblings, 0 replies; 20+ messages in thread
From: Fabio Fantoni @ 2013-07-04 12:04 UTC (permalink / raw)
  To: Wei Liu
  Cc: xen-devel, Ian.Campbell, Stefano.Stabellini, Ian.Jackson,
	qemu-devel, spice-devel

[-- Attachment #1: Type: text/plain, Size: 6063 bytes --]

Il 04/07/2013 12:32, Wei Liu ha scritto:
> On Thu, Jul 04, 2013 at 12:16:43PM +0200, Fabio Fantoni wrote:
>> Il 04/07/2013 12:12, Wei Liu ha scritto:
>>> On Thu, Jul 04, 2013 at 12:05:59PM +0200, Fabio Fantoni wrote:
>>>> Usage: spiceusbredirection=1|0 (default=0)
>>>> Enables spice usbredirection. The Spice usbredirection creates usb2
>>>> controller and 4 usbredirection channels for redirection of up to 4
>>>> usb devices from spice client to domU's qemu.
>>>>
>>>> Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
>>>> ---
>>>>   docs/man/xl.cfg.pod.5       |    8 ++++++++
>>>>   tools/libxl/libxl_create.c  |    1 +
>>>>   tools/libxl/libxl_dm.c      |   18 ++++++++++++++++++
>>>>   tools/libxl/libxl_types.idl |    1 +
>>>>   tools/libxl/xl_cmdimpl.c    |    2 ++
>>>>   5 files changed, 30 insertions(+)
>>>>
>>>> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
>>>> index 766862d..a450800 100644
>>>> --- a/docs/man/xl.cfg.pod.5
>>>> +++ b/docs/man/xl.cfg.pod.5
>>>> @@ -1134,6 +1134,14 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
>>>>   =back
>>>> +=item B<spiceusbredirection=BOOLEAN>
>>>> +
>>>> +Enables spice usbredirection. The Spice usbredirection creates usb2
>>>> +controller and 4 usbredirection channels for redirection of up to 4 usb
>>>> +devices from spice client to domU's qemu. The default is 0.
>>>> +
>>>> +=back
>>>> +
>>>>   =head3 Miscellaneous Emulated Hardware
>>>>   =over 4
>>>> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
>>>> index 8db5460..58df106 100644
>>>> --- a/tools/libxl/libxl_create.c
>>>> +++ b/tools/libxl/libxl_create.c
>>>> @@ -289,6 +289,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>>>>                                        false);
>>>>               libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
>>>>               libxl_defbool_setdefault(&b_info->u.hvm.spice.vdagent, false);
>>>> +            libxl_defbool_setdefault(&b_info->u.hvm.spice.usbredirection, false);
>>>>           }
>>>>           libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
>>>> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
>>>> index bc605e4..4f625e0 100644
>>>> --- a/tools/libxl/libxl_dm.c
>>>> +++ b/tools/libxl/libxl_dm.c
>>>> @@ -471,6 +471,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>>>>                       "virtserialport,chardev=vdagent,name=com.redhat.spice.0",
>>>>                       NULL);
>>>>               }
>>>> +
>>>> +            if (libxl_defbool_val(b_info->u.hvm.spice.usbredirection)) {
>>>> +                flexarray_vappend(dm_args,*"-device","ich9-usb-ehci1,id=usb,"
>>>> +                    "bus=pci.0,addr=0x1d.0x7", "-device","ich9-usb-uhci1,"
>>>> +                    "masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,"
>>>> +                    "addr=0x1d.0x0", "-device","ich9-usb-uhci2,masterbus=usb.0,"
>>>> +                    "firstport=2,bus=pci.0,addr=0x1d.0x1", "-device",
>>>> +                    "ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,"
>>>> +                    "addr=0x1d.0x2", "-chardev","spicevmc,name=usbredir,"
>>>> +                    "id=usbrc1","-device","usb-redir,chardev=usbrc1,id=usbrc1,"
>>>> +                    "bus=usb.0", "-chardev","spicevmc,name=usbredir,id=usbrc2",
>>>> +                    "-device","usb-redir,chardev=usbrc2,id=usbrc2,bus=usb.0",
>>>> +                    "-chardev","spicevmc,name=usbredir,id=usbrc3","-device",
>>>> +                    "usb-redir,chardev=usbrc3,id=usbrc3,bus=usb.0", "-chardev",
>>>> +                    "spicevmc,name=usbredir,id=usbrc4","-device","usb-redir,"
>>>> +                    "chardev=usbrc4,id=usbrc4,bus=usb.0"*, NULL);
>>> Any reason for so many hardcoded options?
>> I searched and requested for one year on spice-devel and qemu-devel
>> about alternative methods but nothing found for now.
>> Already tried usb=1 which creates usb1 controller that is not
>> working with usb redirection.
>>
> What if QEMU upstream changes and these options don't work any more? In
> that case this functionality is broken and users have no way to
> workaround it. IMHO unless they are clearly documented we should not
> consider adding in theses hardcoded options in libxl.

Added to cc spice-devel and qemu-devel for ask again if there is a 
better solution to do this.

@spice-devel and qemu-devel:
Can someone help to improve qemu options above for enable usb 
redirection please?
Thanks for any reply.

>
>>>> +            }
>>>> +
>>>>           }
>>>>           switch (b_info->u.hvm.vga.kind) {
>>>> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
>>>> index 14425d1..80aa2b8 100644
>>>> --- a/tools/libxl/libxl_types.idl
>>>> +++ b/tools/libxl/libxl_types.idl
>>>> @@ -173,6 +173,7 @@ libxl_spice_info = Struct("spice_info", [
>>>>       ("passwd",      string),
>>>>       ("agent_mouse", libxl_defbool),
>>>>       ("vdagent",     libxl_defbool),
>>>> +    ("usbredirection", libxl_defbool),
>>>>       ])
>>>>   libxl_sdl_info = Struct("sdl_info", [
>>>> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
>>>> index 44a632c..5dab898 100644
>>>> --- a/tools/libxl/xl_cmdimpl.c
>>>> +++ b/tools/libxl/xl_cmdimpl.c
>>>> @@ -1493,6 +1493,8 @@ skip_vfb:
>>>>                               &b_info->u.hvm.spice.agent_mouse, 0);
>>>>           xlu_cfg_get_defbool(config, "spicevdagent",
>>>>                               &b_info->u.hvm.spice.vdagent, 0);
>>>> +        xlu_cfg_get_defbool(config, "spiceusbredirection",
>>>> +                            &b_info->u.hvm.spice.usbredirection, 0);
>>>>           xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
>>>>           xlu_cfg_get_defbool(config, "gfx_passthru",
>>>>                               &b_info->u.hvm.gfx_passthru, 0);
>>>> -- 
>>>> 1.7.9.5
>>>>
>>>>
>>>> _______________________________________________
>>>> Xen-devel mailing list
>>>> Xen-devel@lists.xen.org
>>>> http://lists.xen.org/xen-devel


[-- Attachment #2: Type: text/html, Size: 6940 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] libxl: Spice usbredirection support for upstream qemu
@ 2013-07-04 12:04         ` Fabio Fantoni
  0 siblings, 0 replies; 20+ messages in thread
From: Fabio Fantoni @ 2013-07-04 12:04 UTC (permalink / raw)
  To: Wei Liu
  Cc: xen-devel, Ian.Campbell, Stefano.Stabellini, Ian.Jackson,
	qemu-devel, spice-devel


[-- Attachment #1.1: Type: text/plain, Size: 6063 bytes --]

Il 04/07/2013 12:32, Wei Liu ha scritto:
> On Thu, Jul 04, 2013 at 12:16:43PM +0200, Fabio Fantoni wrote:
>> Il 04/07/2013 12:12, Wei Liu ha scritto:
>>> On Thu, Jul 04, 2013 at 12:05:59PM +0200, Fabio Fantoni wrote:
>>>> Usage: spiceusbredirection=1|0 (default=0)
>>>> Enables spice usbredirection. The Spice usbredirection creates usb2
>>>> controller and 4 usbredirection channels for redirection of up to 4
>>>> usb devices from spice client to domU's qemu.
>>>>
>>>> Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
>>>> ---
>>>>   docs/man/xl.cfg.pod.5       |    8 ++++++++
>>>>   tools/libxl/libxl_create.c  |    1 +
>>>>   tools/libxl/libxl_dm.c      |   18 ++++++++++++++++++
>>>>   tools/libxl/libxl_types.idl |    1 +
>>>>   tools/libxl/xl_cmdimpl.c    |    2 ++
>>>>   5 files changed, 30 insertions(+)
>>>>
>>>> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
>>>> index 766862d..a450800 100644
>>>> --- a/docs/man/xl.cfg.pod.5
>>>> +++ b/docs/man/xl.cfg.pod.5
>>>> @@ -1134,6 +1134,14 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
>>>>   =back
>>>> +=item B<spiceusbredirection=BOOLEAN>
>>>> +
>>>> +Enables spice usbredirection. The Spice usbredirection creates usb2
>>>> +controller and 4 usbredirection channels for redirection of up to 4 usb
>>>> +devices from spice client to domU's qemu. The default is 0.
>>>> +
>>>> +=back
>>>> +
>>>>   =head3 Miscellaneous Emulated Hardware
>>>>   =over 4
>>>> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
>>>> index 8db5460..58df106 100644
>>>> --- a/tools/libxl/libxl_create.c
>>>> +++ b/tools/libxl/libxl_create.c
>>>> @@ -289,6 +289,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>>>>                                        false);
>>>>               libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
>>>>               libxl_defbool_setdefault(&b_info->u.hvm.spice.vdagent, false);
>>>> +            libxl_defbool_setdefault(&b_info->u.hvm.spice.usbredirection, false);
>>>>           }
>>>>           libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
>>>> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
>>>> index bc605e4..4f625e0 100644
>>>> --- a/tools/libxl/libxl_dm.c
>>>> +++ b/tools/libxl/libxl_dm.c
>>>> @@ -471,6 +471,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>>>>                       "virtserialport,chardev=vdagent,name=com.redhat.spice.0",
>>>>                       NULL);
>>>>               }
>>>> +
>>>> +            if (libxl_defbool_val(b_info->u.hvm.spice.usbredirection)) {
>>>> +                flexarray_vappend(dm_args,*"-device","ich9-usb-ehci1,id=usb,"
>>>> +                    "bus=pci.0,addr=0x1d.0x7", "-device","ich9-usb-uhci1,"
>>>> +                    "masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,"
>>>> +                    "addr=0x1d.0x0", "-device","ich9-usb-uhci2,masterbus=usb.0,"
>>>> +                    "firstport=2,bus=pci.0,addr=0x1d.0x1", "-device",
>>>> +                    "ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,"
>>>> +                    "addr=0x1d.0x2", "-chardev","spicevmc,name=usbredir,"
>>>> +                    "id=usbrc1","-device","usb-redir,chardev=usbrc1,id=usbrc1,"
>>>> +                    "bus=usb.0", "-chardev","spicevmc,name=usbredir,id=usbrc2",
>>>> +                    "-device","usb-redir,chardev=usbrc2,id=usbrc2,bus=usb.0",
>>>> +                    "-chardev","spicevmc,name=usbredir,id=usbrc3","-device",
>>>> +                    "usb-redir,chardev=usbrc3,id=usbrc3,bus=usb.0", "-chardev",
>>>> +                    "spicevmc,name=usbredir,id=usbrc4","-device","usb-redir,"
>>>> +                    "chardev=usbrc4,id=usbrc4,bus=usb.0"*, NULL);
>>> Any reason for so many hardcoded options?
>> I searched and requested for one year on spice-devel and qemu-devel
>> about alternative methods but nothing found for now.
>> Already tried usb=1 which creates usb1 controller that is not
>> working with usb redirection.
>>
> What if QEMU upstream changes and these options don't work any more? In
> that case this functionality is broken and users have no way to
> workaround it. IMHO unless they are clearly documented we should not
> consider adding in theses hardcoded options in libxl.

Added to cc spice-devel and qemu-devel for ask again if there is a 
better solution to do this.

@spice-devel and qemu-devel:
Can someone help to improve qemu options above for enable usb 
redirection please?
Thanks for any reply.

>
>>>> +            }
>>>> +
>>>>           }
>>>>           switch (b_info->u.hvm.vga.kind) {
>>>> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
>>>> index 14425d1..80aa2b8 100644
>>>> --- a/tools/libxl/libxl_types.idl
>>>> +++ b/tools/libxl/libxl_types.idl
>>>> @@ -173,6 +173,7 @@ libxl_spice_info = Struct("spice_info", [
>>>>       ("passwd",      string),
>>>>       ("agent_mouse", libxl_defbool),
>>>>       ("vdagent",     libxl_defbool),
>>>> +    ("usbredirection", libxl_defbool),
>>>>       ])
>>>>   libxl_sdl_info = Struct("sdl_info", [
>>>> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
>>>> index 44a632c..5dab898 100644
>>>> --- a/tools/libxl/xl_cmdimpl.c
>>>> +++ b/tools/libxl/xl_cmdimpl.c
>>>> @@ -1493,6 +1493,8 @@ skip_vfb:
>>>>                               &b_info->u.hvm.spice.agent_mouse, 0);
>>>>           xlu_cfg_get_defbool(config, "spicevdagent",
>>>>                               &b_info->u.hvm.spice.vdagent, 0);
>>>> +        xlu_cfg_get_defbool(config, "spiceusbredirection",
>>>> +                            &b_info->u.hvm.spice.usbredirection, 0);
>>>>           xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
>>>>           xlu_cfg_get_defbool(config, "gfx_passthru",
>>>>                               &b_info->u.hvm.gfx_passthru, 0);
>>>> -- 
>>>> 1.7.9.5
>>>>
>>>>
>>>> _______________________________________________
>>>> Xen-devel mailing list
>>>> Xen-devel@lists.xen.org
>>>> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 6940 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
  2013-07-04 12:04         ` Fabio Fantoni
@ 2013-07-04 12:46           ` Stefano Stabellini
  -1 siblings, 0 replies; 20+ messages in thread
From: Stefano Stabellini @ 2013-07-04 12:46 UTC (permalink / raw)
  To: Fabio Fantoni
  Cc: xen-devel, Wei Liu, Ian.Campbell, Stefano.Stabellini,
	Ian.Jackson, qemu-devel, spice-devel

Please don't use HTML in emails

On Thu, 4 Jul 2013, Fabio Fantoni wrote:
> Il 04/07/2013 12:32, Wei Liu ha scritto:
> 
> On Thu, Jul 04, 2013 at 12:16:43PM +0200, Fabio Fantoni wrote:
> 
> Il 04/07/2013 12:12, Wei Liu ha scritto:
> 
> On Thu, Jul 04, 2013 at 12:05:59PM +0200, Fabio Fantoni wrote:
> 
> Usage: spiceusbredirection=1|0 (default=0)
> Enables spice usbredirection. The Spice usbredirection creates usb2
> controller and 4 usbredirection channels for redirection of up to 4
> usb devices from spice client to domU's qemu.
> 
> Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
> ---
>  docs/man/xl.cfg.pod.5       |    8 ++++++++
>  tools/libxl/libxl_create.c  |    1 +
>  tools/libxl/libxl_dm.c      |   18 ++++++++++++++++++
>  tools/libxl/libxl_types.idl |    1 +
>  tools/libxl/xl_cmdimpl.c    |    2 ++
>  5 files changed, 30 insertions(+)
> 
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> index 766862d..a450800 100644
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -1134,6 +1134,14 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
>  =back
> +=item B<spiceusbredirection=BOOLEAN>
> +
> +Enables spice usbredirection. The Spice usbredirection creates usb2
> +controller and 4 usbredirection channels for redirection of up to 4 usb
> +devices from spice client to domU's qemu. The default is 0.
> +
> +=back
> +
>  =head3 Miscellaneous Emulated Hardware
>  =over 4
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 8db5460..58df106 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -289,6 +289,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>                                       false);
>              libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
>              libxl_defbool_setdefault(&b_info->u.hvm.spice.vdagent, false);
> +            libxl_defbool_setdefault(&b_info->u.hvm.spice.usbredirection, false);
>          }
>          libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index bc605e4..4f625e0 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -471,6 +471,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>                      "virtserialport,chardev=vdagent,name=com.redhat.spice.0",
>                      NULL);
>              }
> +
> +            if (libxl_defbool_val(b_info->u.hvm.spice.usbredirection)) {
> +                flexarray_vappend(dm_args, "-device","ich9-usb-ehci1,id=usb,"
> +                    "bus=pci.0,addr=0x1d.0x7", "-device","ich9-usb-uhci1,"
> +                    "masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,"
> +                    "addr=0x1d.0x0", "-device","ich9-usb-uhci2,masterbus=usb.0,"
> +                    "firstport=2,bus=pci.0,addr=0x1d.0x1", "-device",
> +                    "ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,"
> +                    "addr=0x1d.0x2", "-chardev","spicevmc,name=usbredir,"
> +                    "id=usbrc1","-device","usb-redir,chardev=usbrc1,id=usbrc1,"
> +                    "bus=usb.0", "-chardev","spicevmc,name=usbredir,id=usbrc2",
> +                    "-device","usb-redir,chardev=usbrc2,id=usbrc2,bus=usb.0",
> +                    "-chardev","spicevmc,name=usbredir,id=usbrc3","-device",
> +                    "usb-redir,chardev=usbrc3,id=usbrc3,bus=usb.0", "-chardev",
> +                    "spicevmc,name=usbredir,id=usbrc4","-device","usb-redir,"
> +                    "chardev=usbrc4,id=usbrc4,bus=usb.0", NULL);
> 
> Any reason for so many hardcoded options?
> 
> I searched and requested for one year on spice-devel and qemu-devel
> about alternative methods but nothing found for now.
> Already tried usb=1 which creates usb1 controller that is not
> working with usb redirection.
> 
> What if QEMU upstream changes and these options don't work any more? In
> that case this functionality is broken and users have no way to
> workaround it. IMHO unless they are clearly documented we should not
> consider adding in theses hardcoded options in libxl.
> 
> 
> Added to cc spice-devel and qemu-devel for ask again if there is a better solution to do this.
> 
> @spice-devel and qemu-devel:
> Can someone help to improve qemu options above for enable usb redirection please?
> Thanks for any reply.

It's not about "improving" qemu options for usb redirection (even though
they could use a simplification), it's whether they are guaranteed to be
stable. Are you sure that a future QEMU release is going to work with
these options?
For example, is libvirt using something similar to this?

Usually QEMU cmdline options are considered a stable interface, so I
wouldn't worry too much about it.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
@ 2013-07-04 12:46           ` Stefano Stabellini
  0 siblings, 0 replies; 20+ messages in thread
From: Stefano Stabellini @ 2013-07-04 12:46 UTC (permalink / raw)
  To: Fabio Fantoni
  Cc: xen-devel, Wei Liu, Ian.Campbell, Stefano.Stabellini,
	Ian.Jackson, qemu-devel, spice-devel

Please don't use HTML in emails

On Thu, 4 Jul 2013, Fabio Fantoni wrote:
> Il 04/07/2013 12:32, Wei Liu ha scritto:
> 
> On Thu, Jul 04, 2013 at 12:16:43PM +0200, Fabio Fantoni wrote:
> 
> Il 04/07/2013 12:12, Wei Liu ha scritto:
> 
> On Thu, Jul 04, 2013 at 12:05:59PM +0200, Fabio Fantoni wrote:
> 
> Usage: spiceusbredirection=1|0 (default=0)
> Enables spice usbredirection. The Spice usbredirection creates usb2
> controller and 4 usbredirection channels for redirection of up to 4
> usb devices from spice client to domU's qemu.
> 
> Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
> ---
>  docs/man/xl.cfg.pod.5       |    8 ++++++++
>  tools/libxl/libxl_create.c  |    1 +
>  tools/libxl/libxl_dm.c      |   18 ++++++++++++++++++
>  tools/libxl/libxl_types.idl |    1 +
>  tools/libxl/xl_cmdimpl.c    |    2 ++
>  5 files changed, 30 insertions(+)
> 
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> index 766862d..a450800 100644
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -1134,6 +1134,14 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
>  =back
> +=item B<spiceusbredirection=BOOLEAN>
> +
> +Enables spice usbredirection. The Spice usbredirection creates usb2
> +controller and 4 usbredirection channels for redirection of up to 4 usb
> +devices from spice client to domU's qemu. The default is 0.
> +
> +=back
> +
>  =head3 Miscellaneous Emulated Hardware
>  =over 4
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 8db5460..58df106 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -289,6 +289,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>                                       false);
>              libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
>              libxl_defbool_setdefault(&b_info->u.hvm.spice.vdagent, false);
> +            libxl_defbool_setdefault(&b_info->u.hvm.spice.usbredirection, false);
>          }
>          libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index bc605e4..4f625e0 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -471,6 +471,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>                      "virtserialport,chardev=vdagent,name=com.redhat.spice.0",
>                      NULL);
>              }
> +
> +            if (libxl_defbool_val(b_info->u.hvm.spice.usbredirection)) {
> +                flexarray_vappend(dm_args, "-device","ich9-usb-ehci1,id=usb,"
> +                    "bus=pci.0,addr=0x1d.0x7", "-device","ich9-usb-uhci1,"
> +                    "masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,"
> +                    "addr=0x1d.0x0", "-device","ich9-usb-uhci2,masterbus=usb.0,"
> +                    "firstport=2,bus=pci.0,addr=0x1d.0x1", "-device",
> +                    "ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,"
> +                    "addr=0x1d.0x2", "-chardev","spicevmc,name=usbredir,"
> +                    "id=usbrc1","-device","usb-redir,chardev=usbrc1,id=usbrc1,"
> +                    "bus=usb.0", "-chardev","spicevmc,name=usbredir,id=usbrc2",
> +                    "-device","usb-redir,chardev=usbrc2,id=usbrc2,bus=usb.0",
> +                    "-chardev","spicevmc,name=usbredir,id=usbrc3","-device",
> +                    "usb-redir,chardev=usbrc3,id=usbrc3,bus=usb.0", "-chardev",
> +                    "spicevmc,name=usbredir,id=usbrc4","-device","usb-redir,"
> +                    "chardev=usbrc4,id=usbrc4,bus=usb.0", NULL);
> 
> Any reason for so many hardcoded options?
> 
> I searched and requested for one year on spice-devel and qemu-devel
> about alternative methods but nothing found for now.
> Already tried usb=1 which creates usb1 controller that is not
> working with usb redirection.
> 
> What if QEMU upstream changes and these options don't work any more? In
> that case this functionality is broken and users have no way to
> workaround it. IMHO unless they are clearly documented we should not
> consider adding in theses hardcoded options in libxl.
> 
> 
> Added to cc spice-devel and qemu-devel for ask again if there is a better solution to do this.
> 
> @spice-devel and qemu-devel:
> Can someone help to improve qemu options above for enable usb redirection please?
> Thanks for any reply.

It's not about "improving" qemu options for usb redirection (even though
they could use a simplification), it's whether they are guaranteed to be
stable. Are you sure that a future QEMU release is going to work with
these options?
For example, is libvirt using something similar to this?

Usually QEMU cmdline options are considered a stable interface, so I
wouldn't worry too much about it.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
  2013-07-04 12:46           ` Stefano Stabellini
@ 2013-07-04 17:17             ` Andreas Färber
  -1 siblings, 0 replies; 20+ messages in thread
From: Andreas Färber @ 2013-07-04 17:17 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: xen-devel, Wei Liu, Ian.Campbell, Ian.Jackson, qemu-devel,
	Hans de Goede, Fabio Fantoni, spice-devel

Am 04.07.2013 14:46, schrieb Stefano Stabellini:
> On Thu, 4 Jul 2013, Fabio Fantoni wrote:
>> Il 04/07/2013 12:32, Wei Liu ha scritto:
>>
>> On Thu, Jul 04, 2013 at 12:16:43PM +0200, Fabio Fantoni wrote:
>>
>> Il 04/07/2013 12:12, Wei Liu ha scritto:
>>
>> On Thu, Jul 04, 2013 at 12:05:59PM +0200, Fabio Fantoni wrote:
>>
>> Usage: spiceusbredirection=1|0 (default=0)
>> Enables spice usbredirection. The Spice usbredirection creates usb2
>> controller and 4 usbredirection channels for redirection of up to 4
>> usb devices from spice client to domU's qemu.
>>
>> Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
>> ---
>>  docs/man/xl.cfg.pod.5       |    8 ++++++++
>>  tools/libxl/libxl_create.c  |    1 +
>>  tools/libxl/libxl_dm.c      |   18 ++++++++++++++++++
>>  tools/libxl/libxl_types.idl |    1 +
>>  tools/libxl/xl_cmdimpl.c    |    2 ++
>>  5 files changed, 30 insertions(+)
>>
>> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
>> index 766862d..a450800 100644
>> --- a/docs/man/xl.cfg.pod.5
>> +++ b/docs/man/xl.cfg.pod.5
>> @@ -1134,6 +1134,14 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
>>  =back
>> +=item B<spiceusbredirection=BOOLEAN>
>> +
>> +Enables spice usbredirection. The Spice usbredirection creates usb2
>> +controller and 4 usbredirection channels for redirection of up to 4 usb
>> +devices from spice client to domU's qemu. The default is 0.
>> +
>> +=back
>> +
>>  =head3 Miscellaneous Emulated Hardware
>>  =over 4
>> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
>> index 8db5460..58df106 100644
>> --- a/tools/libxl/libxl_create.c
>> +++ b/tools/libxl/libxl_create.c
>> @@ -289,6 +289,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>>                                       false);
>>              libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
>>              libxl_defbool_setdefault(&b_info->u.hvm.spice.vdagent, false);
>> +            libxl_defbool_setdefault(&b_info->u.hvm.spice.usbredirection, false);
>>          }
>>          libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
>> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
>> index bc605e4..4f625e0 100644
>> --- a/tools/libxl/libxl_dm.c
>> +++ b/tools/libxl/libxl_dm.c
>> @@ -471,6 +471,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>>                      "virtserialport,chardev=vdagent,name=com.redhat.spice.0",
>>                      NULL);
>>              }
>> +
>> +            if (libxl_defbool_val(b_info->u.hvm.spice.usbredirection)) {
>> +                flexarray_vappend(dm_args, "-device","ich9-usb-ehci1,id=usb,"
>> +                    "bus=pci.0,addr=0x1d.0x7", "-device","ich9-usb-uhci1,"
>> +                    "masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,"
>> +                    "addr=0x1d.0x0", "-device","ich9-usb-uhci2,masterbus=usb.0,"
>> +                    "firstport=2,bus=pci.0,addr=0x1d.0x1", "-device",
>> +                    "ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,"
>> +                    "addr=0x1d.0x2", "-chardev","spicevmc,name=usbredir,"
>> +                    "id=usbrc1","-device","usb-redir,chardev=usbrc1,id=usbrc1,"
>> +                    "bus=usb.0", "-chardev","spicevmc,name=usbredir,id=usbrc2",
>> +                    "-device","usb-redir,chardev=usbrc2,id=usbrc2,bus=usb.0",
>> +                    "-chardev","spicevmc,name=usbredir,id=usbrc3","-device",
>> +                    "usb-redir,chardev=usbrc3,id=usbrc3,bus=usb.0", "-chardev",
>> +                    "spicevmc,name=usbredir,id=usbrc4","-device","usb-redir,"
>> +                    "chardev=usbrc4,id=usbrc4,bus=usb.0", NULL);
>>
>> Any reason for so many hardcoded options?
>>
>> I searched and requested for one year on spice-devel and qemu-devel
>> about alternative methods but nothing found for now.
>> Already tried usb=1 which creates usb1 controller that is not
>> working with usb redirection.
>>
>> What if QEMU upstream changes and these options don't work any more? In
>> that case this functionality is broken and users have no way to
>> workaround it. IMHO unless they are clearly documented we should not
>> consider adding in theses hardcoded options in libxl.
>>
>>
>> Added to cc spice-devel and qemu-devel for ask again if there is a better solution to do this.
>>
>> @spice-devel and qemu-devel:
>> Can someone help to improve qemu options above for enable usb redirection please?
>> Thanks for any reply.
> 
> It's not about "improving" qemu options for usb redirection (even though
> they could use a simplification), it's whether they are guaranteed to be
> stable. Are you sure that a future QEMU release is going to work with
> these options?
> For example, is libvirt using something similar to this?
> 
> Usually QEMU cmdline options are considered a stable interface, so I
> wouldn't worry too much about it.

I'm not sure if pci.0 bus name of i440fx should be considered stable?

Also if at some point you try to use, e.g., q35 rather than i440fx
machine, it might have EHCI by default and the snippet would be
instantiating a duplicate one. I.e., the three levels of dependency
could be separated more clearly: PCI, USB, redirection.

Stating the obvious, a loop would be a more readable solution for adding
4 devices only differing in device/chardev id. ;)

CC'ing Hans.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
@ 2013-07-04 17:17             ` Andreas Färber
  0 siblings, 0 replies; 20+ messages in thread
From: Andreas Färber @ 2013-07-04 17:17 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: xen-devel, Wei Liu, Ian.Campbell, Ian.Jackson, qemu-devel,
	Hans de Goede, Fabio Fantoni, spice-devel

Am 04.07.2013 14:46, schrieb Stefano Stabellini:
> On Thu, 4 Jul 2013, Fabio Fantoni wrote:
>> Il 04/07/2013 12:32, Wei Liu ha scritto:
>>
>> On Thu, Jul 04, 2013 at 12:16:43PM +0200, Fabio Fantoni wrote:
>>
>> Il 04/07/2013 12:12, Wei Liu ha scritto:
>>
>> On Thu, Jul 04, 2013 at 12:05:59PM +0200, Fabio Fantoni wrote:
>>
>> Usage: spiceusbredirection=1|0 (default=0)
>> Enables spice usbredirection. The Spice usbredirection creates usb2
>> controller and 4 usbredirection channels for redirection of up to 4
>> usb devices from spice client to domU's qemu.
>>
>> Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
>> ---
>>  docs/man/xl.cfg.pod.5       |    8 ++++++++
>>  tools/libxl/libxl_create.c  |    1 +
>>  tools/libxl/libxl_dm.c      |   18 ++++++++++++++++++
>>  tools/libxl/libxl_types.idl |    1 +
>>  tools/libxl/xl_cmdimpl.c    |    2 ++
>>  5 files changed, 30 insertions(+)
>>
>> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
>> index 766862d..a450800 100644
>> --- a/docs/man/xl.cfg.pod.5
>> +++ b/docs/man/xl.cfg.pod.5
>> @@ -1134,6 +1134,14 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
>>  =back
>> +=item B<spiceusbredirection=BOOLEAN>
>> +
>> +Enables spice usbredirection. The Spice usbredirection creates usb2
>> +controller and 4 usbredirection channels for redirection of up to 4 usb
>> +devices from spice client to domU's qemu. The default is 0.
>> +
>> +=back
>> +
>>  =head3 Miscellaneous Emulated Hardware
>>  =over 4
>> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
>> index 8db5460..58df106 100644
>> --- a/tools/libxl/libxl_create.c
>> +++ b/tools/libxl/libxl_create.c
>> @@ -289,6 +289,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>>                                       false);
>>              libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
>>              libxl_defbool_setdefault(&b_info->u.hvm.spice.vdagent, false);
>> +            libxl_defbool_setdefault(&b_info->u.hvm.spice.usbredirection, false);
>>          }
>>          libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
>> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
>> index bc605e4..4f625e0 100644
>> --- a/tools/libxl/libxl_dm.c
>> +++ b/tools/libxl/libxl_dm.c
>> @@ -471,6 +471,24 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>>                      "virtserialport,chardev=vdagent,name=com.redhat.spice.0",
>>                      NULL);
>>              }
>> +
>> +            if (libxl_defbool_val(b_info->u.hvm.spice.usbredirection)) {
>> +                flexarray_vappend(dm_args, "-device","ich9-usb-ehci1,id=usb,"
>> +                    "bus=pci.0,addr=0x1d.0x7", "-device","ich9-usb-uhci1,"
>> +                    "masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,"
>> +                    "addr=0x1d.0x0", "-device","ich9-usb-uhci2,masterbus=usb.0,"
>> +                    "firstport=2,bus=pci.0,addr=0x1d.0x1", "-device",
>> +                    "ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,"
>> +                    "addr=0x1d.0x2", "-chardev","spicevmc,name=usbredir,"
>> +                    "id=usbrc1","-device","usb-redir,chardev=usbrc1,id=usbrc1,"
>> +                    "bus=usb.0", "-chardev","spicevmc,name=usbredir,id=usbrc2",
>> +                    "-device","usb-redir,chardev=usbrc2,id=usbrc2,bus=usb.0",
>> +                    "-chardev","spicevmc,name=usbredir,id=usbrc3","-device",
>> +                    "usb-redir,chardev=usbrc3,id=usbrc3,bus=usb.0", "-chardev",
>> +                    "spicevmc,name=usbredir,id=usbrc4","-device","usb-redir,"
>> +                    "chardev=usbrc4,id=usbrc4,bus=usb.0", NULL);
>>
>> Any reason for so many hardcoded options?
>>
>> I searched and requested for one year on spice-devel and qemu-devel
>> about alternative methods but nothing found for now.
>> Already tried usb=1 which creates usb1 controller that is not
>> working with usb redirection.
>>
>> What if QEMU upstream changes and these options don't work any more? In
>> that case this functionality is broken and users have no way to
>> workaround it. IMHO unless they are clearly documented we should not
>> consider adding in theses hardcoded options in libxl.
>>
>>
>> Added to cc spice-devel and qemu-devel for ask again if there is a better solution to do this.
>>
>> @spice-devel and qemu-devel:
>> Can someone help to improve qemu options above for enable usb redirection please?
>> Thanks for any reply.
> 
> It's not about "improving" qemu options for usb redirection (even though
> they could use a simplification), it's whether they are guaranteed to be
> stable. Are you sure that a future QEMU release is going to work with
> these options?
> For example, is libvirt using something similar to this?
> 
> Usually QEMU cmdline options are considered a stable interface, so I
> wouldn't worry too much about it.

I'm not sure if pci.0 bus name of i440fx should be considered stable?

Also if at some point you try to use, e.g., q35 rather than i440fx
machine, it might have EHCI by default and the snippet would be
instantiating a duplicate one. I.e., the three levels of dependency
could be separated more clearly: PCI, USB, redirection.

Stating the obvious, a loop would be a more readable solution for adding
4 devices only differing in device/chardev id. ;)

CC'ing Hans.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
  2013-07-04 17:17             ` Andreas Färber
@ 2013-07-04 20:09               ` Paolo Bonzini
  -1 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2013-07-04 20:09 UTC (permalink / raw)
  To: Andreas Färber
  Cc: xen-devel, Wei Liu, Ian.Campbell, Stefano Stabellini,
	Ian.Jackson, qemu-devel, Hans de Goede, Fabio Fantoni,
	spice-devel

Il 04/07/2013 19:17, Andreas Färber ha scritto:
> Also if at some point you try to use, e.g., q35 rather than i440fx
> machine, it might have EHCI by default and the snippet would be
> instantiating a duplicate one. I.e., the three levels of dependency
> could be separated more clearly: PCI, USB, redirection.

At least you could start specifying the USB desired version (1.1, 2.0
with companion controllers, 3.0) as an extension of the "usb=1" that is
already supported.

Paolo

> Stating the obvious, a loop would be a more readable solution for adding
> 4 devices only differing in device/chardev id. ;)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
@ 2013-07-04 20:09               ` Paolo Bonzini
  0 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2013-07-04 20:09 UTC (permalink / raw)
  To: Andreas Färber
  Cc: xen-devel, Wei Liu, Ian.Campbell, Stefano Stabellini,
	Ian.Jackson, qemu-devel, Hans de Goede, Fabio Fantoni,
	spice-devel

Il 04/07/2013 19:17, Andreas Färber ha scritto:
> Also if at some point you try to use, e.g., q35 rather than i440fx
> machine, it might have EHCI by default and the snippet would be
> instantiating a duplicate one. I.e., the three levels of dependency
> could be separated more clearly: PCI, USB, redirection.

At least you could start specifying the USB desired version (1.1, 2.0
with companion controllers, 3.0) as an extension of the "usb=1" that is
already supported.

Paolo

> Stating the obvious, a loop would be a more readable solution for adding
> 4 devices only differing in device/chardev id. ;)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
  2013-07-04 20:09               ` Paolo Bonzini
@ 2013-07-05  8:42                 ` Fabio Fantoni
  -1 siblings, 0 replies; 20+ messages in thread
From: Fabio Fantoni @ 2013-07-05  8:42 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: xen-devel, Wei Liu, Ian.Campbell, Stefano Stabellini,
	Ian.Jackson, qemu-devel, Hans de Goede, spice-devel,
	Andreas Färber

Il 04/07/2013 22:09, Paolo Bonzini ha scritto:
> Il 04/07/2013 19:17, Andreas Färber ha scritto:
>> Also if at some point you try to use, e.g., q35 rather than i440fx
>> machine, it might have EHCI by default and the snippet would be
>> instantiating a duplicate one. I.e., the three levels of dependency
>> could be separated more clearly: PCI, USB, redirection.
> At least you could start specifying the USB desired version (1.1, 2.0
> with companion controllers, 3.0) as an extension of the "usb=1" that is
> already supported.
>
> Paolo

Thanks and sorry, I found only now that is working also with only 
-device usb-ehci,id=usb.
I'll post a new patch version.

>> Stating the obvious, a loop would be a more readable solution for adding
>> 4 devices only differing in device/chardev id. ;)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
@ 2013-07-05  8:42                 ` Fabio Fantoni
  0 siblings, 0 replies; 20+ messages in thread
From: Fabio Fantoni @ 2013-07-05  8:42 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: xen-devel, Wei Liu, Ian.Campbell, Stefano Stabellini,
	Ian.Jackson, qemu-devel, Hans de Goede, spice-devel,
	Andreas Färber

Il 04/07/2013 22:09, Paolo Bonzini ha scritto:
> Il 04/07/2013 19:17, Andreas Färber ha scritto:
>> Also if at some point you try to use, e.g., q35 rather than i440fx
>> machine, it might have EHCI by default and the snippet would be
>> instantiating a duplicate one. I.e., the three levels of dependency
>> could be separated more clearly: PCI, USB, redirection.
> At least you could start specifying the USB desired version (1.1, 2.0
> with companion controllers, 3.0) as an extension of the "usb=1" that is
> already supported.
>
> Paolo

Thanks and sorry, I found only now that is working also with only 
-device usb-ehci,id=usb.
I'll post a new patch version.

>> Stating the obvious, a loop would be a more readable solution for adding
>> 4 devices only differing in device/chardev id. ;)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
  2013-07-05  8:42                 ` Fabio Fantoni
@ 2013-07-05  9:02                   ` Paolo Bonzini
  -1 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2013-07-05  9:02 UTC (permalink / raw)
  To: Fabio Fantoni
  Cc: xen-devel, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, qemu-devel, Hans de Goede, spice-devel,
	Andreas Färber



----- Messaggio originale -----
> Da: "Fabio Fantoni" <fabio.fantoni@m2r.biz>
> A: "Paolo Bonzini" <pbonzini@redhat.com>
> Cc: "Andreas Färber" <afaerber@suse.de>, "Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
> xen-devel@lists.xensource.com, "Wei Liu" <wei.liu2@citrix.com>, "Ian Campbell" <Ian.Campbell@citrix.com>, "Ian
> Jackson" <Ian.Jackson@eu.citrix.com>, qemu-devel@nongnu.org, "Hans de Goede" <hdegoede@redhat.com>,
> spice-devel@lists.freedesktop.org
> Inviato: Venerdì, 5 luglio 2013 10:42:30
> Oggetto: Re: [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
> 
> Il 04/07/2013 22:09, Paolo Bonzini ha scritto:
> > Il 04/07/2013 19:17, Andreas Färber ha scritto:
> >> Also if at some point you try to use, e.g., q35 rather than i440fx
> >> machine, it might have EHCI by default and the snippet would be
> >> instantiating a duplicate one. I.e., the three levels of dependency
> >> could be separated more clearly: PCI, USB, redirection.
> > At least you could start specifying the USB desired version (1.1, 2.0
> > with companion controllers, 3.0) as an extension of the "usb=1" that is
> > already supported.
> >
> > Paolo
> 
> Thanks and sorry, I found only now that is working also with only
> -device usb-ehci,id=usb.
> I'll post a new patch version.

With only the EHCI you might have problems redirecting USB 1.1 devices.
The EHCI+UHCI magic is the right thing to do for USB 2.0 support on x86.

What Andreas and I were suggesting was to split the patch in two parts:
first adding support for USB 2.0/3.0, and only then adding redirection
(perhaps with the possibility to customize how many redirected devices
to support).

Paolo

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
@ 2013-07-05  9:02                   ` Paolo Bonzini
  0 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2013-07-05  9:02 UTC (permalink / raw)
  To: Fabio Fantoni
  Cc: xen-devel, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, qemu-devel, Hans de Goede, spice-devel,
	Andreas Färber



----- Messaggio originale -----
> Da: "Fabio Fantoni" <fabio.fantoni@m2r.biz>
> A: "Paolo Bonzini" <pbonzini@redhat.com>
> Cc: "Andreas Färber" <afaerber@suse.de>, "Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
> xen-devel@lists.xensource.com, "Wei Liu" <wei.liu2@citrix.com>, "Ian Campbell" <Ian.Campbell@citrix.com>, "Ian
> Jackson" <Ian.Jackson@eu.citrix.com>, qemu-devel@nongnu.org, "Hans de Goede" <hdegoede@redhat.com>,
> spice-devel@lists.freedesktop.org
> Inviato: Venerdì, 5 luglio 2013 10:42:30
> Oggetto: Re: [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
> 
> Il 04/07/2013 22:09, Paolo Bonzini ha scritto:
> > Il 04/07/2013 19:17, Andreas Färber ha scritto:
> >> Also if at some point you try to use, e.g., q35 rather than i440fx
> >> machine, it might have EHCI by default and the snippet would be
> >> instantiating a duplicate one. I.e., the three levels of dependency
> >> could be separated more clearly: PCI, USB, redirection.
> > At least you could start specifying the USB desired version (1.1, 2.0
> > with companion controllers, 3.0) as an extension of the "usb=1" that is
> > already supported.
> >
> > Paolo
> 
> Thanks and sorry, I found only now that is working also with only
> -device usb-ehci,id=usb.
> I'll post a new patch version.

With only the EHCI you might have problems redirecting USB 1.1 devices.
The EHCI+UHCI magic is the right thing to do for USB 2.0 support on x86.

What Andreas and I were suggesting was to split the patch in two parts:
first adding support for USB 2.0/3.0, and only then adding redirection
(perhaps with the possibility to customize how many redirected devices
to support).

Paolo

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
  2013-07-05  9:02                   ` Paolo Bonzini
@ 2013-07-05  9:27                     ` Fabio Fantoni
  -1 siblings, 0 replies; 20+ messages in thread
From: Fabio Fantoni @ 2013-07-05  9:27 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: xen-devel, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, qemu-devel, Hans de Goede, spice-devel,
	Andreas Färber

Il 05/07/2013 11:02, Paolo Bonzini ha scritto:
>
> ----- Messaggio originale -----
>> Da: "Fabio Fantoni" <fabio.fantoni@m2r.biz>
>> A: "Paolo Bonzini" <pbonzini@redhat.com>
>> Cc: "Andreas Färber" <afaerber@suse.de>, "Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
>> xen-devel@lists.xensource.com, "Wei Liu" <wei.liu2@citrix.com>, "Ian Campbell" <Ian.Campbell@citrix.com>, "Ian
>> Jackson" <Ian.Jackson@eu.citrix.com>, qemu-devel@nongnu.org, "Hans de Goede" <hdegoede@redhat.com>,
>> spice-devel@lists.freedesktop.org
>> Inviato: Venerdì, 5 luglio 2013 10:42:30
>> Oggetto: Re: [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
>>
>> Il 04/07/2013 22:09, Paolo Bonzini ha scritto:
>>> Il 04/07/2013 19:17, Andreas Färber ha scritto:
>>>> Also if at some point you try to use, e.g., q35 rather than i440fx
>>>> machine, it might have EHCI by default and the snippet would be
>>>> instantiating a duplicate one. I.e., the three levels of dependency
>>>> could be separated more clearly: PCI, USB, redirection.
>>> At least you could start specifying the USB desired version (1.1, 2.0
>>> with companion controllers, 3.0) as an extension of the "usb=1" that is
>>> already supported.
>>>
>>> Paolo
>> Thanks and sorry, I found only now that is working also with only
>> -device usb-ehci,id=usb.
>> I'll post a new patch version.
> With only the EHCI you might have problems redirecting USB 1.1 devices.
> The EHCI+UHCI magic is the right thing to do for USB 2.0 support on x86.
>
> What Andreas and I were suggesting was to split the patch in two parts:
> first adding support for USB 2.0/3.0, and only then adding redirection
> (perhaps with the possibility to customize how many redirected devices
> to support).
>
> Paolo
What is the best parameters for adding usb2 controller, those who had 
already done?

About usb1 controller implementation parameter in xen is only with -usb, 
is correct or need something better?

About usb3 controller implementation what is the best parameters?

About possibility to customize how many redirection channel I'll do it, 
if I remember good on Hans post on spice-devel I seen that max working 
is 4, is correct?

About different usb controller implementation on xen can be good change 
xl parameter usb from 0|1 (usb1 controller added or not) to 0|1|2|3 
where 0 is none, 1 is usb1, 2 is usb2 and 3 is usb3 or is better keep 
usb=0|1 and add usb_version=1|2|3 parameter?

Thanks for any reply and sorry for my bad english.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
@ 2013-07-05  9:27                     ` Fabio Fantoni
  0 siblings, 0 replies; 20+ messages in thread
From: Fabio Fantoni @ 2013-07-05  9:27 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: xen-devel, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, qemu-devel, Hans de Goede, spice-devel,
	Andreas Färber

Il 05/07/2013 11:02, Paolo Bonzini ha scritto:
>
> ----- Messaggio originale -----
>> Da: "Fabio Fantoni" <fabio.fantoni@m2r.biz>
>> A: "Paolo Bonzini" <pbonzini@redhat.com>
>> Cc: "Andreas Färber" <afaerber@suse.de>, "Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
>> xen-devel@lists.xensource.com, "Wei Liu" <wei.liu2@citrix.com>, "Ian Campbell" <Ian.Campbell@citrix.com>, "Ian
>> Jackson" <Ian.Jackson@eu.citrix.com>, qemu-devel@nongnu.org, "Hans de Goede" <hdegoede@redhat.com>,
>> spice-devel@lists.freedesktop.org
>> Inviato: Venerdì, 5 luglio 2013 10:42:30
>> Oggetto: Re: [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
>>
>> Il 04/07/2013 22:09, Paolo Bonzini ha scritto:
>>> Il 04/07/2013 19:17, Andreas Färber ha scritto:
>>>> Also if at some point you try to use, e.g., q35 rather than i440fx
>>>> machine, it might have EHCI by default and the snippet would be
>>>> instantiating a duplicate one. I.e., the three levels of dependency
>>>> could be separated more clearly: PCI, USB, redirection.
>>> At least you could start specifying the USB desired version (1.1, 2.0
>>> with companion controllers, 3.0) as an extension of the "usb=1" that is
>>> already supported.
>>>
>>> Paolo
>> Thanks and sorry, I found only now that is working also with only
>> -device usb-ehci,id=usb.
>> I'll post a new patch version.
> With only the EHCI you might have problems redirecting USB 1.1 devices.
> The EHCI+UHCI magic is the right thing to do for USB 2.0 support on x86.
>
> What Andreas and I were suggesting was to split the patch in two parts:
> first adding support for USB 2.0/3.0, and only then adding redirection
> (perhaps with the possibility to customize how many redirected devices
> to support).
>
> Paolo
What is the best parameters for adding usb2 controller, those who had 
already done?

About usb1 controller implementation parameter in xen is only with -usb, 
is correct or need something better?

About usb3 controller implementation what is the best parameters?

About possibility to customize how many redirection channel I'll do it, 
if I remember good on Hans post on spice-devel I seen that max working 
is 4, is correct?

About different usb controller implementation on xen can be good change 
xl parameter usb from 0|1 (usb1 controller added or not) to 0|1|2|3 
where 0 is none, 1 is usb1, 2 is usb2 and 3 is usb3 or is better keep 
usb=0|1 and add usb_version=1|2|3 parameter?

Thanks for any reply and sorry for my bad english.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
  2013-07-05  9:27                     ` Fabio Fantoni
@ 2013-07-05 10:18                       ` Paolo Bonzini
  -1 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2013-07-05 10:18 UTC (permalink / raw)
  To: Fabio Fantoni
  Cc: xen-devel, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, qemu-devel, Hans de Goede, spice-devel,
	Andreas Färber

Il 05/07/2013 11:27, Fabio Fantoni ha scritto:
>>
> What is the best parameters for adding usb2 controller, those who had
> already done?
> 
> About usb1 controller implementation parameter in xen is only with -usb,
> is correct or need something better?

-usb is USB 1.0 on pc and USB 2.0 on q35.

The device name for USB 1.0 is piix3-usb-uhci.

> About usb3 controller implementation what is the best parameters?

The device name is nec-usb-xhci.

Only USB 2.0 has the complication of companion controllers.

> About possibility to customize how many redirection channel I'll do it,
> if I remember good on Hans post on spice-devel I seen that max working
> is 4, is correct?

I don't know.

Paolo

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Xen-devel] [PATCH] libxl: Spice usbredirection support for upstream qemu
@ 2013-07-05 10:18                       ` Paolo Bonzini
  0 siblings, 0 replies; 20+ messages in thread
From: Paolo Bonzini @ 2013-07-05 10:18 UTC (permalink / raw)
  To: Fabio Fantoni
  Cc: xen-devel, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, qemu-devel, Hans de Goede, spice-devel,
	Andreas Färber

Il 05/07/2013 11:27, Fabio Fantoni ha scritto:
>>
> What is the best parameters for adding usb2 controller, those who had
> already done?
> 
> About usb1 controller implementation parameter in xen is only with -usb,
> is correct or need something better?

-usb is USB 1.0 on pc and USB 2.0 on q35.

The device name for USB 1.0 is piix3-usb-uhci.

> About usb3 controller implementation what is the best parameters?

The device name is nec-usb-xhci.

Only USB 2.0 has the complication of companion controllers.

> About possibility to customize how many redirection channel I'll do it,
> if I remember good on Hans post on spice-devel I seen that max working
> is 4, is correct?

I don't know.

Paolo

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2013-07-05 10:18 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-04 10:05 [PATCH] libxl: Spice usbredirection support for upstream qemu Fabio Fantoni
2013-07-04 10:12 ` Wei Liu
2013-07-04 10:16   ` Fabio Fantoni
2013-07-04 10:32     ` Wei Liu
2013-07-04 12:04       ` [Qemu-devel] [Xen-devel] " Fabio Fantoni
2013-07-04 12:04         ` Fabio Fantoni
2013-07-04 12:46         ` [Qemu-devel] [Xen-devel] " Stefano Stabellini
2013-07-04 12:46           ` Stefano Stabellini
2013-07-04 17:17           ` [Qemu-devel] " Andreas Färber
2013-07-04 17:17             ` Andreas Färber
2013-07-04 20:09             ` [Qemu-devel] " Paolo Bonzini
2013-07-04 20:09               ` Paolo Bonzini
2013-07-05  8:42               ` [Qemu-devel] " Fabio Fantoni
2013-07-05  8:42                 ` Fabio Fantoni
2013-07-05  9:02                 ` [Qemu-devel] " Paolo Bonzini
2013-07-05  9:02                   ` Paolo Bonzini
2013-07-05  9:27                   ` [Qemu-devel] " Fabio Fantoni
2013-07-05  9:27                     ` Fabio Fantoni
2013-07-05 10:18                     ` [Qemu-devel] " Paolo Bonzini
2013-07-05 10:18                       ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.