mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
host misc fix
This commit is contained in:
@@ -61,7 +61,7 @@ func MountFusefs(fetcherfsPath, url, tmpdir, token, mntpath string, blocksize in
|
||||
|
||||
var cmd = []string{fetcherfsPath, "-s", "-o", opts, mntpath}
|
||||
log.Infof("%s", strings.Join(cmd, " "))
|
||||
err := procutils.NewCommand(cmd[0], cmd[1:]...).Run()
|
||||
err := procutils.NewRemoteCommandAsFarAsPossible(cmd[0], cmd[1:]...).Run()
|
||||
if err != nil {
|
||||
log.Errorf("Mount fetcherfs filed: %s", err)
|
||||
procutils.NewCommand("umount", mntpath).Run()
|
||||
|
||||
@@ -96,13 +96,16 @@ func detectiveKVMModuleSupport() string {
|
||||
func ModprobeKvmModule(name string, remove, nest bool) bool {
|
||||
var params = []string{"modprobe"}
|
||||
if remove {
|
||||
params = append(params, "-r")
|
||||
if err := procutils.NewCommand("rmmod", name).Run(); err != nil {
|
||||
log.Errorf("rmmod failed %s: %s", name, err)
|
||||
}
|
||||
}
|
||||
params = append(params, name)
|
||||
if nest {
|
||||
params = append(params, "nested=1")
|
||||
}
|
||||
if err := procutils.NewCommand(params[0], params[1:]...).Run(); err != nil {
|
||||
log.Errorf("Modprobe kvm %v failed: %s", params, err)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user