Initialize last_error in libxc
PATCH 1/1 Initialize last_error in libxc
Hi,
When I tested some xm commands, I saw the following unjust error messages.
# xm vcpu-pin vm1 0 99 Error: Cannot pin vcpu: 0 to cpu: [99] - (2865808, 'Unknown error code', '\x90\xba+') Usage: xm vcpu-pin <Domain> <VCPU|all> <CPUs|all>
Set which CPUs a VCPU can use.
# xm trigger vm1 INIT Error: (2865808, 'Unknown error code', '\x90\xba+') Usage: xm trigger <Domain> <nmi|reset|init> [<VCPU>]
Send a trigger to a domain.
I think that the cause is because _xc_get_last_error() in libxc does not initialize last_error.
This patch initializes last_error. The test result is as follows.
# xm vcpu-pin vm1 0 99 Error: Cannot pin vcpu: 0 to cpu: [99] - (22, 'Invalid argument') Usage: xm vcpu-pin <Domain> <VCPU|all> <CPUs|all>
Set which CPUs a VCPU can use.
# xm trigger vm1 INIT Error: (38, 'Function not implemented') Usage: xm trigger <Domain> <nmi|reset|init> [<VCPU>]
Send a trigger to a domain.
Signed-off-by Masaki Kanno <[email protected]>
Best regards,
Kan
tools/libxc/xc_private.c +1 -0
@@ -52,6 +52,7 @@ _xc_get_last_error(void)if (last_error ==NULL ) { last_error =malloc (sizeof (xc_error));pthread_setspecific (last_error_pkey, last_error); +xc_clear_last_error (); }return last_error;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel