fix: zero clean disk add logs (#16171)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2023-03-08 09:40:59 +08:00
committed by GitHub
co-authored by Qiu Jian
parent a3081cccb8
commit 26a507ce9a
3 changed files with 20 additions and 3 deletions
+2
View File
@@ -989,6 +989,8 @@ func (s *SKVMGuestInstance) setDestMigrateTLS(ctx context.Context, data *jsonuti
}
func (s *SKVMGuestInstance) migrateEnableMultifd() error {
// https://bugzilla.redhat.com/show_bug.cgi?id=1899442
// Migration fails if both multifd and tls are enabled
if version.LT(s.QemuVersion, "4.0.0") || s.LiveMigrateUseTls {
return nil
}
+6 -1
View File
@@ -357,7 +357,12 @@ func cleanDailyFiles(storagePath, subDir string, keepDay int) {
subDirPath := path.Join(recycleDir, file.Name())
if options.HostOptions.ZeroCleanDiskData {
// try to zero clean files in subdir
zeroclean.ZeroDir(subDirPath)
err := zeroclean.ZeroDir(subDirPath)
if err != nil {
log.Errorf("zeroclean disk %s fail %s", subDirPath, err)
} else {
log.Debugf("zeroclean disk %s success!", subDirPath)
}
}
if output, err := procutils.NewCommand("rm", "-rf", subDirPath).Output(); err != nil {
log.Errorf("clean recycle dir %s error: %s, %s", subDirPath, err, output)
+12 -2
View File
@@ -339,7 +339,12 @@ func (s *SLocalStorage) deleteBackendFile(diskpath string, skipRecycle bool) err
log.Infof("Delete disk file %s immediately", backendPath)
if options.HostOptions.ZeroCleanDiskData {
// try to zero clean files in subdir
zeroclean.ZeroDir(backendPath)
err := zeroclean.ZeroDir(backendPath)
if err != nil {
log.Errorf("zeroclean disk %s fail %s", backendPath, err)
} else {
log.Debugf("zeroclean disk %s success!", backendPath)
}
}
return procutils.NewCommand("rm", "-rf", backendPath).Run()
}
@@ -368,7 +373,12 @@ func (s *SLocalStorage) DeleteDiskfile(diskpath string, skipRecycle bool) error
log.Infof("Delete disk file %s immediately", diskpath)
if options.HostOptions.ZeroCleanDiskData {
// try to zero clean files in subdir
zeroclean.ZeroDir(diskpath)
err := zeroclean.ZeroDir(diskpath)
if err != nil {
log.Errorf("zeroclean disk %s fail %s", diskpath, err)
} else {
log.Debugf("zeroclean disk %s success!", diskpath)
}
}
return procutils.NewCommand("rm", "-rf", diskpath).Run()
}