Commit 92c77161 authored by David Munro's avatar David Munro Committed by Commit Bot

crostini: Update task manager logic to identify crosvm processes

The path to disks has changed recently, so update the path we expect.

Bug: chromium:1114826
Test: Manual, CQ
Change-Id: I9f9bb5271d57021dd1c9559e9e7f858ce83dc059
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362163
Auto-Submit: David Munro <davidmunro@google.com>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: David Munro <davidmunro@google.com>
Cr-Commit-Position: refs/heads/master@{#799437}
parent 18d336c2
...@@ -77,7 +77,7 @@ bool CrostiniExtractVmNameAndOwnerId(const std::string& arg, ...@@ -77,7 +77,7 @@ bool CrostiniExtractVmNameAndOwnerId(const std::string& arg,
DCHECK(owner_id_out); DCHECK(owner_id_out);
// All VM disk images are contained in a subdirectory of this path. // All VM disk images are contained in a subdirectory of this path.
constexpr char kVmDiskRoot[] = "/home/root/"; constexpr char kVmDiskRoot[] = "/run/daemon-store";
// Skip paths that don't start with the correct prefix to filter out the // Skip paths that don't start with the correct prefix to filter out the
// rootfs .img file. // rootfs .img file.
...@@ -95,10 +95,10 @@ bool CrostiniExtractVmNameAndOwnerId(const std::string& arg, ...@@ -95,10 +95,10 @@ bool CrostiniExtractVmNameAndOwnerId(const std::string& arg,
base::Base64Decode(vm_disk_path.RemoveExtension().BaseName().value(), base::Base64Decode(vm_disk_path.RemoveExtension().BaseName().value(),
vm_name_out); vm_name_out);
// The owner ID is the long hex string in there...which is 2 parents up. // The owner ID is the long hex string in there...which is 1 parent up.
// It's safe to call this even if there's not enough parents because the // It's safe to call this even if there's not enough parents because the
// DirName of the root is still the root. // DirName of the root is still the root.
*owner_id_out = vm_disk_path.DirName().DirName().BaseName().value(); *owner_id_out = vm_disk_path.DirName().BaseName().value();
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment