host misc fix

This commit is contained in:
wanyaoqi
2020-01-08 14:19:26 +08:00
parent 8d7808b3fb
commit eb16796db1
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -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()
+4 -1
View File
@@ -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