machine-image: add partial discovery of block devices as images

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
This commit is contained in:
Lennart Poettering
2017-10-26 17:54:56 +02:00
parent 8c4a8ea2ac
commit eb38edce88
4 changed files with 114 additions and 8 deletions
+1 -1
View File
@@ -2089,7 +2089,7 @@ static int determine_names(void) {
return -ENOENT;
}
if (i->type == IMAGE_RAW)
if (IN_SET(i->type, IMAGE_RAW, IMAGE_BLOCK))
r = free_and_strdup(&arg_image, i->path);
else
r = free_and_strdup(&arg_directory, i->path);