chiark / gitweb /
sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()
authorLennart Poettering <lennart@poettering.net>
Tue, 23 Dec 2014 22:38:13 +0000 (23:38 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 24 Dec 2014 15:53:04 +0000 (16:53 +0100)
Pretty much everywhere else we use the generic term "machine" when
referring to containers in API, so let's do though in sd-bus too. In
particular, since the concept of a "container" exists in sd-bus too, but
as part of the marshalling system.

15 files changed:
src/analyze/analyze.c
src/hostname/hostnamectl.c
src/libsystemd/libsystemd.sym.m4
src/libsystemd/sd-bus/bus-internal.h
src/libsystemd/sd-bus/bus-util.c
src/libsystemd/sd-bus/bus-util.h
src/libsystemd/sd-bus/busctl.c
src/libsystemd/sd-bus/sd-bus.c
src/locale/localectl.c
src/login/loginctl.c
src/machine/machinectl.c
src/run/run.c
src/systemctl/systemctl.c
src/systemd/sd-bus.h
src/timedate/timedatectl.c

index 9a5fd74..6a68551 100644 (file)
@@ -1313,7 +1313,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'M':
-                        arg_transport = BUS_TRANSPORT_CONTAINER;
+                        arg_transport = BUS_TRANSPORT_MACHINE;
                         arg_host = optarg;
                         break;
 
index b3ce851..de4ce7e 100644 (file)
@@ -405,7 +405,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'M':
-                        arg_transport = BUS_TRANSPORT_CONTAINER;
+                        arg_transport = BUS_TRANSPORT_MACHINE;
                         arg_host = optarg;
                         break;
 
index de8bec3..80a61ba 100644 (file)
@@ -169,7 +169,7 @@ global:
         sd_bus_open_user;
         sd_bus_open_system;
         sd_bus_open_system_remote;
-        sd_bus_open_system_container;
+        sd_bus_open_system_machine;
         sd_bus_new;
         sd_bus_set_address;
         sd_bus_set_fd;
index 48c20c9..e9f1a81 100644 (file)
@@ -386,7 +386,7 @@ char *bus_address_escape(const char *v);
 int bus_set_address_system(sd_bus *bus);
 int bus_set_address_user(sd_bus *bus);
 int bus_set_address_system_remote(sd_bus *b, const char *host);
-int bus_set_address_system_container(sd_bus *b, const char *machine);
+int bus_set_address_system_machine(sd_bus *b, const char *machine);
 
 int bus_remove_match_by_string(sd_bus *bus, const char *match, sd_bus_message_handler_t callback, void *userdata);
 
index 0f1a89c..389b6ad 100644 (file)
@@ -1156,8 +1156,8 @@ int bus_open_transport(BusTransport transport, const char *host, bool user, sd_b
                 r = sd_bus_open_system_remote(bus, host);
                 break;
 
-        case BUS_TRANSPORT_CONTAINER:
-                r = sd_bus_open_system_container(bus, host);
+        case BUS_TRANSPORT_MACHINE:
+                r = sd_bus_open_system_machine(bus, host);
                 break;
 
         default:
@@ -1191,8 +1191,8 @@ int bus_open_transport_systemd(BusTransport transport, const char *host, bool us
                 r = sd_bus_open_system_remote(bus, host);
                 break;
 
-        case BUS_TRANSPORT_CONTAINER:
-                r = sd_bus_open_system_container(bus, host);
+        case BUS_TRANSPORT_MACHINE:
+                r = sd_bus_open_system_machine(bus, host);
                 break;
 
         default:
index 696daa1..0609882 100644 (file)
@@ -30,7 +30,7 @@
 typedef enum BusTransport {
         BUS_TRANSPORT_LOCAL,
         BUS_TRANSPORT_REMOTE,
-        BUS_TRANSPORT_CONTAINER,
+        BUS_TRANSPORT_MACHINE,
         _BUS_TRANSPORT_MAX,
         _BUS_TRANSPORT_INVALID = -1
 } BusTransport;
index 009739f..c9eeb91 100644 (file)
@@ -1854,7 +1854,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'M':
-                        arg_transport = BUS_TRANSPORT_CONTAINER;
+                        arg_transport = BUS_TRANSPORT_MACHINE;
                         arg_host = optarg;
                         break;
 
@@ -2035,8 +2035,8 @@ int main(int argc, char *argv[]) {
                         r = bus_set_address_system_remote(bus, arg_host);
                         break;
 
-                case BUS_TRANSPORT_CONTAINER:
-                        r = bus_set_address_system_container(bus, arg_host);
+                case BUS_TRANSPORT_MACHINE:
+                        r = bus_set_address_system_machine(bus, arg_host);
                         break;
 
                 default:
index 69ee239..f87c316 100644 (file)
@@ -950,7 +950,7 @@ static int bus_parse_next_address(sd_bus *b) {
                                 return r;
 
                         break;
-                } else if (startswith(a, "x-container-unix:")) {
+                } else if (startswith(a, "x-machine-unix:")) {
 
                         a += 17;
                         r = parse_container_unix_address(b, &a, &guid);
@@ -958,7 +958,7 @@ static int bus_parse_next_address(sd_bus *b) {
                                 return r;
 
                         break;
-                } else if (startswith(a, "x-container-kernel:")) {
+                } else if (startswith(a, "x-machine-kernel:")) {
 
                         a += 19;
                         r = parse_container_kernel_address(b, &a, &guid);
@@ -1334,7 +1334,7 @@ fail:
         return r;
 }
 
-int bus_set_address_system_container(sd_bus *b, const char *machine) {
+int bus_set_address_system_machine(sd_bus *b, const char *machine) {
         _cleanup_free_ char *e = NULL;
 
         assert(b);
@@ -1345,9 +1345,9 @@ int bus_set_address_system_container(sd_bus *b, const char *machine) {
                 return -ENOMEM;
 
 #ifdef ENABLE_KDBUS
-        b->address = strjoin("x-container-kernel:machine=", e, ";x-container-unix:machine=", e, NULL);
+        b->address = strjoin("x-machine-kernel:machine=", e, ";x-machine-unix:machine=", e, NULL);
 #else
-        b->address = strjoin("x-container-unix:machine=", e, NULL);
+        b->address = strjoin("x-machine-unix:machine=", e, NULL);
 #endif
         if (!b->address)
                 return -ENOMEM;
@@ -1355,7 +1355,7 @@ int bus_set_address_system_container(sd_bus *b, const char *machine) {
         return 0;
 }
 
-_public_ int sd_bus_open_system_container(sd_bus **ret, const char *machine) {
+_public_ int sd_bus_open_system_machine(sd_bus **ret, const char *machine) {
         sd_bus *bus;
         int r;
 
@@ -1367,7 +1367,7 @@ _public_ int sd_bus_open_system_container(sd_bus **ret, const char *machine) {
         if (r < 0)
                 return r;
 
-        r = bus_set_address_system_container(bus, machine);
+        r = bus_set_address_system_machine(bus, machine);
         if (r < 0)
                 goto fail;
 
index 0d0233b..41a88a8 100644 (file)
@@ -565,7 +565,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'M':
-                        arg_transport = BUS_TRANSPORT_CONTAINER;
+                        arg_transport = BUS_TRANSPORT_MACHINE;
                         arg_host = optarg;
                         break;
 
index 6881edb..03abb75 100644 (file)
@@ -1173,7 +1173,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'M':
-                        arg_transport = BUS_TRANSPORT_CONTAINER;
+                        arg_transport = BUS_TRANSPORT_MACHINE;
                         arg_host = optarg;
                         break;
 
index 472fab6..d223e78 100644 (file)
@@ -1024,7 +1024,7 @@ static int login_machine(int argc, char *argv[], void *userdata) {
         assert(bus);
 
         if (arg_transport != BUS_TRANSPORT_LOCAL &&
-            arg_transport != BUS_TRANSPORT_CONTAINER) {
+            arg_transport != BUS_TRANSPORT_MACHINE) {
                 log_error("Login only supported on local machines.");
                 return -ENOTSUP;
         }
@@ -1221,7 +1221,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'M':
-                        arg_transport = BUS_TRANSPORT_CONTAINER;
+                        arg_transport = BUS_TRANSPORT_MACHINE;
                         arg_host = optarg;
                         break;
 
index 05bfc61..b183e4e 100644 (file)
@@ -214,7 +214,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'M':
-                        arg_transport = BUS_TRANSPORT_CONTAINER;
+                        arg_transport = BUS_TRANSPORT_MACHINE;
                         arg_host = optarg;
                         break;
 
@@ -679,7 +679,7 @@ static int start_transient_service(
                         if (r < 0)
                                 return log_error_errno(r, "Failed to determine tty name: %m");
 
-                } else if (arg_transport == BUS_TRANSPORT_CONTAINER) {
+                } else if (arg_transport == BUS_TRANSPORT_MACHINE) {
                         _cleanup_bus_unref_ sd_bus *system_bus = NULL;
                         _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
                         const char *s;
index 4c4648f..abe23ec 100644 (file)
@@ -622,7 +622,7 @@ static int get_unit_list_recursive(
                         _cleanup_bus_close_unref_ sd_bus *container = NULL;
                         int k;
 
-                        r = sd_bus_open_system_container(&container, *i);
+                        r = sd_bus_open_system_machine(&container, *i);
                         if (r < 0) {
                                 log_error_errno(r, "Failed to connect to container %s: %m", *i);
                                 continue;
@@ -1713,7 +1713,7 @@ static int get_machine_properties(sd_bus *bus, struct machine_info *mi) {
         assert(mi);
 
         if (!bus) {
-                r = sd_bus_open_system_container(&container, mi->name);
+                r = sd_bus_open_system_machine(&container, mi->name);
                 if (r < 0)
                         return r;
 
@@ -3704,12 +3704,12 @@ static void print_status_info(
 
         if (i->control_group &&
             (i->main_pid > 0 || i->control_pid > 0 ||
-             ((arg_transport != BUS_TRANSPORT_LOCAL && arg_transport != BUS_TRANSPORT_CONTAINER) || cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, i->control_group, false) == 0))) {
+             ((arg_transport != BUS_TRANSPORT_LOCAL && arg_transport != BUS_TRANSPORT_MACHINE) || cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, i->control_group, false) == 0))) {
                 unsigned c;
 
                 printf("   CGroup: %s\n", i->control_group);
 
-                if (arg_transport == BUS_TRANSPORT_LOCAL || arg_transport == BUS_TRANSPORT_CONTAINER) {
+                if (arg_transport == BUS_TRANSPORT_LOCAL || arg_transport == BUS_TRANSPORT_MACHINE) {
                         unsigned k = 0;
                         pid_t extra[2];
                         static const char prefix[] = "           ";
@@ -4603,7 +4603,7 @@ static int show_system_status(sd_bus *bus) {
                format_timestamp_relative(since1, sizeof(since1), mi.timestamp));
 
         printf("   CGroup: %s\n", mi.control_group ?: "/");
-        if (arg_transport == BUS_TRANSPORT_LOCAL || arg_transport == BUS_TRANSPORT_CONTAINER) {
+        if (arg_transport == BUS_TRANSPORT_LOCAL || arg_transport == BUS_TRANSPORT_MACHINE) {
                 int flags =
                         arg_all * OUTPUT_SHOW_ALL |
                         (!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
@@ -6682,7 +6682,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'M':
-                        arg_transport = BUS_TRANSPORT_CONTAINER;
+                        arg_transport = BUS_TRANSPORT_MACHINE;
                         arg_host = optarg;
                         break;
 
index c27537f..300b949 100644 (file)
@@ -117,7 +117,7 @@ int sd_bus_open(sd_bus **ret);
 int sd_bus_open_user(sd_bus **ret);
 int sd_bus_open_system(sd_bus **ret);
 int sd_bus_open_system_remote(sd_bus **ret, const char *host);
-int sd_bus_open_system_container(sd_bus **ret, const char *machine);
+int sd_bus_open_system_machine(sd_bus **ret, const char *machine);
 
 int sd_bus_new(sd_bus **ret);
 
index 49196ca..74f40b9 100644 (file)
@@ -436,7 +436,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'M':
-                        arg_transport = BUS_TRANSPORT_CONTAINER;
+                        arg_transport = BUS_TRANSPORT_MACHINE;
                         arg_host = optarg;
                         break;