Skip to content

Commit

Permalink
Merge pull request #203 from stgraber/migrate
Browse files Browse the repository at this point in the history
cmd/lxd-to-incus: Unmount target paths
  • Loading branch information
brauner authored Oct 28, 2023
2 parents ac623dd + 7c7a758 commit 519a5d2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/lxd-to-incus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/canonical/lxd/client"
lxdAPI "github.com/canonical/lxd/shared/api"
"github.com/spf13/cobra"
"golang.org/x/sys/unix"

"github.com/lxc/incus/client"
cli "github.com/lxc/incus/internal/cmd"
Expand Down Expand Up @@ -631,6 +632,11 @@ Instead this tool will be providing specific commands for each of the servers.
fmt.Errorf("Failed to stop the target server: %w", err)
}

// Unmount potential mount points.
for _, mount := range []string{"guestapi", "shmounts"} {
_ = unix.Unmount(filepath.Join(targetPaths.Daemon, mount), unix.MNT_DETACH)
}

// Wipe the target.
fmt.Println("=> Wiping the target server")

Expand Down

0 comments on commit 519a5d2

Please sign in to comment.