From e5f4146813482704796d0b7a8389e22c4eb6192f Mon Sep 17 00:00:00 2001 From: 3405691582 Date: Tue, 29 Jul 2025 18:59:26 +0000 Subject: [PATCH] Empty the acloud_cvd_temp dir on cvd reset. The acloud_cvd_temp directory contains instance lock files. If we are resetting with cvd reset, we should remove these, since we are resetting state completely anyway. This will become more important later when we are making changes to the way instance locks are acquired, and starting from a clean slate with cvd reset is more convenient than manually removing lock files. --- base/cvd/cuttlefish/host/commands/cvd/cli/commands/reset.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/base/cvd/cuttlefish/host/commands/cvd/cli/commands/reset.cpp b/base/cvd/cuttlefish/host/commands/cvd/cli/commands/reset.cpp index c836e298f63..9adc58204c1 100644 --- a/base/cvd/cuttlefish/host/commands/cvd/cli/commands/reset.cpp +++ b/base/cvd/cuttlefish/host/commands/cvd/cli/commands/reset.cpp @@ -158,6 +158,11 @@ class CvdResetCommandHandler : public CvdCommandHandler { } CF_EXPECT(KillAllCuttlefishInstances( /* clear_instance_dirs*/ options.clean_runtime_dir)); + + if (DirectoryExists("/tmp/acloud_cvd_temp/")) { + CF_EXPECT(RecursivelyRemoveDirectory("/tmp/acloud_cvd_temp/")); + } + return {}; } cvd_common::Args CmdList() const override { return {kResetSubcmd}; }