Commit Graph

27 Commits

Author SHA1 Message Date
3d40ab6ccb devicemapper: Create a method to get device info with deferred remove field
Deferred reove functionality was added to library later. So in old version
of library it did not report deferred_remove field. 

Create a new function which also gets deferred_remove field and it will be
called only on newer version of library. 

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 4986ce7cfbe74610d4fa2c4e79ceefe49c1aa155
Component: engine
2015-04-21 18:14:59 -04:00
f0bbbffba0 devicemapper: Create helpers to cancel deferred deactivation
If a device has been scheduled for deferred deactivation and container
is started again and we need to activate device again, we need to cancel
the deferred deactivation which is already scheduled on the device.

Create a method for the same.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 20b38f427aa05186bd09c8c4201dcc95ed56aa46
Component: engine
2015-04-21 18:14:59 -04:00
2651813036 devicemapper: Add helper functions to allow deferred device removal
A lot of time device mapper devices leak across mount namespace which docker
does not know about and when docker tries to deactivate/delete device,
operation fails as device is open in some mount namespace.

Create a mechanism where one can defer the device deactivation/deletion
so that docker operation does not fail and device automatically goes
away when last reference to it is dropped.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 6964ab94befd8723585556e560219e0eef48a488
Component: engine
2015-04-21 18:14:59 -04:00
5b01c8abc0 devmapper: Use a pointer as argument to deferred function UdevWait()
UdevWait() is deferred and takes uint cookie as an argument. As arguments
to deferred functions are calculated at the time of call, it is possible
that any update to cookie later by libdm are not taken into account when
UdevWait() is called. Hence use a pointer to uint as argument to UdevWait()
function.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 665656afbb8932a11c69c0cd79e21a768aa46d38
Component: engine
2015-04-02 16:47:14 -04:00
cb8a2764e5 devicemapper: Remove debug messages from RemoveDevice()
devmapper graph driver retries device removal 1000 times in case of failure
and if this fills up console with 1000 messages (when daemon is running in
debug mode). So remove these debug messages.
 
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: cb7c893275c32ddfa775c3f22869a9c211024c71
Component: engine
2015-04-02 16:47:14 -04:00
35d3543e9d Merge pull request #11871 from NinjaTrappeur/dry-run-test
Fix vet warning in devicemapper.
Upstream-commit: cc609c75560f39bfa2a34d2ea0e4be292d851954
Component: engine
2015-03-27 14:48:55 -07:00
7ec8e95afe Fix vet warning in devicemapper.
Issue #11828

Signed-off-by: Félix Baylac-Jacqué <baylac.felix@gmail.com>
Upstream-commit: 6b764bba8ad1c1006dadf24ec55edb9de200c706
Component: engine
2015-03-27 20:16:25 +01:00
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
6200bccb4a Removed redundant elses
Signed-off-by: Anes Hasicic <anes.hasicic@gmail.com>
Upstream-commit: 1b6065de8f46edc8f36f6b3734fe64175e413dc3
Component: engine
2015-03-25 23:34:00 +01:00
5506a9a27c Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 89bdaa35e04b74b7c6528783e0f7b8154b2a3d31
Component: engine
2015-03-06 18:21:51 -08:00
dbb2daa29d Merge pull request #10197 from vbatts/vbatts-dm_cookie_support
devicemapper: API for cookie support
Upstream-commit: c81fb7fa4a41dfdc21eb37dade0eb71bd1dfa855
Component: engine
2015-01-27 11:44:03 -08:00
f11f701e04 Merge pull request #10222 from vbatts/vbatts-dm_flag_and_output
dm flag and output
Upstream-commit: 9b2afa04f8ab491d56614835de09eb0880250309
Component: engine
2015-01-20 18:45:43 -05:00
3757727dfa devicemapper: define device-mapper log levels
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: a687e8d86ba07ebb42d988b6e13102569b60e673
Component: engine
2015-01-20 13:31:12 -05:00
b85d65e0eb devicemapper: API for checking cookie support
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: cb81ed34a52420528281ccaa99e16c472f4f533a
Component: engine
2015-01-19 20:35:20 -05:00
279519e07d devicemapper: debug output specifics
moar information for the information gods

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 4cfe9df0a9c206c368a90f460fea8fab197265d9
Component: engine
2015-01-19 17:21:10 -05:00
2622e003cc devicemapper: define the fallback flag
DM_UDEV_DISABLE_LIBRARY_FALLBACK is disabled by most applications today
when using device-mapper, and ensuring that device-mapper is in sync
with udev. This flag instructs devicemapper to not fallback to creating
the device nodes itself. In the case of udev sync not being supported,
devicemapper will attempt to create the devices in a timely manner,
regardless of udev.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: dbb642b7fbdf42d3b401d610403ba58ebbde38d7
Component: engine
2015-01-19 17:06:53 -05:00
b3b9656da1 devicemapper: dm_udev_get_sync_support
expose an api to call dm_udev_get_sync_support/dm_udev_set_sync_support

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 9c3380039e15f11fc07741edd4cbc0c7e5c490aa
Component: engine
2015-01-19 15:15:51 -05:00
eb11479882 devmapper: Use device id as specified by caller
Currently devicemapper CreateDevice and CreateSnapDevice keep on retrying
device creation till a suitable device id is found. 

