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

Issue 2218703006: Clean up handling of invalid HWID when running ChromeOS in VMs (Closed)

Created:
4 years, 4 months ago by norvez
Modified:
4 years, 4 months ago
CC:
achuith+watch_chromium.org, chromium-reviews, davemoore+watch_chromium.org, dzhioev+watch_chromium.org, Hung-Te, oshima+watch_chromium.org, Vincent Palatin
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Gracefully handle cases where Chrome OS is running in a VM Read from crossystem whether Chrome OS is running inside a VM or not. Do not report an error if Chrome OS is in a VM, even if the HWID is invalid, it is expected. Add IsRunningOnVm() method similar to IsRunningOnChromeOS(). Cleanup: - more consistent naming - add unit tests to hwid_checker BUG=chromium:632303 BUG=chromium:585514 TEST=Ran by hand on cyan board and cyan image in QEMU Committed: https://crrev.com/b923b70a31b4fb3eb286f6a5e4482b844afa4a40 Cr-Commit-Position: refs/heads/master@{#413097}

Patch Set 1 #

Total comments: 5

Patch Set 2 : read is_in_vm from crossystem #

Patch Set 3 : crossystem command changed from is_in_vm to inside_vm #

Total comments: 5

Patch Set 4 : address review comments #

Patch Set 5 : add comment #

Total comments: 16

Patch Set 6 : review comments, unit tests #

Patch Set 7 : kSystemVendorKey no longer exists #

Total comments: 7

Patch Set 8 : review comments #

Total comments: 4

Patch Set 9 : Move IsRunningOnVm() check and update unit tests accordingly #

Total comments: 4

