package main;

enum MigrationFSType {
  RSYNC     = 0;
  BTRFS     = 1;
  ZFS       = 2;
}

enum CRIUType {
  CRIU_RSYNC    = 0;
  PHAUL         = 1;
}

message IDMapType {
  required bool   isuid       = 1;
  required bool   isgid       = 2;
  required int32  hostid      = 3;
  required int32  nsid        = 4;
  required int32  maprange    = 5;
}

message MigrationHeader {
  required MigrationFSType  fs        = 1;
  optional CRIUType         criu      = 2;
  repeated IDMapType        idmap     = 3;

  repeated string           snapshots = 4;
}

message MigrationControl {
  required bool     success     = 1;

  /* optional failure message if sending a failure */
  optional string   message     = 2;
}
