devmapper: docker info devices hard coded

If `--storage-opt dm.datadev=/dev/loop0 --storage-opt
dm.metadatadev=/dev/loop1 ` were provided, the information was not
reflected in the information output.

Closes: #7137

Signed-off-by: Vincent Batts <vbatts@redhat.com>
This commit is contained in:
Vincent Batts 2014-09-22 16:40:20 -04:00
parent db5edfb748
commit 7e9ba22dc3

View file

@ -1134,8 +1134,16 @@ func (devices *DeviceSet) Status() *Status {
status := &Status{}
status.PoolName = devices.getPoolName()
status.DataLoopback = path.Join(devices.loopbackDir(), "data")
status.MetadataLoopback = path.Join(devices.loopbackDir(), "metadata")
if len(devices.dataDevice) > 0 {
status.DataLoopback = devices.dataDevice
} else {
status.DataLoopback = path.Join(devices.loopbackDir(), "data")
}
if len(devices.metadataDevice) > 0 {
status.MetadataLoopback = devices.metadataDevice
} else {
status.MetadataLoopback = path.Join(devices.loopbackDir(), "metadata")
}
totalSizeInSectors, _, dataUsed, dataTotal, metadataUsed, metadataTotal, err := devices.poolStatus()
if err == nil {