From 07932d59ab3e5aee82efe08bede4c08d7dfc5c80 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Fri, 27 Sep 2019 16:30:21 +0000 Subject: [PATCH] virtcontainers/fc: add logs and improve others to make debugging easier add more logs and improve others to make firecracker debugging less painful Signed-off-by: Julio Montes --- virtcontainers/fc.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/virtcontainers/fc.go b/virtcontainers/fc.go index 332c038cc6..7947d729ba 100644 --- a/virtcontainers/fc.go +++ b/virtcontainers/fc.go @@ -191,6 +191,8 @@ func (fc *firecracker) bindMount(ctx context.Context, source, destination string return fmt.Errorf("Could not create destination mount point %v: %v", destination, err) } + fc.Logger().WithFields(logrus.Fields{"src": absSource, "dst": destination}).Debug("Bind mounting resource") + if err := syscall.Mount(absSource, destination, "bind", syscall.MS_BIND|syscall.MS_SLAVE, ""); err != nil { return fmt.Errorf("Could not bind mount %v to %v: %v", absSource, destination, err) } @@ -717,9 +719,10 @@ func (fc *firecracker) createDiskPool() error { func (fc *firecracker) umountResource(jailedPath string) { hostPath := filepath.Join(fc.jailerRoot, jailedPath) + fc.Logger().WithField("resource", hostPath).Debug("Unmounting resource") err := syscall.Unmount(hostPath, syscall.MNT_DETACH) if err != nil { - fc.Logger().WithField("umountResource failed", err).Info() + fc.Logger().WithError(err).Error("Failed to umount resource") } }