[systemd-commits] 2 commits - src/network
Tom Gundersen
tomegun at kemper.freedesktop.org
Thu Feb 5 09:02:47 PST 2015
src/network/networkd-link-bus.c | 3 +++
src/network/networkd-manager-bus.c | 3 +++
src/network/networkd-manager.c | 6 ------
src/network/networkd.c | 6 ++++++
src/network/networkd.h | 1 +
5 files changed, 13 insertions(+), 6 deletions(-)
New commits:
commit 8f203c166ecb24f904a068f2d8f0c636c1511a8f
Author: Tom Gundersen <teg at jklm.no>
Date: Thu Feb 5 18:00:16 2015 +0100
networkd: move the connection to the bus out of manager_new (again)
This would otherwise make the tests fail as we cannot grab the bus name.
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 02ab9f9..8dfe437 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -78,8 +78,6 @@ static int setup_default_address_pool(Manager *m) {
return 0;
}
-int manager_connect_bus(Manager *m);
-
static int on_bus_retry(sd_event_source *s, usec_t usec, void *userdata) {
Manager *m = userdata;
@@ -437,10 +435,6 @@ int manager_new(Manager **ret) {
if (r < 0)
return r;
- r = manager_connect_bus(m);
- if (r < 0)
- return r;
-
r = manager_connect_udev(m);
if (r < 0)
return r;
diff --git a/src/network/networkd.c b/src/network/networkd.c
index 571f523..7319276 100644
--- a/src/network/networkd.c
+++ b/src/network/networkd.c
@@ -86,6 +86,12 @@ int main(int argc, char *argv[]) {
goto out;
}
+ r = manager_connect_bus(m);
+ if (r < 0) {
+ log_error_errno(r, "Could not connect to bus: %m");
+ goto out;
+ }
+
r = manager_load_config(m);
if (r < 0) {
log_error_errno(r, "Could not load configuration files: %m");
diff --git a/src/network/networkd.h b/src/network/networkd.h
index e6d84f1..cd54e9b 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -239,6 +239,7 @@ extern const sd_bus_vtable manager_vtable[];
int manager_new(Manager **ret);
void manager_free(Manager *m);
+int manager_connect_bus(Manager *m);
int manager_run(Manager *m);
int manager_load_config(Manager *m);
commit 4852e15970ec652b823bf568b398f730be1fe1a5
Author: Tom Gundersen <teg at jklm.no>
Date: Thu Feb 5 17:59:40 2015 +0100
networkd: gracefully handle failure to emit signals when dbus is not connected
When we get kdbus we don't need these hackse.
diff --git a/src/network/networkd-link-bus.c b/src/network/networkd-link-bus.c
index 645c47a..f7eae87 100644
--- a/src/network/networkd-link-bus.c
+++ b/src/network/networkd-link-bus.c
@@ -108,6 +108,9 @@ int link_send_changed(Link *link, const char *property, ...) {
assert(link);
assert(link->manager);
+ if (!link->manager->bus)
+ return 0; /* replace with assert when we have kdbus */
+
l = strv_from_stdarg_alloca(property);
p = link_bus_path(link);
diff --git a/src/network/networkd-manager-bus.c b/src/network/networkd-manager-bus.c
index 7753c5d..b281f4f 100644
--- a/src/network/networkd-manager-bus.c
+++ b/src/network/networkd-manager-bus.c
@@ -38,6 +38,9 @@ int manager_send_changed(Manager *manager, const char *property, ...) {
assert(manager);
+ if (!manager->bus)
+ return 0; /* replace by assert when we have kdbus */
+
l = strv_from_stdarg_alloca(property);
return sd_bus_emit_properties_changed_strv(
More information about the systemd-commits
mailing list