summaryrefslogtreecommitdiff
path: root/src/machine/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/machine/image.c')
-rw-r--r--src/machine/image.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/machine/image.c b/src/machine/image.c
index 8f577adb59..c81c5f6281 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",