Skip to contentSkip to conversation

python: do not report handled EAGAIN error

PATCH In review Marek Marczykowski-Górecki 2 participants 2 messages Aug 20, 2019 – Aug 21, 2019 Arm/actions semi architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python: do not report handled EAGAIN error

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()"

---
 tools/python/xen/lowlevel/xs/xs.c | 1 +
 1 file changed, 1 insertion(+)
tools/python/xen/lowlevel/xs/xs.c +1 -0
index ea50f86bc3..621039d7a7 100644
@@ -531,6 +531,7 @@ again:
     free(xsval);
 
     if (!val && errno == EAGAIN) {
+        PyErr_Clear();
         goto again;
     }
 
Signature · 7 lines
2.20.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Marek Marczykowski-Górecki

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:

Quoted 7 lines

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()"

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel