| // 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; |
| |
| using zx; |
| |
| type GuestError = strict enum { |
| VSOCK_NOT_PRESENT = 1; |
| }; |
| |
| /// A `Guest` provides access to services of a guest instance. |
| @discoverable |
| protocol Guest { |
| /// Get a guest console. |
| /// |
| /// The details regarding what output is produced and what input is accepted |
| /// are determined by each guest, but will typically be a read/write socket |
| /// with a shell. |
| /// |
| /// Returns ZX_ERR_UNAVAILABLE if the guest has no configured console. |
| GetConsole() -> (resource struct { |
| socket zx.handle:SOCKET; |
| }) error zx.status; |
| |
| /// Get the socket for low-level guest debug logs. |
| /// |
| /// The details regarding what output is produced and what input is accepted |
| /// are determined by each guest, but will typically be a read-only socket |
| /// with the guest kernel's serial logs. |
| GetSerial() -> (resource struct { |
| socket zx.handle:SOCKET; |
| }) error zx.status; |
| |
| /// Get the vsock endpoint for the guest. |
| /// |
| /// This endpoint can be used to register listeners for guest initiated connections, and |
| /// to initiate connections from a client. If listeners need to be registered before the guest |
| /// starts so that they are immediately available, set them via the guest config instead of |
| /// using this endpoint. |
| GetHostVsockEndpoint(resource struct { |
| endpoint server_end:HostVsockEndpoint; |
| }) -> (struct {}) error GuestError; |
| }; |