diff options
author | Kari Oikarinen <kari.oikarinen@qt.io> | 2017-03-15 16:40:19 +0200 |
---|---|---|
committer | Kari Oikarinen <kari.oikarinen@qt.io> | 2017-05-02 13:21:24 +0000 |
commit | 842e0c9a9e95c7e8b0b02791f620fd859477d2e1 (patch) | |
tree | 7f38a232301583027724508615f079a7363eb2d7 /qdb/server/devicemanager.h | |
parent | cac1d51ed38a3aa2db7d61fee3ab3245ab99f588 (diff) |
Keep track of used subnets
If we don't keep track of them, inserting two devices at the same time
can lead to both picking the same candidate. This happens if the host
does not get an IP in time and thus the network is still free from host
perspective as the second call looks for the subnet to use.
The tracking is done by UsbDevice and DeviceInformation keeping a
SubnetReservation. The SubnetReservation is gotten from
findUnusedSubnet(), which uses a SubnetPool singleton to keep track of
them. When the SubnetReservations are destructed, they call SubnetPool
to free the subnet the reserved.
Task-number: QTBUG-59449
Change-Id: I4b28ade4fa7a5660bd699882398facafafc9d795
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Diffstat (limited to 'qdb/server/devicemanager.h')
-rw-r--r-- | qdb/server/devicemanager.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/qdb/server/devicemanager.h b/qdb/server/devicemanager.h index e5f52b2..00b6239 100644 --- a/qdb/server/devicemanager.h +++ b/qdb/server/devicemanager.h @@ -34,6 +34,7 @@ struct DeviceInformation QString hostMac; QString ipAddress; UsbAddress usbAddress; + SubnetReservation reservation; }; class DeviceManager : public QObject |