-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EAGAIN error wasn't properly handled. Details in patch description. Fixes QubesOS/qubes-issues#4890
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
From 944d5e53fa4d77dc98d7b7e8a580f939a66e2212 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= | ||
<[email protected]> | ||
Date: Tue, 20 Aug 2019 00:54:04 +0200 | ||
Subject: [PATCH] python: do not report handled EAGAIN error | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
Organization: Invisible Things Lab | ||
Cc: Marek Marczykowski-Górecki <[email protected]> | ||
|
||
match_watch_by_token() when returns an error, sets also exception within | ||
python. This is generally the right thing to do, but when | ||
xspy_read_watch() handle EAGAIN error internally, the exception needs to | ||
be cleared. Otherwise it will fail like this: | ||
|
||
xen.lowlevel.xs.Error: (11, 'Resource temporarily unavailable') | ||
|
||
The above exception was the direct cause of the following exception: | ||
|
||
Traceback (most recent call last): | ||
(...) | ||
result = self.handle.read_watch() | ||
SystemError: <method 'read_watch' of 'xen.lowlevel.xs.xs' objects> returned a result with an error set | ||
|
||
Fixes f6e1023412 "python: Extract registered watch search logic from xspy_read_watch()" | ||
Signed-off-by: Marek Marczykowski-Górecki <[email protected]> | ||
--- | ||
tools/python/xen/lowlevel/xs/xs.c | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c | ||
index ea50f86bc3..621039d7a7 100644 | ||
--- a/tools/python/xen/lowlevel/xs/xs.c | ||
+++ b/tools/python/xen/lowlevel/xs/xs.c | ||
@@ -531,6 +531,7 @@ again: | ||
free(xsval); | ||
|
||
if (!val && errno == EAGAIN) { | ||
+ PyErr_Clear(); | ||
goto again; | ||
} | ||
|
||
-- | ||
2.20.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters