Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
virtcontainers/fc: add logs and improve others to make debugging easier
Browse files Browse the repository at this point in the history
add more logs and improve others to make firecracker debugging less painful

Signed-off-by: Julio Montes <[email protected]>
  • Loading branch information
Julio Montes committed Oct 2, 2019
1 parent ed7240b commit 07932d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion virtcontainers/fc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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")
}
}

Expand Down

0 comments on commit 07932d5

Please sign in to comment.