mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-24 14:32:33 +00:00
runtime: no need to write virtiofsd error to log
The scanner reads nothing from viriofsd stderr pipe, because param '--syslog' rediercts stderr to syslog. So there is no need to write scanner.Text() to kata log Fixes: #4063 Signed-off-by: Zhuoyu Tie <tiezhuoyu@outlook.com>
This commit is contained in:
parent
4f551e3428
commit
6e79042aa0
@ -6,7 +6,6 @@
|
|||||||
package virtcontainers
|
package virtcontainers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
@ -134,24 +133,14 @@ func (v *virtiofsd) Start(ctx context.Context, onQuit onQuitFunc) (int, error) {
|
|||||||
|
|
||||||
v.Logger().WithField("path", v.path).Info()
|
v.Logger().WithField("path", v.path).Info()
|
||||||
v.Logger().WithField("args", strings.Join(args, " ")).Info()
|
v.Logger().WithField("args", strings.Join(args, " ")).Info()
|
||||||
stderr, err := cmd.StderrPipe()
|
|
||||||
if err != nil {
|
|
||||||
return pid, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err = utils.StartCmd(cmd); err != nil {
|
if err = utils.StartCmd(cmd); err != nil {
|
||||||
return pid, err
|
return pid, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Monitor virtiofsd's stderr and stop sandbox if virtiofsd quits
|
|
||||||
go func() {
|
go func() {
|
||||||
scanner := bufio.NewScanner(stderr)
|
|
||||||
for scanner.Scan() {
|
|
||||||
v.Logger().WithField("source", "virtiofsd").Info(scanner.Text())
|
|
||||||
}
|
|
||||||
v.Logger().Info("virtiofsd quits")
|
|
||||||
// Wait to release resources of virtiofsd process
|
|
||||||
cmd.Process.Wait()
|
cmd.Process.Wait()
|
||||||
|
v.Logger().Info("virtiofsd quits")
|
||||||
if onQuit != nil {
|
if onQuit != nil {
|
||||||
onQuit()
|
onQuit()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user