diff --git a/lxd/fsmonitor/drivers/driver_fanotify.go b/lxd/fsmonitor/drivers/driver_fanotify.go index dc3582a4b446..bed7c2baa9bb 100644 --- a/lxd/fsmonitor/drivers/driver_fanotify.go +++ b/lxd/fsmonitor/drivers/driver_fanotify.go @@ -76,7 +76,7 @@ func (d *fanotify) eventMask() (uint64, error) { // DriverName returns the name of the driver. func (d *fanotify) DriverName() string { - return "fanotify" + return fsmonitor.DriverNameFANotify } func (d *fanotify) load(ctx context.Context) error { diff --git a/lxd/fsmonitor/drivers/driver_inotify.go b/lxd/fsmonitor/drivers/driver_inotify.go index 6df7b47bff14..e2f0fdbbb6c8 100644 --- a/lxd/fsmonitor/drivers/driver_inotify.go +++ b/lxd/fsmonitor/drivers/driver_inotify.go @@ -75,7 +75,7 @@ func (d *inotify) eventMask() (uint32, error) { // DriverName returns the name of the driver. func (d *inotify) DriverName() string { - return "inotify" + return fsmonitor.DriverNameINotify } func (d *inotify) load(ctx context.Context) error { diff --git a/lxd/fsmonitor/drivers/load.go b/lxd/fsmonitor/drivers/load.go index 143ffd60715e..dc98e8fe4101 100644 --- a/lxd/fsmonitor/drivers/load.go +++ b/lxd/fsmonitor/drivers/load.go @@ -11,8 +11,8 @@ import ( ) var drivers = map[string]func() driver{ - "inotify": func() driver { return &inotify{} }, - "fanotify": func() driver { return &fanotify{} }, + fsmonitor.DriverNameINotify: func() driver { return &inotify{} }, + fsmonitor.DriverNameFANotify: func() driver { return &fanotify{} }, } // Load returns a new fsmonitor.FSMonitor with an applicable Driver. @@ -46,10 +46,10 @@ func Load(ctx context.Context, path string, events ...fsmonitor.Event) (fsmonito return startMonitor(driverName) } - driver, err := startMonitor("fanotify") + driver, err := startMonitor(fsmonitor.DriverNameFANotify) if err != nil { logger.Warn("Failed to initialize fanotify, falling back on inotify", logger.Ctx{"err": err}) - driver, err = startMonitor("inotify") + driver, err = startMonitor(fsmonitor.DriverNameINotify) if err != nil { return nil, err }