Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
virtme-ng: print an explicit error when a valid pts is not found
When running in script-mode we need to channel the stdin/stdout/stderr of the guest command into the host's stdin/stdout/stderr. However, if we don't have read/write permission to operate on the current pts we may get the following (quite obscure) error: qemu-system-x86_64: -chardev file,id=stdout,path=/proc/self/fd/1: Could not open '/proc/self/fd/1': Permission denied For example, it is really easy to reproduce this problem switching to a different user and then running vng: arighi@gpd$ sudo su - sbuild sbuild@gpd:~$ vng -r -- uname -r qemu-system-x86_64: -chardev file,id=stdout,path=/proc/self/fd/1: Could not open '/proc/self/fd/1': Permission denied Instead of printing the qemu error, let's check directly the current stdin/stdout/stderr and if they don't exist or if we don't have the proper permissions to access them, report a more clear error (with a short hint on how to solve this issue): sbuild@gpd:~$ vng -r -- uname -r ERROR: not a valid pts, try to run vng inside tmux or screen This can help to save some time for those that may run virtme-ng after switching to a different user or any other similar scenarios, as discussed in #60. Signed-off-by: Andrea Righi <[email protected]>
- Loading branch information