mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
libxl: preserve errno in libxl__xcinfo2xlinfo()
Callers observing errors elsewhere may be confused by the ENOSYS that the Flask operation would yield on a Flask-disabled hypervisor. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com> Acked-by: Anthony PERARD <anthony.perard@vates.tech>
This commit is contained in:
1 parent
35a68ba3b2
commit
abd324a247
1 file changed
+2
@@ -277,6 +277,7 @@ void libxl__xcinfo2xlinfo(libxl_ctx *ctx,
|
||||
libxl_dominfo *xlinfo)
|
||||
{
|
||||
size_t size;
|
||||
int saved_errno = errno;
|
||||
|
||||
memcpy(&(xlinfo->uuid), xcinfo->handle, sizeof(xen_domain_handle_t));
|
||||
xlinfo->domid = xcinfo->domain;
|
||||
@@ -284,6 +285,7 @@ void libxl__xcinfo2xlinfo(libxl_ctx *ctx,
|
||||
if (libxl_flask_sid_to_context(ctx, xlinfo->ssidref,
|
||||
&xlinfo->ssid_label, &size) < 0)
|
||||
xlinfo->ssid_label = NULL;
|
||||
errno = saved_errno;
|
||||
|
||||
xlinfo->dying = !!(xcinfo->flags&XEN_DOMINF_dying);
|
||||
xlinfo->shutdown = !!(xcinfo->flags&XEN_DOMINF_shutdown);
|
||||
|
||||