]> err.no Git - systemd/commitdiff
manager: count how many jobs we executed
authorLennart Poettering <lennart@poettering.net>
Tue, 21 Sep 2010 01:51:31 +0000 (03:51 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Sep 2010 01:51:31 +0000 (03:51 +0200)
src/dbus-manager.c
src/manager.c
src/manager.h

index cffa547678296c63dcaab42d5f21094f82dd5546..fb10bd4fb940b4feaccf9649012fe40d1b6cb294 100644 (file)
         "  <property name=\"LogTarget\" type=\"s\" access=\"read\"/>\n" \
         "  <property name=\"NNames\" type=\"u\" access=\"read\"/>\n"    \
         "  <property name=\"NJobs\" type=\"u\" access=\"read\"/>\n"     \
+        "  <property name=\"NInstalledJobs\" type=\"u\" access=\"read\"/>\n" \
         "  <property name=\"Environment\" type=\"as\" access=\"read\"/>\n" \
         "  <property name=\"ConfirmSpawn\" type=\"b\" access=\"read\"/>\n" \
         "  <property name=\"ShowStatus\" type=\"b\" access=\"read\"/>\n" \
@@ -245,6 +246,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                 { "org.freedesktop.systemd1.Manager", "LogTarget",     bus_manager_append_log_target, "s",  NULL               },
                 { "org.freedesktop.systemd1.Manager", "NNames",        bus_manager_append_n_names,    "u",  NULL               },
                 { "org.freedesktop.systemd1.Manager", "NJobs",         bus_manager_append_n_jobs,     "u",  NULL               },
+                { "org.freedesktop.systemd1.Manager", "NInstalledJobs",bus_property_append_uint32,    "u",  &m->n_installed_jobs },
                 { "org.freedesktop.systemd1.Manager", "Environment",   bus_property_append_strv,      "as", m->environment     },
                 { "org.freedesktop.systemd1.Manager", "ConfirmSpawn",  bus_property_append_bool,      "b",  &m->confirm_spawn  },
                 { "org.freedesktop.systemd1.Manager", "ShowStatus",    bus_property_append_bool,      "b",  &m->show_status    },
index 27c8aa4c962e215f413f51afbbf7019e469131ce..31dd44caa795b454480b3eb218a528454de85f51 100644 (file)
@@ -1182,6 +1182,7 @@ static int transaction_apply(Manager *m) {
 
                 j->unit->meta.job = j;
                 j->installed = true;
+                m->n_installed_jobs ++;
 
                 /* We're fully installed. Now let's free data we don't
                  * need anymore. */
index 445537239cb33b9cb2082084285686b7e853dbf5..a137eb7c6f401f33a94b89f086678952d3ef2778 100644 (file)
@@ -207,6 +207,8 @@ struct Manager {
         bool swap_auto;
 
         int n_deserializing;
+
+        unsigned n_installed_jobs;
 };
 
 int manager_new(ManagerRunningAs running_as, Manager **m);