mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
fix: zero clean disk add logs (#16171)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user