With new transaction mechanism we need to store device id in transaction
before it has been created.

So change the logic in such a way that caller decides the devices Id to
use. If that device Id is not available, caller bumps up the device Id
and retries.

That way caller can update transaciton too when it tries a new Id. Transaction
related patches will come later in the series.
  
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 7b2b15d3e9f9b7ad898a36bbe5ceb42c9ca58d47
Component: engine
2014-12-03 13:06:43 -05:00
7b6399d928 Merge pull request #9006 from snitm/thin-pool-improvements
Thin pool improvements
Upstream-commit: b47ff77b5ce852bd830bc617d1c4e2c37e346281
Component: engine
2014-11-26 14:44:09 -05:00
e029685ee4 pkg/devicemapper: clarify TaskCreate and createTask
* Rename and expose createTask() to TaskCreateNamed()
* add comments

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: acdf766069f8e8c65fd3de3ce4f8efc15f421abd
Component: engine
2014-11-21 20:54:50 -05:00
75da15eccc devmapper: Call UdevWait() even in failure path
Currently we set up a cookie and upon failure not call UdevWait(). This
does not cleanup the cookie and associated semaphore and system will
soon max out on total number of semaphores.

To avoid this, call UdevWait() even in failure path which in turn will
cleanup associated semaphore.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: edc6df256d21eb1d1aa36b241dcc6d4b83d58d75
Component: engine
2014-11-15 09:41:27 -05:00
4faf5170e1 Merge pull request #9164 from vbatts/vbatts-dm_removedevice
pkg/devicemapper: cleanup removeDevice differences
Upstream-commit: c89062bafc2262c5efeee905bafb72be57873478
Component: engine
2014-11-14 16:56:02 -08:00
b34358b506 pkg/devicemapper: defer udev wait during removal
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: cef27e1d6c0bd302e1c58e9478a0fba99fd3a2d0
Component: engine
2014-11-14 15:17:33 -05:00
6149f196a8 pkg/devicemapper: missed MAINTAINERS on split
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 3ec623ee2fc503a6236a7b0edde5dd6abb967e49
Component: engine
2014-11-14 11:12:23 -05:00
4798207faf pkg/devicemapper: cleanup removeDevice differences
Fixes failure on RemoveDevice when host is AUFS, and running
devicemapper test docker-in-docker

https://gist.github.com/tonistiigi/59559cbfb3f2df26b29c

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: c9a76622086cf6019b3ec71ae53fc71c0396a1ef
Component: engine
2014-11-13 22:43:03 -05:00
3b01a00fa3 devmapper: use proper DM_UDEV_DISABLE_*_FLAG when creating the thin-pool
Otherwise udev can unecessarily execute various rules (and issue
scanning IO, etc) against the thin-pool -- which can never be a
top-level device.

Docker-DCO-1.1-Signed-off-by: Mike Snitzer <snitzer@redhat.com> (github: snitm)
Upstream-commit: ad6467f9e17205fa76a3b916efe51ba5c1b37506
Component: engine
2014-11-12 21:03:04 -05:00
5bc67250c6 devicemapper: split out devicemapper bindings
This is a first pass at splitting out devicemapper into separate, usable
bindings.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: e2f8fbfbcc450432536e387777b1ff080c94a948
Component: engine
2014-11-05 18:10:38 -05:00