summaryrefslogtreecommitdiff
path: root/src/machine/image.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-19 20:43:18 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-19 20:43:18 +0100
commitebeccf9eecf5939a2ef772c3160e89efcad96194 (patch)
treea6cff5de068842effcb0964cd85c09abbdf3c0ad /src/machine/image.c
parentc2ce6a3d82b717c4c1e6245ad8c6ce1173f502d0 (diff)
machined: add a full bus object for images
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",