Terminate backend when frontend vanishes early
PATCH 1/1 Terminate backend when frontend vanishes early
Ensure the backend terminates when the frontend vanishes before the connection is established. This happens when the guest doesn't have the devices.
Signed-off-by Markus Armbruster <[email protected]>
---
Note:
* Callers of xenfb_wait_for_state() already do the right thing when it returns XenbusStateUnknown.
* xenfb_read_state() can't return negative values. The useless test is a leftover from an older version.
tools/xenfb/xenfb.c +2 -3
@@ -245,11 +246,10 @@ static int xenfb_wait_for_state(struct xunsigned state, dummy;char **vec; + awaited |=1 << XenbusStateUnknown; +for (;;) { state =xenfb_read_state (xsh, dir); -if (state <0 ) -return -1 ; -if ((1 << state) & awaited)return state;