#
# MODRESTORE configuration
#

menuconfig EULEROS_MODRESTORE_SUPPORT
	bool "the module restoration support"
	depends on ARM64
	default n
	help
	  Some state of modules needs to keep during the module upgrading
	  process. It provides the fundamental mechanism to make the module
	  store the information which needs to keep.

if EULEROS_MODRESTORE_SUPPORT

config EULEROS_MODRESTORE_MEMORY
	bool "the memory management mechanism support for module restore"
	default y
	help
	  The module suspend/resume need save some state. This module is used
	  to manage the memory space used by the module suspend/resume.

config EULEROS_MODRESTORE_MURES
	bool "mures"
	depends on EULEROS_MODRESTORE_MEMORY
	default y
	help
	  The module suspend/resume need save idrs and the adress of the
	  functions provided to other modules will change. It provide
	  interfaces to save and restore data, and a jump table to save the
	  function address.

config EULEROS_MODRESTORE_NOTIFY
	bool "the notifier call chains"
	depends on EULEROS_MODRESTORE_MEMORY
	default y
	help
	  There are 7 (6+1) types notifier chains that are need notice during
	  tasks or modules restarting process.
	  - nvwa notifier chains: There are 6 types notifier chains spreading
	    over tasks checkpoint/restore processes. Call those notifer chains
	    in specific point to notify the drivers do some works.
	  - anonymous inode mapping notifier chain: to recover the anonymous
	    inode.

config EULEROS_MODULE_SUSPEND_RESUME_INTERFACE
        bool "provide module suspend/resume interface"
        default y
        help
          A upgradable module should realize the suspend/resume interface. This
          config provide the framework which is used by modules to realize the
          upgrading function.

config EULEROS_FCNTL_REPAIR_FLAG
	   bool "add O_REPAIR flags for open file"
	   depends on ARM64
	   default n
	   help
		 This flag is provided for modules to use, modules could use the flag
		 to repair fd during criu restoring process.

config EULEROS_CRED_REFRESH
	bool "refresh the security context address of file"
	depends on ARM64
	default n
	help
	  Refresh the security context address of file. The infiniband code use
	  `write()` as bi-directional `ioctl()`, there is `struct cred` address
	  during `write()` process. However, criu only restore the cred context
	  by `fcntl(F_SETOWN)`, then `struct cred` address checking will fail.
	  This patch fix the `struct cred` address checking problem.

config EULEROS_DUPFD
	bool "export symbol `f_dupfd`"
	depends on ARM64
	default n
	help
	  The storage module need symbol `f_dupfd()`, but it doesn't belong to
	  export series. Custome export symbol `mures_f_dupfd()` to wrapper the
	  original.

config EULEROS_NETLINK_S_REPAIR
	bool "skip calling netlink notifier chain when set NETLINK_S_REPAIR"
	depends on ARM64
	default n
	help
	  When criu dump netlink fd and release sock, the netlink notifier chain
	  should be skipped.

config EULEROS_MODRESTORE_DEVNAME
	bool "register char device whiltelist used by criu"
	depends on SYSFS
	default y
	help
	  Not all char device implements ioctl command `IOCTL_CMD_NEEDREPAIR` and
	  `IOCTL_CMD_REPAIR`, or default command. This patch provides the whitelist,
	  the content of which is provided by API `mures_add_devname()` and
	  `mures_del_devname`, for criu.

config EULEROS_MODRESTORE_FILELOCK
	bool "support for filelock repair"
	depends on EULEROS_MODRESTORE_NOTIFY
	default y
	help
	  It provides one method to keep filelocks locked while the process exit.
	  Then it registers a notify block to clean the keeping locked locks.

endif # EULEROS_MODRESTORE_SUPPORT
