system_api: add native error codes to Parallels dispatcher responses

Parallels extended their DBus API to include native error codes to allow
for better error handling by callers, let's add them to our API
definitions.

BUG=b:168829032
TEST=CQ, used with subsequent CLs

Change-Id: I70203a34d3daa8b4381b3b7048907d6cf13b5fff
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2481964
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Tested-by: Dmitry Torokhov <dtor@chromium.org>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
diff --git a/system_api/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher.proto b/system_api/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher.proto
index 69870e9..1ffa08c 100644
--- a/system_api/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher.proto
+++ b/system_api/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher.proto
@@ -19,13 +19,16 @@
 enum SrvErrorCode {
   // Success.
   SRV_SUCCESS = 0;
-  // Unspecified error.
-  SRV_ERR_UNKNOWN = 1;
+  // Native Parallels error code is returned.
+  SRV_ERR_NATIVE_RESULT_CODE = 0x7FFFFFFF;
 }
 
 // Response to ShutdownDispatcherRequest.
 message ShutdownDispatcherResponse {
   SrvErrorCode error = 1;
+
+  // Native Parallels error code.
+  sint32 result_code = 2;
 }
 
 // Request to generate and send problem report to Parallels.
@@ -72,6 +75,10 @@
 enum VmErrorCode {
   // Success.
   VM_SUCCESS = 0;
+  // Native Parallels error code is returned.
+  VM_ERR_NATIVE_RESULT_CODE = 0x7FFFFFFF;
+  // Error codes below are no longer used.
+  // TODO(b/171056519): remove once Chrome stops using them.
   // Unspecified error.
   VM_ERR_UNKNOWN = 1;
   // No valid license.
@@ -111,6 +118,9 @@
 message RegisterVmResponse {
   // Result of the operation.
   VmErrorCode error = 1;
+
+  // Native Parallels error code.
+  sint32 result_code = 2;
 }
 
 // Request to unregister previously registered VM.
@@ -126,6 +136,9 @@
 message UnregisterVmResponse {
   // Result of the operation.
   VmErrorCode error = 1;
+
+  // Native Parallels error code.
+  sint32 result_code = 2;
 }
 
 // Request to provide information about VMs known to the dispatcher.
@@ -178,6 +191,9 @@
 
   // VM(s) info.
   repeated VmInfo vm_info = 2;
+
+  // Native Parallels error code.
+  sint32 result_code = 3;
 }
 
 // Request to start given VM.
@@ -193,6 +209,9 @@
 message StartVmResponse {
   // Result of the operation.
   VmErrorCode error = 1;
+
+  // Native Parallels error code.
+  sint32 result_code = 2;
 }
 
 // Request to stop given VM.
@@ -224,6 +243,9 @@
 message StopVmResponse {
   // Result of the operation.
   VmErrorCode error = 1;
+
+  // Native Parallels error code.
+  sint32 result_code = 2;
 }
 
 // Request to suspend given VM.
@@ -239,6 +261,9 @@
 message SuspendVmResponse {
   // Result of the operation.
   VmErrorCode error = 1;
+
+  // Native Parallels error code.
+  sint32 result_code = 2;
 }
 
 // Request to perform reset for given VM.
@@ -254,6 +279,9 @@
 message ResetVmResponse {
   // Result of the operation.
   VmErrorCode error = 1;
+
+  // Native Parallels error code.
+  sint32 result_code = 2;
 }
 
 // Start UI component responsible for rendering VM display.
@@ -269,6 +297,9 @@
 message ShowVmResponse {
   // Result of the operation.
   VmErrorCode error = 1;
+
+  // Native Parallels error code.
+  sint32 result_code = 2;
 }
 
 // Signals change of state for a VM.