-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vm: support console_cmd to run cmd to collect console log #5677
base: master
Are you sure you want to change the base?
Conversation
Hi Joey! |
Hi Alex, The console_cmd is to run this |
I would propose to run this command externally and redirect its output to the pipe. Syzkaller may read that pipe instead of command spawning. |
How to? |
19cf8f5
to
30cf4f4
Compare
- Sometimes we need customized cmd to get serial log, ex FTDI4232H chip gets serial log through usb directly, thus we need to call cmd like `pyterm.py ftdi://ftdi:4232:FT7JLD0U/1`. - There are seveval places in console implementation to call osutil.Command, move the command code into one function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it looks much better, thanks.
if inst.console == "" { | ||
if inst.console != "" { | ||
log.Logf(0, "associating adb device %v with console %v", inst.device, inst.console) | ||
} else if inst.consoleCmd != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
len(inst.consoleCmd) > 0
} | ||
|
||
// Open console log by cmd. | ||
func OpenConsoleByCmd(args []string) (rc io.ReadCloser, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make it OpenConsoleByCmd(bin string, args []string)
cmd := osutil.Command("ssh", conAddr, "tail", "-f", console) | ||
cmd.Stdout = wpipe | ||
cmd.Stderr = wpipe | ||
if _, err := cmd.StdinPipe(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you drop this part?
Before sending a pull request, please review Contribution Guidelines:
https://github.com/google/syzkaller/blob/master/docs/contributing.md