From: Fabio Fantoni <fabio.fantoni@m2r.biz>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: George.Dunlap@eu.citrix.com, xen-devel@lists.xensource.com,
Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH v7] libxl: usb2 and usb3 controller support for upstream qemu
Date: Fri, 15 Nov 2013 11:33:26 +0100 [thread overview]
Message-ID: <5285F876.2080405@m2r.biz> (raw)
In-Reply-To: <alpine.DEB.2.02.1311121248510.26077@kaball.uk.xensource.com>
Il 12/11/2013 13:49, Stefano Stabellini ha scritto:
> On Tue, 8 Oct 2013, Fabio Fantoni wrote:
>> Usage: usbversion=1|2|3 (default=0, no usb controller defined)
>> Specifies the type of an emulated USB bus in the guest. 1 for usb1,
>> 2 for usb2 and 3 for usb3, it is available only with upstream qemu.
>> The old usb and usbdevice parameters cannot be used with this.
>>
>> Changes from v6:
>> - now usbversion cannot be used with usb and usbdevice parameters
>> - now default is 0 (no usb controller defined)
>> Will be used only with usb redirection (from spice client) and
>> new usb passthrough (from dom0) with hotplug.
>>
>> Changes from v5:
>> changed usb2 controller qemu parameters:
>> - removed bus
>> - added multifunction on all devices
>>
>> Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
> This also looks OK from the QEMU arguments POV.
Thanks for reply, could someone review it and give approval for xen 4.4
if possible?
>
>
>> docs/man/xl.cfg.pod.5 | 7 +++++++
>> tools/libxl/libxl.h | 14 ++++++++++++++
>> tools/libxl/libxl_create.c | 9 +++++++++
>> tools/libxl/libxl_dm.c | 24 ++++++++++++++++++++++++
>> tools/libxl/libxl_types.idl | 1 +
>> tools/libxl/xl_cmdimpl.c | 2 ++
>> 6 files changed, 57 insertions(+)
>>
>> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
>> index 751de69..76dd546 100644
>> --- a/docs/man/xl.cfg.pod.5
>> +++ b/docs/man/xl.cfg.pod.5
>> @@ -1176,6 +1176,13 @@ device.
>>
>> Enables or disables an emulated USB bus in the guest.
>>
>> +=item B<usbversion=NUMBER>
>> +
>> +Specifies the type of an emulated USB bus in the guest. 1 for usb1,
>> +2 for usb2 and 3 for usb3, it is available only with upstream qemu.
>> +The old usb and usbdevice parameters cannot be used with this.
>> +Default is 0 (no usb controller defined).
>> +
>> =item B<usbdevice=[ "DEVICE", "DEVICE", ...]>
>>
>> Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
>> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
>> index 4cab294..b70b44b 100644
>> --- a/tools/libxl/libxl.h
>> +++ b/tools/libxl/libxl.h
>> @@ -305,6 +305,20 @@
>> #define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
>>
>> /*
>> + * LIBXL_HAVE_BUILDINFO_USBVERSION
>> + *
>> + * If this is defined, then the libxl_domain_build_info structure will
>> + * contain hvm.usbversion, a integer type that contains a USB
>> + * controller version to specify on the qemu upstream command-line.
>> + *
>> + * If it is set, callers may use hvm.usbversion to specify if the usb
>> + * controller is usb1, usb2 or usb3.
>> + *
>> + * If this is not defined, the hvm.usbversion field does not exist.
>> + */
>> +#define LIBXL_HAVE_BUILDINFO_USBVERSION 1
>> +
>> +/*
>> * LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
>> *
>> * If this is defined, libxl_device_* structures containing a backend_domid
>> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
>> index 07ec4db..ee26049 100644
>> --- a/tools/libxl/libxl_create.c
>> +++ b/tools/libxl/libxl_create.c
>> @@ -262,6 +262,15 @@ 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);
>>
>> + if (b_info->u.hvm.usbversion &&
>> + ( libxl_defbool_val(b_info->u.hvm.usb)
>> + || b_info->u.hvm.usbdevice_list
>> + || b_info->u.hvm.usbdevice) ){
>> + LOG(ERROR,"usbversion cannot be enabled with usb or"
>> + "usbdevice parameters.");
>> + return ERROR_INVAL;
>> + }
>> +
>> if (!b_info->u.hvm.boot) {
>> b_info->u.hvm.boot = strdup("cda");
>> if (!b_info->u.hvm.boot) return ERROR_NOMEM;
>> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
>> index a629708..2dd5dc1 100644
>> --- a/tools/libxl/libxl_dm.c
>> +++ b/tools/libxl/libxl_dm.c
>> @@ -535,6 +535,30 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>> *p, NULL);
>> }
>> }
>> + } else if (b_info->u.hvm.usbversion) {
>> + switch (b_info->u.hvm.usbversion) {
>> + case 1:
>> + flexarray_vappend(dm_args,
>> + "-device", "piix3-usb-uhci,id=usb", NULL);
>> + break;
>> + case 2:
>> + flexarray_append_pair(dm_args, "-device",
>> + "ich9-usb-ehci1,id=usb,addr=0x1d.0x7,multifunction=on");
>> + for (i = 1; i < 4; i++)
>> + flexarray_append_pair(dm_args, "-device",
>> + GCSPRINTF("ich9-usb-uhci%d,masterbus=usb.0,"
>> + "firstport=%d,addr=0x1d.%#x,multifunction=on",
>> + i, 2*(i-1), i-1));
>> + break;
>> + case 3:
>> + flexarray_vappend(dm_args,
>> + "-device", "nec-usb-xhci,id=usb", NULL);
>> + break;
>> + default:
>> + LOG(ERROR, "%s: usbversion parameter is invalid, "
>> + "must be between 1 and 3", __func__);
>> + return NULL;
>> + }
>> }
>> if (b_info->u.hvm.soundhw) {
>> flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
>> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
>> index 90dad32..c589a67 100644
>> --- a/tools/libxl/libxl_types.idl
>> +++ b/tools/libxl/libxl_types.idl
>> @@ -339,6 +339,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
>> ("serial", string),
>> ("boot", string),
>> ("usb", libxl_defbool),
>> + ("usbversion", integer),
>> # usbdevice:
>> # - "tablet" for absolute mouse,
>> # - "mouse" for PS/2 protocol relative mouse
>> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
>> index e016615..759bd7f 100644
>> --- a/tools/libxl/xl_cmdimpl.c
>> +++ b/tools/libxl/xl_cmdimpl.c
>> @@ -1538,6 +1538,8 @@ skip_vfb:
>> xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
>> xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
>> xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
>> + if (!xlu_cfg_get_long (config, "usbversion", &l, 0))
>> + b_info->u.hvm.usbversion = l;
>> switch (xlu_cfg_get_list_as_string_list(config, "usbdevice",
>> &b_info->u.hvm.usbdevice_list,
>> 1))
>> --
>> 1.7.9.5
>>
next prev parent reply other threads:[~2013-11-15 10:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-08 13:45 [PATCH v7] libxl: usb2 and usb3 controller support for upstream qemu Fabio Fantoni
2013-11-12 12:49 ` Stefano Stabellini
2013-11-15 10:33 ` Fabio Fantoni [this message]
2013-11-15 15:03 ` George Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5285F876.2080405@m2r.biz \
--to=fabio.fantoni@m2r.biz \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.