Commit Graph

21 Commits

Author SHA1 Message Date
0f96e98e12 Various code-cleanup
remove unnescessary import aliases, brackets, and so on.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f23c00d8701e4bd0f2372a586dacbf66a26f9a51
Component: engine
2018-05-23 17:50:54 +02:00
be83c11fb0 Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4f0d95fa6ee7f865597c03b9e63702cdcb0f7067
Component: engine
2018-02-05 16:51:57 -05:00
3366bf6a8a Dockerfile*: bump devmapper library version
Let's use latest lvm2 sources to compile the libdevmapper library.

Initial reason for compiling devmapper lib from sources was a need to
have the static version of the library at hand, in order to build
the static dockerd, but note that the same headers/solib are used
for dynamic build (dynbinary) as well.

The reason for this patch is to enable the deferral removal feature.
The supplied devmapper library (and headers) are too old, lacking the
needed functions, so the daemon is built with 'libdm_no_deferred_remove'
build tag (see the check in hack/make.sh). Because of this, even if the
kernel dm driver is perfectly able to support the feature, it can not
be used. For more details and background story, see [1].

Surely, one can't just change the version number. While at it:
 - improve the comments;
 - remove obsoleted URLs;
 - remove s390 and ppc configure updates that are no longer needed;
 - use pkg-config instead of hardcoding the flags (newer lib added
   some more dependencies);

 [1] https://github.com/moby/moby/issues/34298

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: c4fde49a5c0198890078e4c5f7566b387884fe0f
Component: engine
2017-08-01 22:08:24 -07:00
59f36f3793 devmapper_wrapper.go: fix gcc warning
I am getting the following warning from gcc when compiling the daemon:

> # github.com/docker/docker/pkg/devicemapper
> pkg/devicemapper/devmapper_wrapper.go: In function ‘log_cb’:
> pkg/devicemapper/devmapper_wrapper.go:20:2: warning: ignoring return
> value of ‘vasprintf’, declared with attribute warn_unused_result
> [-Wunused-result]
>  vasprintf(&buffer, f, ap);
>  ^

vasprintf(3) man page says if the function returns -1, the buffer is
undefined, so we should not use it. In practice, I assume, this never
happens so we just return.

Introduced by https://github.com/moby/moby/pull/33845 that resulted in
commit 63328c6 ("devicemapper: remove 256 character limit of libdm logs")

Cc: Aleksa Sarai <asarai@suse.de>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 7da12bcfa9db4d84b2c547bee93dafeaead15b16
Component: engine
2017-07-17 17:46:44 -07:00
01199b4ca4 devicemapper: actually remove DmLogInitVerbose
e07d3cd9a ("devmapper: Fix libdm logging") removed all of the callers of
DmLogInitVerbose, but we still kept around the wrapper. However, the
libdm dm_log_init_verbose API changes the verbosity of the *default*
libdm logger. Because pkg/devicemapper internally *relies* on using
logging callbacks to understand what errors were encountered by libdm,
this wrapper is useless (it only makes sense for the default logger
which we do not user).

Any user not inside Docker of this function almost certainly was not
using this API correctly, because pkg/devicemapper will misbehave if our
logging callbacks were not registered.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: c654147f0635736fff0035ecdfa53a41c7fad0d0
Component: engine
2017-07-04 02:04:26 +10:00
9421df98fb devicemapper: remove 256 character limit of libdm logs
This limit is unecessary and can lead to the truncation of long libdm
logs (which is quite annoying).

Fixes: b440ec013 ("device-mapper: Move all devicemapper spew to log through utils.Debugf().")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 63328c6882c3d1f54c66499ef9963adfbf1883f0
Component: engine
2017-07-04 02:04:26 +10:00
ebb760e3cd Make pkg/devicemapper and pkg/loopback depend on cgo in build tags
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 85357a1167f22be9606b770a872339df459af490
Component: engine
2017-03-29 17:55:42 -07:00
8b5a2050f9 loopback: separate loop logic from devicemapper
The loopback logic is not technically exclusive to the devicemapper
driver. This reorganizes the code such that the loopback code is usable
outside of the devicemapper package and driver.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: af597527121c0ad973e9d0ae4f9cf970da1513cc
Component: engine
2015-12-18 10:57:43 -05:00
e963d775a7 devicemapper: remove unused type mapping
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: a292c04c01cbe4a6c9f74e7cf3b0315249ed8993
Component: engine
2015-12-18 10:44:06 -05:00
376a910561 Remove (?) from comments in pkg/devicemapper
Got merged with it, removing it as it doesn't add anything.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 1dcb7d9e40d0ee5f9ab068fed55d3072246ce8ec
Component: engine
2015-09-30 10:35:02 +02:00
05ac4217a0 Lint package pkg/devicemapper
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6990b76a696dd265674f4c2973f25755a6485f05
Component: engine
2015-09-05 23:15:13 +02:00
48bf8fcaf6 devicemapper: fix zero-sized field access
Fixes: #15279

Due to
7904946eeb
the devices field is dropped.

This solution works on go1.4 and go1.5

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: f83d05c3be3c3bcc84f6fa229504848ee8078321
Component: engine
2015-08-10 11:11:58 -04:00
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
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
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
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
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
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
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