qemu-usb: handle Interface_not_found exceptions

Fix genodelabs/genode#4572
This commit is contained in:
Stefan Kalkowski 2022-06-30 09:52:42 +02:00 committed by Christian Helmuth
parent 560747c22e
commit 48eacb6f79

View File

@ -270,6 +270,7 @@ struct Usb_host_device : List<Usb_host_device>::Element
for (unsigned i = 0; i < cdescr.num_interfaces; i++) {
try { usb_raw.release_interface(i); }
catch (Usb::Session::Device_not_found) { return; }
catch (Usb::Session::Interface_not_found) { return; }
}
}
@ -287,7 +288,7 @@ struct Usb_host_device : List<Usb_host_device>::Element
usb_raw.claim_interface(i);
} catch (Usb::Session::Interface_already_claimed) {
result = false;
}
} catch (Usb::Session::Interface_not_found) { }
}
if (!result) error("device already claimed");
@ -675,6 +676,7 @@ struct Usb_host_device : List<Usb_host_device>::Element
catch (Usb::Session::Device_not_found) { return; }
for (unsigned i = 0; i < cdescr.num_interfaces; i++) {
try {
Usb::Interface_descriptor iface;
uint8_t const altsetting = udev->altsetting[i];
usb_raw.interface_descriptor(i, altsetting, &iface);
@ -691,6 +693,7 @@ struct Usb_host_device : List<Usb_host_device>::Element
usb_ep_set_ifnum(udev, pid, ep, i);
usb_ep_set_halted(udev, pid, ep, 0);
}
} catch (Usb::Session::Interface_not_found) { }
}
}
};