summaryrefslogtreecommitdiff
path: root/src/shared/machine-image.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-24 23:50:37 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-25 22:06:54 +0100
commitd6ce17c7f02ed3facdb45f65f546e587c2f00950 (patch)
tree844e595be12176a1e29163fa64f0af0b86d953bd /src/shared/machine-image.c
parent950c07d421c04e5aae99973479f4f13131fb45e1 (diff)
machined,machinectl: add calls for changing container/VM quotas
Diffstat (limited to 'src/shared/machine-image.c')
-rw-r--r--src/shared/machine-image.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c
index c734f148ae..c6d2850ad2 100644
--- a/src/shared/machine-image.c
+++ b/src/shared/machine-image.c
@@ -613,6 +613,19 @@ int image_path_lock(const char *path, int operation, LockFile *global, LockFile
return 0;
}
+int image_set_limit(Image *i, uint64_t referred_max) {
+ assert(i);
+
+ if (path_equal(i->path, "/") ||
+ path_startswith(i->path, "/usr"))
+ return -EROFS;
+
+ if (i->type != IMAGE_SUBVOLUME)
+ return -ENOTSUP;
+
+ return btrfs_quota_limit(i->path, referred_max);
+}
+
int image_name_lock(const char *name, int operation, LockFile *ret) {
const char *p;