From e55822c62f7287698a683e6e7e40aa9a992b5585 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 28 Sep 2025 21:51:10 +0900 Subject: container/init: reduce verbose noise This makes it possible to optionally omit the identifying verbose message, for when the Op implementation can provide a much more useful message in its case, using information not yet available to the String method. Signed-off-by: Ophestra --- container/initbind.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'container/initbind.go') diff --git a/container/initbind.go b/container/initbind.go index 41097fa9..ad8bfaf5 100644 --- a/container/initbind.go +++ b/container/initbind.go @@ -91,7 +91,12 @@ func (b *BindMountOp) apply(_ *setupState, k syscallDispatcher) error { flags |= syscall.MS_NODEV } - return k.bindMount(source, target, flags, b.sourceFinal == b.Target) + if b.sourceFinal.String() == b.Target.String() { + k.verbosef("mounting %q flags %#x", target, flags) + } else { + k.verbosef("mounting %q on %q flags %#x", source, target, flags) + } + return k.bindMount(source, target, flags) } func (b *BindMountOp) Is(op Op) bool { @@ -101,7 +106,7 @@ func (b *BindMountOp) Is(op Op) bool { b.Target.Is(vb.Target) && b.Flags == vb.Flags } -func (*BindMountOp) prefix() string { return "mounting" } +func (*BindMountOp) prefix() (string, bool) { return "mounting", false } func (b *BindMountOp) String() string { if b.Source == nil || b.Target == nil { return "" -- cgit v1.3.1