Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Issue 1733013: AU: Beginnings of dbus support. (Closed)

Created:
10 years, 8 months ago by adlr
Modified:
10 years, 8 months ago
CC:
chromium-os-reviews_chromium.org, dneiss, adlr, Daniel Erat
Visibility:
Public.

Description

AU: Beginnings of dbus support. The AU will be a daemon that runs as root. Non-root will communicate via dbus with the updater to do things such as: query status, request forced or full updates, etc. New files for dbus: UpdateEngine.conf - security configuration dbus_constants.h - common constants dbus_service.* - The object exposed over dbus org.chromium.UpdateEngine.service - the dbus service file udpate_attempter.* - Refactored this out of main.cc update_engine_client.cc - Simple command line utility to interact with Update Engine over dbus. Whereas Update Engine runs as root, this tool runs as non-root user.

Patch Set 1 #

Total comments: 31

Patch Set 2 : integrate another CL that went in #

Patch Set 3 : fixes for review #

Patch Set 4 : LOG(FATAL) -> CHECK() #

Total comments: 9

Patch Set 5 : fixes for wad's review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+572 lines, -120 lines) Patch
M src/platform/update_engine/SConstruct View 1 2 5 chunks +55 lines, -4 lines 0 comments Download
A src/platform/update_engine/UpdateEngine.conf View 1 chunk +23 lines, -0 lines 0 comments Download
A src/platform/update_engine/dbus_constants.h View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
A src/platform/update_engine/dbus_service.h View 1 2 1 chunk +59 lines, -0 lines 0 comments Download
A src/platform/update_engine/dbus_service.cc View 1 2 1 chunk +51 lines, -0 lines 0 comments Download
M src/platform/update_engine/main.cc View 1 2 3 4 4 chunks +70 lines, -116 lines 0 comments Download
A src/platform/update_engine/org.chromium.UpdateEngine.service View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
A src/platform/update_engine/update_attempter.h View 1 2 1 chunk +54 lines, -0 lines 0 comments Download
A src/platform/update_engine/update_attempter.cc View 1 2 1 chunk +127 lines, -0 lines 0 comments Download
A src/platform/update_engine/update_engine.xml View Binary file 0 comments Download
A src/platform/update_engine/update_engine_client.cc View 1 2 3 1 chunk +112 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
adlr
10 years, 8 months ago (2010-04-23 00:32:51 UTC) #1
Daniel Erat
The code looks okay to me, but you should get someone who knows more about ...
10 years, 8 months ago (2010-04-24 01:25:53 UTC) #2
adlr
Dan, please take another look. If you're happy, I'll reach out to another developer to ...
10 years, 8 months ago (2010-04-26 18:27:09 UTC) #3
Daniel Erat
LGTM http://codereview.chromium.org/1733013/diff/1/12 File src/platform/update_engine/update_engine_client.cc (right): http://codereview.chromium.org/1733013/diff/1/12#newcode101 src/platform/update_engine/update_engine_client.cc:101: if (!CheckForUpdates(FLAGS_force_update)) { On 2010/04/26 18:27:10, adlr wrote: ...
10 years, 8 months ago (2010-04-26 18:40:53 UTC) #4
adlr
Will, can you take a quick look at the dbus specific parts of this? derat ...
10 years, 8 months ago (2010-04-26 19:20:51 UTC) #5
Will Drewry
10 years, 8 months ago (2010-04-26 20:16:32 UTC) #6
So this lgtm but does have a good bit of code duplication given the dbus code in
common (chromeos::dbus).  It'd be nice to encapsulate some of the C/glib stuff
away using that or the coming dbus-c++ stuff for cromo.

I was also curious how this fits in with the engine itself.  Will this daemon
just pick up local status and do calls to the network or will it actually touch
the updater process.  (We can discuss it out of cl too.)  I just want to make
sure I understand what it looks like in a more complete way.

thanks!
will

http://codereview.chromium.org/1733013/diff/24001/25006
File src/platform/update_engine/main.cc (right):

http://codereview.chromium.org/1733013/diff/24001/25006#newcode37
src/platform/update_engine/main.cc:37: void
SetupDbusService(UpdateEngineService* service) {
FWIW, some of the other services (cryptohomed session_manager) are using
AbstractDbusService which provides the code below.

[rochberg and co are also working on stripping exceptions out of dbus-c++ so
that we can use it in a style-compliant way.  You might want to check in on them
later when you add more services.]

http://codereview.chromium.org/1733013/diff/24001/25006#newcode77
src/platform/update_engine/main.cc:77: g_type_init();
Should be ::g_type_init();

http://codereview.chromium.org/1733013/diff/24001/25006#newcode79
src/platform/update_engine/main.cc:79: dbus_g_thread_init();
I guess this is all threaded with glib-friendly threads?

http://codereview.chromium.org/1733013/diff/24001/25006#newcode98
src/platform/update_engine/main.cc:98:
dbus_g_object_type_install_info(UPDATE_ENGINE_TYPE_SERVICE,
All this stuff is also handled in chromeos::dbus::AbstractDbusService except for
g_type_init().  Did it not make sense to use an UpdateEngineService class to
wrap this.  (E.g., was GMainLoop encapsulation not working out, etc)

http://codereview.chromium.org/1733013/diff/24001/25006#newcode106
src/platform/update_engine/main.cc:106: g_timeout_add(0,
&chromeos_update_engine::SetupInMainLoop, &update_attempter);
If the whole thingt was wrapped up in a class, you could probably just call this
once the loop is up.  I guess it depends on if there is some lag.

http://codereview.chromium.org/1733013/diff/24001/25007
File src/platform/update_engine/org.chromium.UpdateEngine.service (right):

http://codereview.chromium.org/1733013/diff/24001/25007#newcode3
src/platform/update_engine/org.chromium.UpdateEngine.service:3:
Exec=/home/adlr/trunk/src/platform/update_engine/update_engine
Update with the permanent home? :)

http://codereview.chromium.org/1733013/diff/24001/25011
File src/platform/update_engine/update_engine_client.cc (right):

http://codereview.chromium.org/1733013/diff/24001/25011#newcode5
src/platform/update_engine/update_engine_client.cc:5: #include <gflags/gflags.h>
Are we adding more deps on gflags or moving over to libbase's commandline.h?

http://codereview.chromium.org/1733013/diff/24001/25011#newcode6
src/platform/update_engine/update_engine_client.cc:6: #include <glib.h>
Since this is C, it should probably come before gflags.

http://codereview.chromium.org/1733013/diff/24001/25011#newcode43
src/platform/update_engine/update_engine_client.cc:43: proxy =
dbus_g_proxy_new_for_name_owner(bus,
there's code in common for this too (seanparent's chromeos::dbus::Proxy  and
chromeos::dbus::BusConnection)

Powered by Google App Engine
This is Rietveld 408576698