Skip to content

Commit

Permalink
fix(host): not use losetupioctl.DetachAndRemoveDevice (#21779)
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi authored Dec 10, 2024
1 parent 2d4bda9 commit ebbb900
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/hostman/container/storage/local_raw/local_raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"yunion.io/x/onecloud/pkg/hostman/container/storage"
"yunion.io/x/onecloud/pkg/util/fileutils2"
"yunion.io/x/onecloud/pkg/util/losetup"
losetupioctl "yunion.io/x/onecloud/pkg/util/losetup/ioctl"
)

func init() {
Expand Down Expand Up @@ -78,7 +77,8 @@ func (l localRaw) DisconnectDisk(diskPath string, mountPoint string) error {
for _, dev := range devs.LoopDevs {
if dev.BackFile == diskPath {
log.Infof("Start detach loop device %s", dev.Name)
if err := losetupioctl.DetachAndRemoveDevice(dev.Name); err != nil {
//if err := losetupioctl.DetachAndRemoveDevice(dev.Name); err != nil {
if err := losetup.DetachDevice(dev.Name); err != nil {
if strings.Contains(err.Error(), "No such device or address") {
return nil
}
Expand Down

0 comments on commit ebbb900

Please sign in to comment.