List indexes where mixed up in the code looping over the USB
input devices.
if (VIR_EXPAND_N(b_info->u.hvm.usbdevice_list, nusbdevice, 1) < 0)
return -1;
#else
- if (i > 1) {
+ nusbdevice++;
+ if (nusbdevice > 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("libxenlight supports only one input device"));
return -1;
#endif
#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
- usbdevice = &b_info->u.hvm.usbdevice_list[i];
+ usbdevice = &b_info->u.hvm.usbdevice_list[nusbdevice - 1];
#else
usbdevice = &b_info->u.hvm.usbdevice;
#endif