-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
pacat-simple-vchan: reconnect on vchan eof #141
Conversation
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.2&build=2024042711-4.2&flavor=pull-requests New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.2&build=2024041501-4.2&flavor=update
Failed tests12 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/97064#dependencies 20 fixed
Unstable tests
|
@@ -1217,5 +1225,9 @@ int main(int argc, char *argv[]) | |||
|
|||
unlink(pidfile_path); | |||
close(pidfile_fd); | |||
|
|||
if (!u.ret) | |||
goto main; |
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.
This should be before removing the pidfile, otherwise you end up without it after reconnect.
u.name = domname; | ||
|
||
u.play_ctrl = libvchan_client_init_async(domid, QUBES_PA_SINK_VCHAN_PORT, &play_watch_fd); | ||
u.play_ctrl = libvchan_client_init_async(u.domid, QUBES_PA_SINK_VCHAN_PORT, &u.play_watch_fd); | ||
if (!u.play_ctrl) { | ||
perror("libvchan_client_init_async"); |
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.
This case is now not only initial connect (which, if fails, should result in non-zero exit code), but also in case of reconnect (which may be a clean domain shutdown). In the latter case, exit should be clean. Maybe use exit(u.ret)
here, which should be 0 in the reconnect case? But also, going for exit directly here will leave pidfile not cleaned up... So, either clean it up here (and similarly in exit() calls below), or add a goto label to the pidfile cleanup at the end of main().
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.
I've made a proposal by simply calling a function instead of adding another goto.
31e62fc
to
c4b92a0
Compare
QubesOS/qubes-issues#8975