mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Limit the amount of prints during normal runs
This removes some Debugf() calls and chages some direct prints to Debugf(). This means we don't get a bunch of spew when running the tests.
This commit is contained in:
parent
d47c18c5fb
commit
bc7fa7b957
3 changed files with 8 additions and 11 deletions
|
@ -1,6 +1,7 @@
|
||||||
package devmapper
|
package devmapper
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/dotcloud/docker/utils"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
@ -184,7 +185,7 @@ func (devices *DeviceSetDM) ensureImage(name string, size int64) (string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (devices *DeviceSetDM) createPool(dataFile *os.File, metadataFile *os.File) error {
|
func (devices *DeviceSetDM) createPool(dataFile *os.File, metadataFile *os.File) error {
|
||||||
log.Printf("Activating device-mapper pool %s", devices.getPoolName())
|
utils.Debugf("Activating device-mapper pool %s", devices.getPoolName())
|
||||||
task, err := devices.createTask(DeviceCreate, devices.getPoolName())
|
task, err := devices.createTask(DeviceCreate, devices.getPoolName())
|
||||||
if task == nil {
|
if task == nil {
|
||||||
return err
|
return err
|
||||||
|
|
10
image.go
10
image.go
|
@ -339,7 +339,7 @@ func (image *Image) ensureImageDevice(devices DeviceSet) error {
|
||||||
|
|
||||||
mounted, err := Mounted(mountDir)
|
mounted, err := Mounted(mountDir)
|
||||||
if err == nil && mounted {
|
if err == nil && mounted {
|
||||||
log.Printf("Image %s is unexpectedly mounted, unmounting...", image.ID)
|
utils.Debugf("Image %s is unexpectedly mounted, unmounting...", image.ID)
|
||||||
err = syscall.Unmount(mountDir, 0)
|
err = syscall.Unmount(mountDir, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -347,21 +347,19 @@ func (image *Image) ensureImageDevice(devices DeviceSet) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if devices.HasDevice(image.ID) {
|
if devices.HasDevice(image.ID) {
|
||||||
log.Printf("Found non-initialized demove-mapper device for image %s, removing", image.ID)
|
utils.Debugf("Found non-initialized demove-mapper device for image %s, removing", image.ID)
|
||||||
err = devices.RemoveDevice(image.ID)
|
err = devices.RemoveDevice(image.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("Creating device-mapper device for image id %s", image.ID)
|
utils.Debugf("Creating device-mapper device for image id %s", image.ID)
|
||||||
|
|
||||||
err = devices.AddDevice(image.ID, image.Parent)
|
err = devices.AddDevice(image.ID, image.Parent)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.Debugf("Mounting device %s at %s for image setup", image.ID, mountDir)
|
|
||||||
err = devices.MountDevice(image.ID, mountDir)
|
err = devices.MountDevice(image.ID, mountDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = devices.RemoveDevice(image.ID)
|
_ = devices.RemoveDevice(image.ID)
|
||||||
|
@ -375,14 +373,12 @@ func (image *Image) ensureImageDevice(devices DeviceSet) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.Debugf("Applying layer %s at %s", image.ID, mountDir)
|
|
||||||
err = image.applyLayer(layerPath(root), mountDir)
|
err = image.applyLayer(layerPath(root), mountDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = devices.RemoveDevice(image.ID)
|
_ = devices.RemoveDevice(image.ID)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.Debugf("Unmounting %s", mountDir)
|
|
||||||
err = syscall.Unmount(mountDir, 0)
|
err = syscall.Unmount(mountDir, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = devices.RemoveDevice(image.ID)
|
_ = devices.RemoveDevice(image.ID)
|
||||||
|
|
|
@ -107,15 +107,15 @@ func (runtime *Runtime) GetMountMethod() MountMethod {
|
||||||
if runtime.mountMethod == MountMethodNone {
|
if runtime.mountMethod == MountMethodNone {
|
||||||
// Try to automatically pick a method
|
// Try to automatically pick a method
|
||||||
if hasFilesystemSupport("aufs") {
|
if hasFilesystemSupport("aufs") {
|
||||||
log.Printf("Using AUFS backend.")
|
utils.Debugf("Using AUFS backend.")
|
||||||
runtime.mountMethod = MountMethodAUFS
|
runtime.mountMethod = MountMethodAUFS
|
||||||
} else {
|
} else {
|
||||||
_ = exec.Command("modprobe", "aufs").Run()
|
_ = exec.Command("modprobe", "aufs").Run()
|
||||||
if hasFilesystemSupport("aufs") {
|
if hasFilesystemSupport("aufs") {
|
||||||
log.Printf("Using AUFS backend.")
|
utils.Debugf("Using AUFS backend.")
|
||||||
runtime.mountMethod = MountMethodAUFS
|
runtime.mountMethod = MountMethodAUFS
|
||||||
} else {
|
} else {
|
||||||
log.Printf("Using device-mapper backend.")
|
utils.Debugf("Using device-mapper backend.")
|
||||||
runtime.mountMethod = MountMethodDeviceMapper
|
runtime.mountMethod = MountMethodDeviceMapper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue