[lxc-devel] [go-lxc/v2] c/r: add support for liblxc's ghost_limit
tych0 on Github
lxc-bot at linuxcontainers.org
Tue Jul 19 22:34:49 UTC 2016
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 362 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160719/5bd3ec45/attachment.bin>
-------------- next part --------------
From 091761630c651f5725385c2b0db5a73b60c86556 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.andersen at canonical.com>
Date: Tue, 19 Jul 2016 14:41:15 -0600
Subject: [PATCH] c/r: add support for liblxc's ghost_limit
Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
container.go | 1 +
lxc-binding.c | 1 +
lxc-binding.h | 1 +
options.go | 1 +
4 files changed, 4 insertions(+)
diff --git a/container.go b/container.go
index 5d253f8..82bf1ef 100644
--- a/container.go
+++ b/container.go
@@ -1527,6 +1527,7 @@ func (c *Container) Migrate(cmd uint, opts MigrateOptions) error {
extras := C.struct_extra_migrate_opts{
preserves_inodes: C.bool(opts.PreservesInodes),
action_script: cActionScript,
+ ghost_limit: C.uint64_t(opts.GhostLimit),
}
ret := C.int(C.go_lxc_migrate(c.container, C.uint(cmd), &copts, &extras))
diff --git a/lxc-binding.c b/lxc-binding.c
index 7712d8e..4592b68 100644
--- a/lxc-binding.c
+++ b/lxc-binding.c
@@ -368,6 +368,7 @@ bool go_lxc_restore(struct lxc_container *c, char *directory, bool verbose) {
int go_lxc_migrate(struct lxc_container *c, unsigned int cmd, struct migrate_opts *opts, struct extra_migrate_opts *extras) {
#if VERSION_AT_LEAST(2, 0, 4)
opts->action_script = extras->action_script;
+ opts->ghost_limit = extras->ghost_limit;
#endif
#if VERSION_AT_LEAST(2, 0, 1)
diff --git a/lxc-binding.h b/lxc-binding.h
index da046f0..f7ccd84 100644
--- a/lxc-binding.h
+++ b/lxc-binding.h
@@ -88,6 +88,7 @@ struct migrate_opts {
struct extra_migrate_opts {
bool preserves_inodes;
char *action_script;
+ uint64_t ghost_limit;
};
int go_lxc_migrate(struct lxc_container *c, unsigned int cmd, struct migrate_opts *opts, struct extra_migrate_opts *extras);
diff --git a/options.go b/options.go
index 47dc392..5b53c60 100644
--- a/options.go
+++ b/options.go
@@ -195,4 +195,5 @@ type MigrateOptions struct {
PredumpDir string
PreservesInodes bool
ActionScript string
+ GhostLimit uint64
}
More information about the lxc-devel
mailing list