summaryrefslogtreecommitdiff
path: root/image/backends/tar.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2024-05-22 11:23:59 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2024-05-22 11:23:59 -0500
commit75db43b7fc8a049090a6f77a31a658a718268ac7 (patch)
tree90cf93b34bae5505713e143a8329fcfa29363b1c /image/backends/tar.cc
parent4f8a406b0a6bb3669e63dce5074fdd9b15be3d9b (diff)
downloadhorizon-75db43b7fc8a049090a6f77a31a658a718268ac7.tar.gz
horizon-75db43b7fc8a049090a6f77a31a658a718268ac7.tar.bz2
horizon-75db43b7fc8a049090a6f77a31a658a718268ac7.tar.xz
horizon-75db43b7fc8a049090a6f77a31a658a718268ac7.zip
image: backends: Implement a cleanup() method
This allows backends to implement their own handling of target umounts. Notably, the tar backend already umounts the target /dev /proc /sys, so our hardcoded cleanup in the Creator caused unnecessary and confusing error output when umount was run a second time. Closes: #345
Diffstat (limited to 'image/backends/tar.cc')
-rw-r--r--image/backends/tar.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/image/backends/tar.cc b/image/backends/tar.cc
index b05f4a5..a110acb 100644
--- a/image/backends/tar.cc
+++ b/image/backends/tar.cc
@@ -175,6 +175,12 @@ ret:
return 0;
}
+
+ void cleanup() override {
+ /* We call umount during creation to avoid including the dirs in the tarball,
+ * so we don't need the default cleanup to run. */
+ return;
+ }
};
__attribute__((constructor(400)))