|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v6 2/2] xl: Add commands for usb hot-plug
On Thu, 2013-04-25 at 11:16 +0100, George Dunlap wrote:
> >> + for (i = 0; i < num; i++) {
> >> + printf("%8s ",
> >> (dev[i].protocol==LIBXL_USB_PROTOCOL_PV)?"pv":"dm");
> >
> > You can use libxl_usb_protocol_to_string here.
>
> Could do, but I didn't necessarily want the long version ("devicemodel").
TBH the more I think about it the more I think DM/DEVICEMODEL in this
interface is leaking an implementation detail, after all the user
doesn't really care who/what is emulating a USB controller.
Protocol = {PV,OHCI,XHCI}?
> >
> >> + printf("%7d ", dev[i].backend_domid);
> >> + printf("%7s ",
> >> (dev[i].type==LIBXL_DEVICE_USB_TYPE_HOSTDEV)?"hostdev":"unknown");
> >
> > libxl_device_usb_type_to_string.
>
> Will that print "unknown" in the case of unknown device types?
It'll return NULL for unknowns (except for any defined unknowns, so I
suppose it returns NULL for unknown unknowns, cf [0]), so:
libxl_device_usb_type_to_string(type) ? : "<unknown>"
Ian.
[0] http://en.wikipedia.org/wiki/There_are_known_knowns
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |