summaryrefslogtreecommitdiff
path: root/src/shared/machine-image.h
AgeCommit message (Collapse)AuthorFilesLines
2018-12-02machine-image: introduce image_hash_ops and use itYu Watanabe1-5/+2
2018-11-26tree-wide: fix a few missing includesLennart Poettering1-0/+2
2018-06-14tree-wide: remove Lennart's copyright linesLennart Poettering1-4/+0
These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
2018-06-14tree-wide: drop 'This file is part of systemd' blurbLennart Poettering1-2/+0
This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
2018-05-24machine-image: extend search pathLennart Poettering1-0/+2
This adds directories in /etc and /run to the search paths for OS images. While it doesn't make much sense to actually place huge disk images there, it's good enough for symlinks to those. The main reason for supporting this is that this allows us to neatly symlink portable image files located outside of the search path into the search path when attaching them, so that attaching them also means they are discoverable properly for all commands.
2018-05-24machine-image: add 'discoverable' flag for imagesLennart Poettering1-1/+2
This new flag indicates whether the image object was found in the search paths using the usual algorithm, or was instantiated by path. This is useful for code that wants to know whether an image may be referenced by its shortened name or must be specified by its full name.
2018-05-24machine-image: add proper refcountingLennart Poettering1-0/+4
2018-05-24machine-image: add APIs for converting arbitrary image paths into Image objectsLennart Poettering1-0/+2
2018-05-24machine-image: introduce two different classes of imagesLennart Poettering1-2/+9
This distuingishes two different classes of images, one for the purpose of npsawn-like containers, i.e. "machines", and one for portable services. This distinction is mostly about search paths. We look for machine images in /var/lib/machines and for portable images in /var/lib/portables.
2018-04-06tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek1-13/+0
Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
2017-11-28machine-image: convert image_hashmap_free() to an static inline helperZbigniew Jędrzejewski-Szmek1-1/+3
2017-11-20machine-image: add a generic API to determine metadata of any imageLennart Poettering1-0/+9
This adds an internal API that permits querying metadata from any type of image, including both subvol/dir images, and raw/block images. In the latter case we use the new dissection API we just added.
2017-11-19Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek1-0/+1
This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
2017-10-26machine-image: add partial discovery of block devices as imagesLennart Poettering1-0/+1
This adds some basic discovery of block device images for nspawn and friends. Note that this doesn't add searching for block devices using udev, but instead expects users to symlink relevant block devices into /var/lib/machines. Discovery is hence done exactly like for dir/subvol/raw file images, except that what is found may be a (symlink to) a block device. For now, we do not support cloning these images, but removal, renaming and read-only flags are supported to the point where that makes sense. Fixe: #6990
2016-04-12machinectl: add new "machinectl clean" commandLennart Poettering1-0/+26
This new command removes all, or all hidden container images that have been downloaded.
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack1-2/+0
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2015-12-06shared: include what we useThomas Hindoe Paaboel Andersen1-0/+4
The next step of a general cleanup of our includes. This one mostly adds missing includes but there are a few removals as well.
2015-11-18tree-wide: sort includes in *.hThomas Hindoe Paaboel Andersen1-2/+2
This is a continuation of the previous include sort patch, which only sorted for .c files.
2015-05-05lockfile-util.[ch]: Split out from util.[ch]Colin Walters1-0/+1
Continuing the general trend of splitting up util.[ch]. I specifically want to reuse this code in https://github.com/GNOME/libglnx and having it split up will make future copy-pasting easier.
2015-03-10shared: the btrfs quota field is called "referenced" not "referred"Lennart Poettering1-1/+1
2015-02-25machined,machinectl: add calls for changing container/VM quotasLennart Poettering1-0/+2
2015-02-18machined: open up most of machined's commands to unprivileged clients via ↵Lennart Poettering1-0/+2
PolicyKit
2015-01-19machined: refer to the disk space allocated for an image to "usage" rather ↵Lennart Poettering1-2/+2
than "size" After all, it's closer to the "du"-reported value than to the file sizes...
2015-01-15import: rename "gpt" disk image type to "raw"Lennart Poettering1-1/+1
After all, nspawn can now dissect MBR partition levels, too, hence ".gpt" appears a misnomer. Moreover, the the .raw suffix for these files is already pretty popular (the Fedora disk images use it for example), hence sounds like an OK scheme to adopt.
2015-01-14nspawn: add file system locks for controlling access to container imagesLennart Poettering1-0/+5
This adds three kinds of file system locks for container images: a) a file system lock next to the actual image, in a .lck file in the same directory the image is located. This lock has the benefit of usually being located on the same NFS share as the image itself, and thus allows locking container images across NFS shares. b) a file system lock in /run, named after st_dev and st_ino of the root of the image. This lock has the advantage that it is unique even if the same image is bind mounted to two different places at the same time, as the ino/dev stays constant for them. c) a file system lock that is only taken when a new disk image is about to be created, that ensures that checking whether the name is already used across the search path, and actually placing the image is not interrupted by other code taking the name. a + b are read-write locks. When a container is booted in read-only mode a read lock is taken, otherwise a write lock. Lock b is always taken after a, to avoid ABBA problems. Lock c is mostly relevant when renaming or cloning images.
2014-12-28machined: add support for reporting image size via btrfs quotaLennart Poettering1-0/+5
2014-12-28machinectl/machined: implement "rename", "clone", "read-only" verbs for ↵Lennart Poettering1-0/+3
machine images
2014-12-28machined: add "machinectl remove" for removing imagesLennart Poettering1-0/+2
2014-12-28machined: Move image discovery logic into src/shared, so that we can make ↵Lennart Poettering1-0/+55
use of it from nspawn