aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2018-02-23 15:48:27 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-02-28 21:30:00 -0800
commitf89c490da12c83ce9dbd1d43a10a5fd625a4507c (patch)
treecb7da2e240f2f4a65347cc34d553fed9212e6ffa
parentffca1a514e1f06d23107c48f615eb01a42e3db65 (diff)
downloadsystem_api-f89c490da12c83ce9dbd1d43a10a5fd625a4507c.tar.gz
vm_concierge: Add message to delete a vm disk
If a user wants to free up disk space or restart their VM from scratch the existing disk needs to be deleted. Add a message to allow that. BUG=815359 TEST=with other changes, vmc destroy <vm name> Change-Id: I5131859c6a17d4332c9ecc8e97876029fd44e5aa Reviewed-on: https://chromium-review.googlesource.com/935194 Commit-Ready: Dylan Reid <dgreid@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
-rw-r--r--dbus/vm_concierge/dbus-constants.h1
-rw-r--r--dbus/vm_concierge/service.proto28
2 files changed, 29 insertions, 0 deletions
diff --git a/dbus/vm_concierge/dbus-constants.h b/dbus/vm_concierge/dbus-constants.h
index 454b644..43ca67e 100644
--- a/dbus/vm_concierge/dbus-constants.h
+++ b/dbus/vm_concierge/dbus-constants.h
@@ -17,6 +17,7 @@ const char kStopVmMethod[] = "StopVm";
const char kStopAllVmsMethod[] = "StopAllVms";
const char kGetVmInfoMethod[] = "GetVmInfo";
const char kCreateDiskImageMethod[] = "CreateDiskImage";
+const char kDestroyDiskImageMethod[] = "DestroyDiskImage";
} // namespace concierge
} // namespace vm_tools
diff --git a/dbus/vm_concierge/service.proto b/dbus/vm_concierge/service.proto
index 9606aaf..f4be796 100644
--- a/dbus/vm_concierge/service.proto
+++ b/dbus/vm_concierge/service.proto
@@ -149,6 +149,12 @@ enum DiskImageStatus {
// Unable to create the disk image.
DISK_STATUS_FAILED = 3;
+
+ // Specified Disk does not exist.
+ DISK_STATUS_DOES_NOT_EXIST = 4;
+
+ // The specified disk was destroyed.
+ DISK_STATUS_DESTROYED = 5;
}
// Request to concierge to create a disk image.
@@ -182,3 +188,25 @@ message CreateDiskImageResponse {
// The failure reason if the disk image could not be created or doesn't exist.
string failure_reason = 3;
}
+
+// Request to concierge to destroy a disk image.
+message DestroyDiskImageRequest {
+ // The cryptohome id for the user's encrypted storage.
+ string cryptohome_id = 1;
+
+ // The path to the disk image. This must be a relative path.
+ string disk_path = 2;
+
+ // The storage location for the disk image.
+ StorageLocation storage_location = 3;
+}
+
+// Response to a DestroyDiskImageRequest.
+message DestroyDiskImageResponse {
+ // If DISK_STATUS_DESTROYED, the disk image has been successfully destroyed.
+ // If DISK_STATUS_DOES_NOT_EXIST, the disk image had already been removed.
+ DiskImageStatus status = 1;
+
+ // The failure reason if the disk image could not be destroyed or doesn't exist.
+ string failure_reason = 3;
+}