remoting: Implement multi-to-single host migration on Linux [chromium/src : main]

0 views
Skip to first unread message

Yuwei Huang (Gerrit)

unread,
Apr 23, 2026, 3:17:56 AM (yesterday) Apr 23
to Lambros Lambrou, Joe Downing, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org
Attention needed from Lambros Lambrou

Yuwei Huang added 1 comment

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Yuwei Huang . resolved

PTAL thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Lambros Lambrou
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I516befdd15c265fd48229dd95ed02a7a82ce8719
Gerrit-Change-Number: 7787694
Gerrit-PatchSet: 6
Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
Gerrit-CC: Joe Downing <joe...@chromium.org>
Gerrit-Attention: Lambros Lambrou <lambros...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Apr 2026 07:17:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yuwei Huang (Gerrit)

unread,
Apr 23, 2026, 8:02:50 PM (9 hours ago) Apr 23
to Lambros Lambrou, Joe Downing, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org
Attention needed from Lambros Lambrou

Yuwei Huang voted and added 3 comments

Votes added by Yuwei Huang

Commit-Queue+1

3 comments

Patchset-level comments
File-level comment, Patchset 12 (Latest):
Yuwei Huang . resolved

Sending AI comments for AI to fix

File remoting/host/linux/migrate_host_main.cc
Line 415, Patchset 12 (Latest): for (const auto& pairing_value : *pairings) {
Yuwei Huang . unresolved

It is safer to check if the value is actually a dictionary before calling `GetDict()` on it, just in case the JSON data is corrupted or manually edited. You do this correctly in `SaveMultiProcessPairingsAsNetworkUser`!

```cpp
for (const auto& pairing_value : *pairings) {
if (!pairing_value.is_dict()) {
continue;
}
user_pairing_delegate.Save(
protocol::PairingRegistry::Pairing::CreateFromValue(
pairing_value.GetDict()));
}
```
Line 456, Patchset 12 (Latest): std::cerr << "Failed to launch cleanup process.\n";
Yuwei Huang . unresolved

This error message might be slightly misleading if the process launched successfully but exited with a non-zero exit status. Consider updating it to something like `"Failed to clean up multi-process host state.\n"` or `"Cleanup process failed.\n"`.

Open in Gerrit

Related details

Attention is currently required from:
  • Lambros Lambrou
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I516befdd15c265fd48229dd95ed02a7a82ce8719
    Gerrit-Change-Number: 7787694
    Gerrit-PatchSet: 12
    Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
    Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
    Gerrit-CC: Joe Downing <joe...@chromium.org>
    Gerrit-Attention: Lambros Lambrou <lambros...@chromium.org>
    Gerrit-Comment-Date: Fri, 24 Apr 2026 00:02:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yuwei Huang (Gerrit)

    unread,
    Apr 23, 2026, 8:12:23 PM (9 hours ago) Apr 23
    to Lambros Lambrou, Joe Downing, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org
    Attention needed from Lambros Lambrou

    Yuwei Huang voted and added 2 comments

    Votes added by Yuwei Huang

    Commit-Queue+1

    2 comments

    File remoting/host/linux/migrate_host_main.cc
    Line 415, Patchset 12: for (const auto& pairing_value : *pairings) {
    Yuwei Huang . resolved

    It is safer to check if the value is actually a dictionary before calling `GetDict()` on it, just in case the JSON data is corrupted or manually edited. You do this correctly in `SaveMultiProcessPairingsAsNetworkUser`!

    ```cpp
    for (const auto& pairing_value : *pairings) {
    if (!pairing_value.is_dict()) {
    continue;
    }
    user_pairing_delegate.Save(
    protocol::PairingRegistry::Pairing::CreateFromValue(
    pairing_value.GetDict()));
    }
    ```
    Yuwei Huang

    Done

    Line 456, Patchset 12: std::cerr << "Failed to launch cleanup process.\n";
    Yuwei Huang . resolved

    This error message might be slightly misleading if the process launched successfully but exited with a non-zero exit status. Consider updating it to something like `"Failed to clean up multi-process host state.\n"` or `"Cleanup process failed.\n"`.

    Yuwei Huang

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lambros Lambrou
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I516befdd15c265fd48229dd95ed02a7a82ce8719
      Gerrit-Change-Number: 7787694
      Gerrit-PatchSet: 13
      Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      Gerrit-CC: Joe Downing <joe...@chromium.org>
      Gerrit-Attention: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Comment-Date: Fri, 24 Apr 2026 00:12:13 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Yuwei Huang <yuw...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Lambros Lambrou (Gerrit)

      unread,
      Apr 23, 2026, 9:13:51 PM (8 hours ago) Apr 23
      to Yuwei Huang, Joe Downing, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org
      Attention needed from Yuwei Huang

      Lambros Lambrou voted and added 1 comment

      Votes added by Lambros Lambrou

      Code-Review+1

      1 comment

      File remoting/host/linux/migrate_host_main.cc
      Line 214, Patchset 14: base::FilePath unprivileged_config =
      Lambros Lambrou . unresolved

      Can the deletion be done by the unprivileged process? Maybe move it to the end if that's easier (just before you print "Successfully migrated.." on line 471)?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Yuwei Huang
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I516befdd15c265fd48229dd95ed02a7a82ce8719
        Gerrit-Change-Number: 7787694
        Gerrit-PatchSet: 15
        Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
        Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
        Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
        Gerrit-CC: Joe Downing <joe...@chromium.org>
        Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
        Gerrit-Comment-Date: Fri, 24 Apr 2026 01:13:39 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Yuwei Huang (Gerrit)

        unread,
        Apr 23, 2026, 10:25:06 PM (7 hours ago) Apr 23
        to Lambros Lambrou, Joe Downing, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org

        Yuwei Huang added 1 comment

        File remoting/host/linux/migrate_host_main.cc
        Line 214, Patchset 14: base::FilePath unprivileged_config =
        Lambros Lambrou . resolved

        Can the deletion be done by the unprivileged process? Maybe move it to the end if that's easier (just before you print "Successfully migrated.." on line 471)?

        Yuwei Huang

        The parent directory of these unprivileged files are only writable by root, so you can't do this.

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I516befdd15c265fd48229dd95ed02a7a82ce8719
          Gerrit-Change-Number: 7787694
          Gerrit-PatchSet: 20
          Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
          Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
          Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
          Gerrit-CC: Joe Downing <joe...@chromium.org>
          Gerrit-Comment-Date: Fri, 24 Apr 2026 02:24:48 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Lambros Lambrou <lambros...@chromium.org>
          satisfied_requirement
          open
          diffy

          Yuwei Huang (Gerrit)

          unread,
          3:23 AM (2 hours ago) 3:23 AM
          to Lambros Lambrou, Joe Downing, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org

          Yuwei Huang voted Commit-Queue+2

          Commit-Queue+2
          Open in Gerrit

          Related details

          Attention set is empty
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I516befdd15c265fd48229dd95ed02a7a82ce8719
          Gerrit-Change-Number: 7787694
          Gerrit-PatchSet: 22
          Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
          Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
          Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
          Gerrit-CC: Joe Downing <joe...@chromium.org>
          Gerrit-Comment-Date: Fri, 24 Apr 2026 07:23:11 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Chromium LUCI CQ (Gerrit)

          unread,
          3:30 AM (2 hours ago) 3:30 AM
          to Yuwei Huang, Lambros Lambrou, Joe Downing, chromium...@chromium.org, chromotin...@chromium.org

          Chromium LUCI CQ submitted the change with unreviewed changes

          Unreviewed changes

          15 is the latest approved patch-set.
          The change was submitted with unreviewed changes in the following files:

          ```
          The name of the file: remoting/host/linux/migrate_host_main.cc
          Insertions: 47, Deletions: 20.

          The diff is too large to show. Please review the diff.
          ```

          Change information

          Commit message:
          remoting: Implement multi-to-single host migration on Linux

          This CL implements the migration path from multi-process host to
          single-process host on Linux.

          During migration:

          1. Root check: the migration must be initiated by the user, not root.
          2. Get config: get config by running
          `sudo migrate_host --get-multi-process-config`, which prints the
          host config and pairing entries to stdout. These contents are not
          accessible by the current user.
          3. Save pairing: write the pairing data to the local config directory
          4. Service transition:
          a. disable chrome-remote-desktop.service via sudo
          b. start the single-process service via DaemonController, which
          starts chrome-remote-desktop@<user>.service
          5. Config cleanup: remove host config file and pairing data by running
          `sudo migrate_host --cleanup-multi-process-config`
          Bug: 502664397
          Change-Id: I516befdd15c265fd48229dd95ed02a7a82ce8719
          Reviewed-by: Lambros Lambrou <lambros...@chromium.org>
          Commit-Queue: Yuwei Huang <yuw...@chromium.org>
          Cr-Commit-Position: refs/heads/main@{#1620001}
          Files:
          • M remoting/host/linux/migrate_host_main.cc
          Change size: M
          Delta: 1 file changed, 205 insertions(+), 11 deletions(-)
          Branch: refs/heads/main
          Submit Requirements:
          • requirement satisfiedCode-Review: +1 by Lambros Lambrou
          Open in Gerrit
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: merged
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I516befdd15c265fd48229dd95ed02a7a82ce8719
          Gerrit-Change-Number: 7787694
          Gerrit-PatchSet: 23
          Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
          Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
          open
          diffy
          satisfied_requirement
          Reply all
          Reply to author
          Forward
          0 new messages