Patch Set 10 : fix after review comments (no functional changes) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+204 lines, -40 lines) Patch
M chrome/browser/chromeos/login/hwid_checker.cc View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -20 lines 0 comments Download
M chrome/browser/chromeos/login/hwid_checker_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +151 lines, -2 lines 0 comments Download
M chromeos/system/fake_statistics_provider.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chromeos/system/fake_statistics_provider.cc View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M chromeos/system/statistics_provider.h View 1 2 3 4 5 6 2 chunks +8 lines, -4 lines 0 comments Download
M chromeos/system/statistics_provider.cc View 1 2 3 4 5 6 7 chunks +33 lines, -14 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 52 (17 generated)
norvez
This CL makes it easier for callers to detect if we're running in a VM ...
4 years, 4 months ago (2016-08-05 18:07:22 UTC) #2
Daniel Erat
https://codereview.chromium.org/2218703006/diff/1/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/1/chrome/browser/chromeos/login/hwid_checker.cc#newcode130 chrome/browser/chromeos/login/hwid_checker.cc:130: if (chromeos::system::kHardwareClassValueVM != hwid) { nit: switch the order ...
4 years, 4 months ago (2016-08-05 19:03:54 UTC) #3
achuithb
not lgtm https://codereview.chromium.org/2218703006/diff/1/chromeos/system/statistics_provider.cc File chromeos/system/statistics_provider.cc (right): https://codereview.chromium.org/2218703006/diff/1/chromeos/system/statistics_provider.cc#newcode469 chromeos/system/statistics_provider.cc:469: // that ChromeOS is running inside a ...
4 years, 4 months ago (2016-08-05 21:23:32 UTC) #8
norvez
On 2016/08/05 at 21:23:32, achuith wrote: > not lgtm > > https://codereview.chromium.org/2218703006/diff/1/chromeos/system/statistics_provider.cc > File chromeos/system/statistics_provider.cc ...
4 years, 4 months ago (2016-08-08 08:48:47 UTC) #9
norvez
4 years, 4 months ago (2016-08-08 08:50:52 UTC) #10
achuithb
On 2016/08/08 08:48:47, norvez wrote: > On 2016/08/05 at 21:23:32, achuith wrote: > > not ...
4 years, 4 months ago (2016-08-08 17:59:43 UTC) #11
norvez
On 2016/08/08 17:59:43, achuithb wrote: > On 2016/08/08 08:48:47, norvez wrote: > > On 2016/08/05 ...
4 years, 4 months ago (2016-08-08 18:27:35 UTC) #12
achuithb
On 2016/08/08 18:27:35, norvez wrote: > On 2016/08/08 17:59:43, achuithb wrote: > > On 2016/08/08 ...
4 years, 4 months ago (2016-08-08 18:33:49 UTC) #13
Daniel Erat
moving this to crossystem sounds good to me too.
4 years, 4 months ago (2016-08-08 18:39:14 UTC) #14
xdai1
+1
4 years, 4 months ago (2016-08-08 18:40:57 UTC) #15
norvez
New patchset using the functionality provided by crossystem (see https://chromium-review.googlesource.com/#/c/367240/). The downside is that we ...
4 years, 4 months ago (2016-08-09 16:58:16 UTC) #16
norvez
On 2016/08/09 16:58:16, norvez wrote: > New patchset using the functionality provided by crossystem (see ...
4 years, 4 months ago (2016-08-09 17:04:05 UTC) #17
norvez
The name of the crossystem command has changed, it's now inside_vm (https://chromium-review.googlesource.com/#/c/367240)
4 years, 4 months ago (2016-08-10 10:18:23 UTC) #18
Daniel Erat
https://codereview.chromium.org/2218703006/diff/40001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/40001/chrome/browser/chromeos/login/hwid_checker.cc#newcode133 chrome/browser/chromeos/login/hwid_checker.cc:133: if (!chromeos::system::isRunningOnChromeOSVM()) { s/is/Is/ (see style guide) https://codereview.chromium.org/2218703006/diff/40001/chromeos/system/statistics_provider.cc File ...
4 years, 4 months ago (2016-08-10 13:58:05 UTC) #19
norvez
Fixed patchset after review.
4 years, 4 months ago (2016-08-10 16:06:19 UTC) #21
xdai1
lgtm
4 years, 4 months ago (2016-08-10 16:26:07 UTC) #22
Daniel Erat
https://codereview.chromium.org/2218703006/diff/80001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/80001/chrome/browser/chromeos/login/hwid_checker.cc#newcode112 chrome/browser/chromeos/login/hwid_checker.cc:112: bool IsMachineHWIDCorrect() { it's not your fault, but would ...
4 years, 4 months ago (2016-08-10 16:32:28 UTC) #24
achuithb
https://codereview.chromium.org/2218703006/diff/80001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/80001/chrome/browser/chromeos/login/hwid_checker.cc#newcode139 chrome/browser/chromeos/login/hwid_checker.cc:139: << system_vendor << "'."; On 2016/08/10 16:32:28, Daniel Erat ...
4 years, 4 months ago (2016-08-10 18:24:58 UTC) #25
norvez
New patchset, ptal :-) https://codereview.chromium.org/2218703006/diff/80001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/80001/chrome/browser/chromeos/login/hwid_checker.cc#newcode112 chrome/browser/chromeos/login/hwid_checker.cc:112: bool IsMachineHWIDCorrect() { On 2016/08/10 ...
4 years, 4 months ago (2016-08-11 17:10:34 UTC) #27
Daniel Erat
lgtm thanks for the tests!
4 years, 4 months ago (2016-08-11 17:40:36 UTC) #28
stevenjb
lgtm, thanks!
4 years, 4 months ago (2016-08-11 18:15:59 UTC) #31
achuithb
https://codereview.chromium.org/2218703006/diff/120001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/120001/chrome/browser/chromeos/login/hwid_checker.cc#newcode129 chrome/browser/chromeos/login/hwid_checker.cc:129: if (!(chromeos::IsHWIDCorrect(hwid) || stats->IsRunningOnVm())) { I wonder if it's ...
4 years, 4 months ago (2016-08-11 18:40:16 UTC) #34
norvez
New patchset after review https://codereview.chromium.org/2218703006/diff/120001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/120001/chrome/browser/chromeos/login/hwid_checker.cc#newcode129 chrome/browser/chromeos/login/hwid_checker.cc:129: if (!(chromeos::IsHWIDCorrect(hwid) || stats->IsRunningOnVm())) { ...
4 years, 4 months ago (2016-08-12 10:18:29 UTC) #35
achuithb
https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc#newcode130 chrome/browser/chromeos/login/hwid_checker.cc:130: if (stats->IsRunningOnVm()) { Does this need to be nested ...
4 years, 4 months ago (2016-08-12 20:39:03 UTC) #36
norvez
https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc#newcode130 chrome/browser/chromeos/login/hwid_checker.cc:130: if (stats->IsRunningOnVm()) { On 2016/08/12 20:39:02, achuithb wrote: > ...
4 years, 4 months ago (2016-08-13 00:07:00 UTC) #37
norvez
On 2016/08/13 00:07:00, norvez wrote: > https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc > File chrome/browser/chromeos/login/hwid_checker.cc (right): > > https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc#newcode130 > ...
4 years, 4 months ago (2016-08-15 16:04:30 UTC) #38
achuithb
https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc#newcode130 chrome/browser/chromeos/login/hwid_checker.cc:130: if (stats->IsRunningOnVm()) { On 2016/08/13 00:06:59, norvez wrote: > ...
4 years, 4 months ago (2016-08-15 17:15:05 UTC) #39
norvez
On 2016/08/15 17:15:05, achuithb wrote: > https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc > File chrome/browser/chromeos/login/hwid_checker.cc (right): > > https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc#newcode130 > ...
4 years, 4 months ago (2016-08-15 22:24:58 UTC) #40
achuithb
On 2016/08/15 22:24:58, norvez wrote: > On 2016/08/15 17:15:05, achuithb wrote: > > > https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc ...
4 years, 4 months ago (2016-08-15 22:32:44 UTC) #41
norvez
New patchset moving the VM check and updating the relevant unit tests. https://codereview.chromium.org/2218703006/diff/140001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc ...
4 years, 4 months ago (2016-08-16 10:36:19 UTC) #43
achuithb
lgtm https://codereview.chromium.org/2218703006/diff/160001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/160001/chrome/browser/chromeos/login/hwid_checker.cc#newcode124 chrome/browser/chromeos/login/hwid_checker.cc:124: if (stats->IsRunningOnVm()) { nit: don't need {} https://codereview.chromium.org/2218703006/diff/160001/chrome/browser/chromeos/login/hwid_checker_unittest.cc ...
4 years, 4 months ago (2016-08-16 17:59:34 UTC) #44
norvez
Thanks for the reviews, latest patchset should address pending comments. https://codereview.chromium.org/2218703006/diff/160001/chrome/browser/chromeos/login/hwid_checker.cc File chrome/browser/chromeos/login/hwid_checker.cc (right): https://codereview.chromium.org/2218703006/diff/160001/chrome/browser/chromeos/login/hwid_checker.cc#newcode124 ...
4 years, 4 months ago (2016-08-17 11:42:49 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2218703006/180001
4 years, 4 months ago (2016-08-19 09:28:20 UTC) #49
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 4 months ago (2016-08-19 10:07:49 UTC) #50
commit-bot: I haz the power
4 years, 4 months ago (2016-08-19 10:10:03 UTC) #52
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/b923b70a31b4fb3eb286f6a5e4482b844afa4a40
Cr-Commit-Position: refs/heads/master@{#413097}

Powered by Google App Engine
This is Rietveld 408576698