| // Copyright 2017 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| syntax = "proto3"; |
| |
| option cc_enable_arenas = true; |
| |
| // This file defines services that will be running on the host for the VM. |
| package vm_tools; |
| |
| import "common.proto"; |
| |
| // Timestamp message as defined by google.protobuf.timestamp.proto |
| message Timestamp { |
| // Represents seconds of UTC time since Unix epoch |
| // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to |
| // 9999-12-31T23:59:59Z inclusive. |
| int64 seconds = 1; |
| |
| // Non-negative fractions of a second at nanosecond resolution. Negative |
| // second values with fractions must still have non-negative nanos values |
| // that count forward in time. Must be from 0 to 999,999,999 |
| // inclusive. |
| int32 nanos = 2; |
| } |
| |
| // Log severity levels as described by RFC3164. The values don't line up with |
| // the ones defined by RFC3164 because proto3 requires all fields to have |
| // default values and the default value for an enum is 0. In case the severity |
| // field is missing it's better to default to UNKNOWN instead of EMERGENCY. |
| enum LogSeverity { |
| MISSING = 0; // Default value. |
| EMERGENCY = 1; // System is unusable. |
| ALERT = 2; // Action must be taken immediately. |
| CRITICAL = 3; // Critical conditions. |
| ERROR = 4; // Error conditions. |
| WARNING = 5; // Warning conditions. |
| NOTICE = 6; // Normal but significant condition. |
| INFO = 7; // Informational messages. |
| DEBUG = 8; // Debug-level messages. |
| } |
| |
| // Serialized log message. |
| message LogRecord { |
| // Severity of the message. |
| LogSeverity severity = 1; |
| |
| // Time that the message was created. |
| Timestamp timestamp = 2; |
| |
| // Actual content of the message. |
| bytes content = 5; |
| } |
| |
| // A request to log information. Multiple records may be coalesced into a |
| // single request. |
| message LogRequest { |
| repeated LogRecord records = 1; |
| } |
| |
| // The LogCollector service stores log records that were generated from within |
| // a VM in a persistent location outside the VM. |
| service LogCollector { |
| // Collect and store logs generated by the VM kernel. |
| rpc CollectKernelLogs(LogRequest) returns (EmptyMessage); |
| |
| // Collect and store logs generated by userspace applications inside the VM. |
| rpc CollectUserLogs(LogRequest) returns (EmptyMessage); |
| } |
| |
| // Service that is notified whenever a new VM starts up. |
| service StartupListener { |
| // Called by each VM when it starts up to indicate that it is ready to handle |
| // incoming requests. |
| rpc VmReady(EmptyMessage) returns (EmptyMessage); |
| } |
| |
| // A message representing one of more log messages from the serial out |
| // of a specific VM. Used by anomaly_detector. Placed in this package |
| // because it needs to include LogRequest. |
| message VmKernelLogRequest { |
| // The type of VM sending logs. Note that the values here should match |
| // the ones in concierge_service.proto for ease of conversion. |
| enum VmType { |
| // Default value indicating an unknown or custom VM. |
| UNKNOWN = 0; |
| |
| // VM is associated with a specific feature. |
| TERMINA = 1; |
| ARC_VM = 2; |
| PLUGIN_VM = 3; |
| }; |
| |
| VmType vm_type = 1; |
| |
| int32 cid = 2; |
| |
| repeated LogRecord records = 3; |
| } |