Additional VM ZFS delete fixes

This commit is contained in:
SimonFair
2024-09-02 18:03:10 +01:00
parent ceb97ab392
commit 753d87c690
2 changed files with 36 additions and 8 deletions
@@ -2004,8 +2004,17 @@
if (is_file($cfg)) unlink($cfg);
if (is_file($xml)) unlink($xml);
if (is_dir($dir) && $this->is_dir_empty($dir)) {
$error = my_rmdir($dir);
qemu_log("$domain","delete empty $dir $error");
$result= my_rmdir($dir);
if ($result['type'] == "zfs") {
qemu_log("$domain","delete empty zfs $dir {$result['rtncode']}");
if (isset($result['dataset'])) qemu_log("$domain","dataset {$result['dataset']} ");
if (isset($result['cmd'])) qemu_log("$domain","Command {$result['cmd']} ");
if (isset($result['output'])) {
$outputlogs = implode(" ",$result['output']);
qemu_log("$domain","Output $outputlogs end");
}
}
else qemu_log("$domain","delete empty $dir {$result['rtncode']}");
}
}