Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Loading...
Searching...
No Matches
ImageManager.h
1/*
2* If not stated otherwise in this file or this component's LICENSE file the
3* following copyright and licenses apply:
4*
5* Copyright 2020 Sky UK
6*
7* Licensed under the Apache License, Version 2.0 (the "License");
8* you may not use this file except in compliance with the License.
9* You may obtain a copy of the License at
10*
11* http://www.apache.org/licenses/LICENSE-2.0
12*
13* Unless required by applicable law or agreed to in writing, software
14* distributed under the License is distributed on an "AS IS" BASIS,
15* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16* See the License for the specific language governing permissions and
17* limitations under the License.
18*/
19
20
21#ifndef IMAGEMANAGER_H
22#define IMAGEMANAGER_H
23
24#include <string>
25
26#include <sys/types.h>
27
29{
30public:
31 static bool checkFSImage(const std::string & filepath,
32 uid_t userId,
33 const std::string & fs,
34 bool fix = true);
35
36 static bool checkFSImageAt(int dirFd,
37 const std::string & filepath,
38 uid_t userId,
39 const std::string & fs,
40 bool fix = true);
41
42 static bool createFSImage(const std::string & filepath,
43 uid_t userId,
44 size_t size,
45 const std::string & fs);
46
47 static bool createFSImageAt(int dirFd,
48 const std::string & filepath,
49 uid_t userId,
50 size_t size,
51 const std::string & fs);
52
53 static void deleteFSImage(const std::string & filepath);
54
55 static void deleteFSImageAt(int dirFd,
56 const std::string & filepath);
57
58private:
59 static const std::string xAttrUserIdName;
60};
61
62#endif // defined(IMAGEMANAGER_H)
Definition ImageManager.h:29
static void deleteFSImage(const std::string &filepath)
Removes a package's private data image file.
Definition ImageManager.cpp:480
static bool createFSImage(const std::string &filepath, uid_t userId, size_t size, const std::string &fs)
Create a filesystem image of the given size and format.
Definition ImageManager.cpp:294
static bool checkFSImage(const std::string &filepath, uid_t userId, const std::string &fs, bool fix=true)
Checks if the given fs image exists and is mountable.
Definition ImageManager.cpp:71