Commit 5a429714 authored by Nicholas Hollingum's avatar Nicholas Hollingum Committed by Commit Bot

Rename container -> vm for borealis context

This is in-line with the nomenclature used in
crostini/concierge/cicerone/etc. This is also needed because in a
forthcoming CL we will need to know the container name separately from
the VM name.

Bug: b/162562622
Change-Id: I05cbe5d803bebe351fe57e2214895ae284d7f0b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2469418Reviewed-by: default avatarDaniel Ng <danielng@google.com>
Commit-Queue: Nic Hollingum <hollingum@google.com>
Cr-Commit-Position: refs/heads/master@{#817188}
parent 62e99c8e
...@@ -31,13 +31,14 @@ class BorealisContext { ...@@ -31,13 +31,14 @@ class BorealisContext {
bool borealis_running() const { return borealis_running_; } bool borealis_running() const { return borealis_running_; }
void set_borealis_running(bool success) { borealis_running_ = success; } void set_borealis_running(bool success) { borealis_running_ = success; }
const std::string& container_name() { return container_name_; } const std::string& vm_name() { return vm_name_; }
void set_vm_name(std::string vm_name) { vm_name_ = std::move(vm_name); }
const std::string& root_path() const { return root_path_; } const std::string& root_path() const { return root_path_; }
void set_root_path(const std::string& path) { root_path_ = path; } void set_root_path(std::string path) { root_path_ = std::move(path); }
const base::FilePath& disk_path() const { return disk_path_; } const base::FilePath& disk_path() const { return disk_path_; }
void set_disk_path(const base::FilePath& path) { disk_path_ = path; } void set_disk_path(base::FilePath path) { disk_path_ = std::move(path); }
private: private:
friend class BorealisContextManagerImpl; friend class BorealisContextManagerImpl;
...@@ -47,7 +48,7 @@ class BorealisContext { ...@@ -47,7 +48,7 @@ class BorealisContext {
Profile* profile_ = nullptr; Profile* profile_ = nullptr;
bool borealis_running_ = false; bool borealis_running_ = false;
std::string container_name_ = "borealis"; std::string vm_name_;
std::string root_path_; std::string root_path_;
base::FilePath disk_path_; base::FilePath disk_path_;
}; };
......
...@@ -45,9 +45,11 @@ CreateDiskImage::~CreateDiskImage() = default; ...@@ -45,9 +45,11 @@ CreateDiskImage::~CreateDiskImage() = default;
void CreateDiskImage::Run(BorealisContext* context, void CreateDiskImage::Run(BorealisContext* context,
CompletionStatusCallback callback) { CompletionStatusCallback callback) {
// We use a hard-coded name. When multi-instance becomes a feature we'll
// need to determine the name instead.
context->set_vm_name("borealis");
vm_tools::concierge::CreateDiskImageRequest request; vm_tools::concierge::CreateDiskImageRequest request;
request.set_disk_path( request.set_disk_path(context->vm_name());
base::FilePath(context->container_name()).AsUTF8Unsafe());
request.set_cryptohome_id( request.set_cryptohome_id(
chromeos::ProfileHelper::GetUserIdHashFromProfile(context->profile())); chromeos::ProfileHelper::GetUserIdHashFromProfile(context->profile()));
request.set_image_type(vm_tools::concierge::DISK_IMAGE_AUTO); request.set_image_type(vm_tools::concierge::DISK_IMAGE_AUTO);
...@@ -98,7 +100,7 @@ void StartBorealisVm::Run(BorealisContext* context, ...@@ -98,7 +100,7 @@ void StartBorealisVm::Run(BorealisContext* context,
request.set_enable_gpu(true); request.set_enable_gpu(true);
request.set_software_tpm(false); request.set_software_tpm(false);
request.set_enable_audio_capture(false); request.set_enable_audio_capture(false);
request.set_name(context->container_name()); request.set_name(context->vm_name());
vm_tools::concierge::DiskImage* disk_image = request.add_disks(); vm_tools::concierge::DiskImage* disk_image = request.add_disks();
disk_image->set_path(context->disk_path().AsUTF8Unsafe()); disk_image->set_path(context->disk_path().AsUTF8Unsafe());
......
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