Merge pull request #4709 from wanyaoqi/bugfix/wyq/host-misc-20200108

host misc fix
This commit is contained in:
yunion-ci-robot
2020-01-09 00:03:58 +08:00
committed by GitHub
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