On Mon, Aug 26, 2019 at 07:51:18AM +0000, Nikolay Shirokovskiy wrote:
On 08.08.2019 21:00, Daniel Henrique Barboza wrote:
> (CCing Nikolay Shirokovskiy, author of 29f2b5248c )
>
> On 8/7/19 8:34 AM, Roman Bolshakov wrote:
>> An attempt to poweroff a VM from inside triggers the error for existing
>> session of virsh console and it returns with non-zero exit code:
>> error: internal error: console stream EOF
>>
>> The message and status code are misleading because there's no real
>> error.
Hi, all.
Sorry for the late response, I was on a long vacation and have very limited
access to the internet.
Yes, the commit 29f2b5248c6 introduced printing this error if domain was
shutdowned. This can be unnecessary if the person who run the console
is the person who shutdowned the domain. But it is not so if these are
two different persons. Also what if domain is not shutdowned but rather
crashed? So I think it is make sense to leave the message as it is.
Hi Nikolay,
virsh domstate + QEMU GA can be used to extract the information if
you're seeking to find the real termination reason. It has more states
and was designed specifically for the task.
IMO when virsh console is used in "interactive" shell scripts or
embedded in another application, bad exit code should mean there's a
problem in retrieving the serial output and thus the serial session
cannot be considered complete. And unconditional failure doesn't provive
a way to distinguish line errors from successful serial session.
Hope this helps,
Roman