Rework device removal to have a nice API

This enhances the device removal to create a well defined behaviour.

Primarily, it means that:
 * "device-removed" will only be called for closed devices
 * "removed" will be called only when no operation is active

Note that all actions will fail with FP_DEVICE_ERROR_REMOVED, *except*
for open which will only return this error if it failed.

Resolves: #330
This commit is contained in:
Benjamin Berg
2020-11-13 16:44:46 +01:00
parent 656bf3d175
commit b6dd522459
6 changed files with 205 additions and 9 deletions

View File

@@ -29,6 +29,7 @@ typedef struct
GUsbDevice *usb_device;
const gchar *virtual_env;
gboolean is_removed;
gboolean is_open;
gchar *device_id;