cmdlib: let qemu write command output on its stdout#1403
cmdlib: let qemu write command output on its stdout#1403openshift-merge-robot merged 2 commits intocoreos:masterfrom
Conversation
|
The second commit here cleans up the output of |
|
Oh that is just a super cool approach. |
|
@jlebon needs to pacify shellcheck |
|
Done! |
|
Hmm weird, looks like |
|
/hold |
2a9105f to
e44ffb7
Compare
|
OK, I think I got this working now!
/hold cancel |
Instead of using `tail -qF`, just write the output to a virtio-serial port and tell qemu to output that on its stdout. That way, we don't have to worry about cleaning up the `tail` process at all. This also fixes an issues we've been seeing where `tail` is killed before it had a chance to print the entire command output, which crucially might omit the final error message. Note we close stdin to qemu here otherwise it seems like it just waits forever for input to be written into the virtio port.
Otherwise it always prints a bunch of warnings about getting `EPERM` and the distro using security by obscurity (which while informative, isn't something we're realistically going to address ourselves in the short-term -- and IIRC there are already one or two RHBZs out about that).
|
/lgtm |
| "${srcvirtfs[@]}" -append "root=/dev/vda console=${DEFAULT_TERMINAL} selinux=1 enforcing=0 autorelabel=1" \ | ||
| "${qemu_args[@]}" | ||
| kill %1 | ||
| "${qemu_args[@]}" <&-; then # the <&- here closes stdin otherwise qemu waits forever |
There was a problem hiding this comment.
Neat, and thank you for the comment :)
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, darkmuggle, jlebon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Instead of using
tail -qF, just write the output to a virtio-serialport and tell qemu to output that on its stdout. That way, we don't have
to worry about cleaning up the
tailprocess at all.This also fixes an issues we've been seeing where
tailis killedbefore it had a chance to print the entire command output, which
crucially might omit the final error message.