Skip to content

Commit

Permalink
lxd-to-incus: Add shiftfs check
Browse files Browse the repository at this point in the history
Closes lxc#309

Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Dec 15, 2023
1 parent 1719ffc commit e2eda9a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cmd/lxd-to-incus/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/lxc/incus/internal/linux"
"github.com/lxc/incus/internal/version"
incusAPI "github.com/lxc/incus/shared/api"
"github.com/lxc/incus/shared/util"
)

var minLXDVersion = &version.DottedVersion{4, 0, 0}
Expand Down Expand Up @@ -392,5 +393,21 @@ func (c *cmdMigrate) validate(source Source, target Target) error {
return fmt.Errorf("Source daemon running on btrfs but being moved to non-btrfs target")
}

// Shiftfs check.
if util.PathExists("/sys/module/shiftfs/") {
fmt.Println("")
fmt.Println("WARNING: The shiftfs kernel module was detected on your system.")
fmt.Println(" This may indicate that your LXD installation is using shiftfs")
fmt.Println(" to allow shifted passthrough of some disks to your instance.")
fmt.Println("")
fmt.Println(" Incus does not support shiftfs but instead relies on a recent")
fmt.Println(" feature of the Linux kernel instead, VFS idmap.")
fmt.Println("")
fmt.Println(" If your instances actively rely on shiftfs today, you may need")
fmt.Println(" to update to a more recent Linux kernel or ZFS version to keep")
fmt.Println(" using this shifted passthrough features.")
fmt.Println("")
}

return nil
}

0 comments on commit e2eda9a

Please sign in to comment.