mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
Use a struct to pass options to Checkpoint()
For upcoming changes to the Checkpoint() functions this commit switches checkpoint options from a boolean to a struct, so that additional options can be passed easily to Checkpoint() without changing the function parameters all the time. Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:

committed by
Adrian Reber

parent
ea928f2de6
commit
ff47a4c2d5
@ -830,8 +830,14 @@ func (c *Container) Refresh(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContainerCheckpointOptions is a struct used to pass the parameters
|
||||
// for checkpointing to corresponding functions
|
||||
type ContainerCheckpointOptions struct {
|
||||
Keep bool
|
||||
}
|
||||
|
||||
// Checkpoint checkpoints a container
|
||||
func (c *Container) Checkpoint(ctx context.Context, keep bool) error {
|
||||
func (c *Container) Checkpoint(ctx context.Context, options ContainerCheckpointOptions) error {
|
||||
logrus.Debugf("Trying to checkpoint container %s", c)
|
||||
if !c.batched {
|
||||
c.lock.Lock()
|
||||
@ -842,7 +848,7 @@ func (c *Container) Checkpoint(ctx context.Context, keep bool) error {
|
||||
}
|
||||
}
|
||||
|
||||
return c.checkpoint(ctx, keep)
|
||||
return c.checkpoint(ctx, options)
|
||||
}
|
||||
|
||||
// Restore restores a container
|
||||
|
Reference in New Issue
Block a user