| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.virtualization; |
| |
| type EnvironmentInfo = struct { |
| /// A globally unique identifier for this environment. |
| id uint32; |
| |
| /// The string provided to `Manager.Create`. |
| label string; |
| |
| /// List of guests running in this environment. |
| instances vector<InstanceInfo>; |
| }; |
| |
| type InstanceInfo = struct { |
| /// Context ID to use to address this guest for vsocket communications. This |
| /// can also be used to uniquely identify a guest within an environment. |
| cid uint32; |
| |
| /// The `label` string originally provided in the `LaunchInfo` structure |
| /// or, if it was the null, the `url` |
| label string; |
| }; |
| |
| @discoverable |
| protocol Manager { |
| /// Create a new environment in which guests can be launched. |
| /// |
| /// The `label` is a string that is used for diagnostic purposes, such as |
| /// naming resources and dumping debug info. |
| Create(resource struct { |
| label string:optional; |
| env server_end:Realm; |
| }); |
| |
| /// Query for existing guest environments. |
| /// |
| /// This is intended for diagnostic purposes only. |
| List() -> (struct { |
| env_infos vector<EnvironmentInfo>; |
| }); |
| |
| /// Connect to a currently running guest environment identified by `id`. The |
| /// `id` can be found via a call to `List`. |
| /// |
| /// This is intended for diagnostic purposes only. |
| Connect(resource struct { |
| id uint32; |
| env server_end:Realm; |
| }); |
| }; |