diff --git a/src/cmdlib.sh b/src/cmdlib.sh index e477a628ad..c183beaf8d 100755 --- a/src/cmdlib.sh +++ b/src/cmdlib.sh @@ -733,9 +733,6 @@ runvm() { # and include all GPG keys find /etc/pki/rpm-gpg/ -type f >> "${vmpreparedir}/hostfiles" - local cmdoutput - cmdoutput=${tmp_builddir}/cmd-output.txt - # the reason we do a heredoc here is so that the var substition takes # place immediately instead of having to proxy them through to the VM cat > "${vmpreparedir}/init" <> "${tmp_builddir}"/cmd.sh done - touch "${runvm_console}" "${cmdoutput}" - setpriv --pdeathsig SIGTERM -- tail -qF "${cmdoutput}" --pid $$ & - local tail_pid=$! + touch "${runvm_console}" # There seems to be some false positives in shellcheck # https://github.com/koalaman/shellcheck/issues/2217 @@ -826,7 +821,9 @@ EOF if [ -z "${RUNVM_SHELL:-}" ]; then if ! "${kola_args[@]}" -- "${base_qemu_args[@]}" \ - "${qemu_args[@]}"; then + -device virtserialport,chardev=virtioserial0,name=cosa-cmdout \ + -chardev stdio,id=virtioserial0 \ + "${qemu_args[@]}" < /dev/zero; then # qemu hangs if it has nothing to read on stdin cat "${runvm_console}" fatal "Failed to run 'kola qemuexec'" fi @@ -845,13 +842,6 @@ EOF fi rc="$(cat "${rc_file}")" - # XXX: this is for debugging temporarily - if [ -n "${TAIL_SLEEP:-}" ]; then - sleep "${TAIL_SLEEP}" - fi - # cleanup tail before nuking dir containing file it's following - kill "$tail_pid" - if [ -n "${cleanup_tmpdir:-}" ]; then rm -rf "${tmp_builddir}" unset tmp_builddir diff --git a/src/secex-genprotimgvm-scripts/runvm.sh b/src/secex-genprotimgvm-scripts/runvm.sh index c90a2c604d..a5361a1021 100644 --- a/src/secex-genprotimgvm-scripts/runvm.sh +++ b/src/secex-genprotimgvm-scripts/runvm.sh @@ -56,7 +56,7 @@ else fi if ! "${kola_args[@]}" -- "${base_qemu_args[@]}" \ - "${qemu_args[@]}" <&-; then # the <&- here closes stdin otherwise qemu waits forever + "${qemu_args[@]}" < /dev/zero; then # qemu hangs if it has nothing to read on stdin cat "${runvm_console}" echo "Failed to run 'kola qemuexec'" exit 1