Skip to contentSkip to conversation

usb-host: reset and close libusb_device_handle before qemu exit

PATCH Superseded linzhecheng 2 participants 2 messages Nov 30, 2018 – Dec 10, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb-host: reset and close libusb_device_handle before qemu exit

we should perform these things as same as usb_host_close.

hw/usb/host-libusb.c +2 -0
index b6602ded4e..2016375e6b 100644
@@ -988,7 +988,9 @@ static void usb_host_exit_notifier(struct Notifier *n, void *data)
 
     if (s->dh) {
         usb_host_release_interfaces(s);
+	libusb_reset_device(s->dh);
         usb_host_attach_kernel(s);
+	libusb_close(s->dh);
     }
 }
 
Signature · 1 line
2.12.2.windows.2
#1 lore raw
Quoted 9 lines · linzhecheng

we should perform these things as same as usb_host_close.

hw/usb/host-libusb.c +0 -0
index b6602ded4e..2016375e6b 100644

hw/usb/host-libusb.c static void usb_host_exit_notifier(struct Notifier *n, void *data) · line 993

Quoted 6 lines
hw/usb/host-libusb.c +2 -0
@@ -988,7 +988,9 @@ static void usb_host_exit_notifier(struct Notifier *n, void *data)
 
     if (s->dh) {
         usb_host_release_interfaces(s);
+	libusb_reset_device(s->dh);
         usb_host_attach_kernel(s);
+	libusb_close(s->dh);

qemu codesstyle uses spaces not tabs, please update your editor settings.

Fixed and added to usb queue.

thanks,
Gerd