Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions base/cvd/cuttlefish/host/commands/cvd/cli/commands/reset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ class CvdResetCommandHandler : public CvdCommandHandler {
}
CF_EXPECT(KillAllCuttlefishInstances(
/* clear_instance_dirs*/ options.clean_runtime_dir));

if (DirectoryExists("/tmp/acloud_cvd_temp/")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As there are already 3 non-test occurrences of this string, maybe worth making a shared constant in a new file somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'll be the next pr after this one. ;)

CF_EXPECT(RecursivelyRemoveDirectory("/tmp/acloud_cvd_temp/"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it seem worth it to delete the contents of this directory without deleting the directory itself?

I could imagine a user changing the directory permissions of this to facilitate some multi-user interaction, though it would have to be reset on every reboot anyway since /tmp is not going to be persistent. Maybe not that significant in that context.

Copy link
Collaborator Author

@3405691582 3405691582 Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may not be worth the effort. If we want to support the multi-user case better, then we probably need to improve the directory structure here and maybe put some of these files elsewhere, but that's a larger change.

But I'm happy to make the adjustment if you think it's worthwhile.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the structure has other downsides, it breaks compatibility with python acloud. Might as well delete it then.

}

return {};
}
cvd_common::Args CmdList() const override { return {kResetSubcmd}; }
Expand Down
Loading