X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmachine%2Fimage.c;h=c81c5f628179a6e8e7e7c02c4647aa72f3b19023;hb=ebeccf9eecf5939a2ef772c3160e89efcad96194;hp=8f577adb59c36044aedc29c945c6cf2d5b0e38b2;hpb=c2ce6a3d82b717c4c1e6245ad8c6ce1173f502d0;p=elogind.git diff --git a/src/machine/image.c b/src/machine/image.c index 8f577adb5..c81c5f628 100644 --- a/src/machine/image.c +++ b/src/machine/image.c @@ -24,8 +24,8 @@ #include "strv.h" #include "utf8.h" #include "btrfs-util.h" +#include "path-util.h" #include "image.h" -#include "bus-label.h" static const char image_search_path[] = "/var/lib/container\0" @@ -71,9 +71,11 @@ static int image_new( return -ENOMEM; if (path) { - i->path = strdup(path); + i->path = strjoin(path, "/", name, NULL); if (!i->path) return -ENOMEM; + + path_kill_slashes(i->path); } *ret = i; @@ -264,18 +266,6 @@ void image_hashmap_free(Hashmap *map) { hashmap_free(map); } -char *image_bus_path(const char *name) { - _cleanup_free_ char *e = NULL; - - assert(name); - - e = bus_label_escape(name); - if (!e) - return NULL; - - return strappend("/org/freedesktop/machine1/image/", e); -} - static const char* const image_type_table[_IMAGE_TYPE_MAX] = { [IMAGE_DIRECTORY] = "directory", [IMAGE_SUBVOLUME] = "subvolume",