* [Xen-devel] [PATCH] python: do not report handled EAGAIN error
@ 2019-08-20 2:12 Marek Marczykowski-Górecki
2019-08-21 11:06 ` Wei Liu
0 siblings, 1 reply; 2+ messages in thread
From: Marek Marczykowski-Górecki @ 2019-08-20 2:12 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Marek Marczykowski-Górecki, Wei Liu
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 <marmarek@invisiblethingslab.com>
---
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
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Xen-devel] [PATCH] python: do not report handled EAGAIN error
2019-08-20 2:12 [Xen-devel] [PATCH] python: do not report handled EAGAIN error Marek Marczykowski-Górecki
@ 2019-08-21 11:06 ` Wei Liu
0 siblings, 0 replies; 2+ messages in thread
From: Wei Liu @ 2019-08-21 11:06 UTC (permalink / raw)
To: Marek Marczykowski-Górecki; +Cc: xen-devel, Ian Jackson, Wei Liu
On Tue, Aug 20, 2019 at 04:12:41AM +0200, Marek Marczykowski-Górecki wrote:
> 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 <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wl@xen.org>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-21 11:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20 2:12 [Xen-devel] [PATCH] python: do not report handled EAGAIN error Marek Marczykowski-Górecki
2019-08-21 11:06 ` Wei Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).