summaryrefslogtreecommitdiff
path: root/src/machine
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-19 17:01:15 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-19 20:24:09 +0100
commitc19de71113f956809995fc68817e055e9f61f607 (patch)
treebf2df35651e663d96e5677a719cb38bd5e0c9d4a /src/machine
parent1c7dd82563ff2e71a067aea20d2acb2d0553644b (diff)
machined: refer to the disk space allocated for an image to "usage" rather than "size"
After all, it's closer to the "du"-reported value than to the file sizes...
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/image-dbus.c4
-rw-r--r--src/machine/machinectl.c20
-rw-r--r--src/machine/machined-dbus.c2
3 files changed, 13 insertions, 13 deletions
diff --git a/src/machine/image-dbus.c b/src/machine/image-dbus.c
index 659f7de825..f5c7d4d880 100644
--- a/src/machine/image-dbus.c
+++ b/src/machine/image-dbus.c
@@ -135,9 +135,9 @@ const sd_bus_vtable image_vtable[] = {
SD_BUS_PROPERTY("ReadOnly", "b", bus_property_get_bool, offsetof(Image, read_only), 0),
SD_BUS_PROPERTY("CreationTimestamp", "t", NULL, offsetof(Image, crtime), 0),
SD_BUS_PROPERTY("ModificationTimestamp", "t", NULL, offsetof(Image, mtime), 0),
- SD_BUS_PROPERTY("Size", "t", NULL, offsetof(Image, size), 0),
+ SD_BUS_PROPERTY("Usage", "t", NULL, offsetof(Image, usage), 0),
SD_BUS_PROPERTY("Limit", "t", NULL, offsetof(Image, limit), 0),
- SD_BUS_PROPERTY("SizeExclusive", "t", NULL, offsetof(Image, size_exclusive), 0),
+ SD_BUS_PROPERTY("UsageExclusive", "t", NULL, offsetof(Image, usage_exclusive), 0),
SD_BUS_PROPERTY("LimitExclusive", "t", NULL, offsetof(Image, limit_exclusive), 0),
SD_BUS_METHOD("Remove", NULL, NULL, bus_image_method_remove, 0),
SD_BUS_METHOD("Rename", "s", NULL, bus_image_method_rename, 0),
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 7ea991a81f..bae2abe188 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -214,7 +214,7 @@ static int compare_image_info(const void *a, const void *b) {
static int list_images(int argc, char *argv[], void *userdata) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- size_t max_name = strlen("NAME"), max_type = strlen("TYPE"), max_size = strlen("SIZE"), max_crtime = strlen("CREATED"), max_mtime = strlen("MODIFIED");
+ size_t max_name = strlen("NAME"), max_type = strlen("TYPE"), max_size = strlen("USAGE"), max_crtime = strlen("CREATED"), max_mtime = strlen("MODIFIED");
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
_cleanup_free_ ImageInfo *images = NULL;
size_t n_images = 0, n_allocated = 0, j;
@@ -304,7 +304,7 @@ static int list_images(int argc, char *argv[], void *userdata) {
(int) max_name, "NAME",
(int) max_type, "TYPE",
"RO",
- (int) max_size, "SIZE",
+ (int) max_size, "USAGE",
(int) max_crtime, "CREATED",
(int) max_mtime, "MODIFIED");
@@ -741,9 +741,9 @@ typedef struct ImageStatusInfo {
int read_only;
usec_t crtime;
usec_t mtime;
- uint64_t size;
+ uint64_t usage;
uint64_t limit;
- uint64_t size_exclusive;
+ uint64_t usage_exclusive;
uint64_t limit_exclusive;
} ImageStatusInfo;
@@ -786,12 +786,12 @@ static void print_image_status_info(sd_bus *bus, ImageStatusInfo *i) {
else if (s2)
printf("\tModified: %s\n", s2);
- s3 = format_bytes(bs, sizeof(bs), i->size);
- s4 = i->size_exclusive != i->size ? format_bytes(bs_exclusive, sizeof(bs_exclusive), i->size_exclusive) : NULL;
+ s3 = format_bytes(bs, sizeof(bs), i->usage);
+ s4 = i->usage_exclusive != i->usage ? format_bytes(bs_exclusive, sizeof(bs_exclusive), i->usage_exclusive) : NULL;
if (s3 && s4)
- printf("\t Size: %s (exclusive: %s)\n", s3, s4);
+ printf("\t Usage: %s (exclusive: %s)\n", s3, s4);
else if (s3)
- printf("\t Size: %s\n", s3);
+ printf("\t Usage: %s\n", s3);
s3 = format_bytes(bs, sizeof(bs), i->limit);
s4 = i->limit_exclusive != i->limit ? format_bytes(bs_exclusive, sizeof(bs_exclusive), i->limit_exclusive) : NULL;
@@ -810,9 +810,9 @@ static int show_image_info(const char *verb, sd_bus *bus, const char *path, bool
{ "ReadOnly", "b", NULL, offsetof(ImageStatusInfo, read_only) },
{ "CreationTimestamp", "t", NULL, offsetof(ImageStatusInfo, crtime) },
{ "ModificationTimestamp", "t", NULL, offsetof(ImageStatusInfo, mtime) },
- { "Size", "t", NULL, offsetof(ImageStatusInfo, size) },
+ { "Usage", "t", NULL, offsetof(ImageStatusInfo, usage) },
{ "Limit", "t", NULL, offsetof(ImageStatusInfo, limit) },
- { "SizeExclusive", "t", NULL, offsetof(ImageStatusInfo, size_exclusive) },
+ { "UsageExclusive", "t", NULL, offsetof(ImageStatusInfo, usage_exclusive) },
{ "LimitExclusive", "t", NULL, offsetof(ImageStatusInfo, limit_exclusive) },
{}
};
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index 233c6e8ddb..ac19695c92 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -504,7 +504,7 @@ static int method_list_images(sd_bus *bus, sd_bus_message *message, void *userda
image->read_only,
image->crtime,
image->mtime,
- image->size,
+ image->usage,
p);
if (r < 0)
return r;