From: Ian Campbell Date: Wed, 27 Oct 2010 11:24:28 +0000 (+0100) Subject: libxc: fix xc_version by handling all known command types. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11329 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=31e4f2432e508c3ee007fed69aad6b867e6a2fed;p=xen.git libxc: fix xc_version by handling all known command types. xend was crashing since 22289:ca4a781c8ae8 due to missing handling of XENVER_commandline. Signed-off-by: Ian Campbell --- diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index 9e0d3ce2db..1c7a5268e8 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -447,11 +447,14 @@ int xc_sysctl(xc_interface *xch, struct xen_sysctl *sysctl) int xc_version(xc_interface *xch, int cmd, void *arg) { DECLARE_HYPERCALL_BOUNCE(arg, 0, XC_HYPERCALL_BUFFER_BOUNCE_OUT); /* Size unknown until cmd decoded */ - size_t sz = 0; + size_t sz; int rc; switch ( cmd ) { + case XENVER_version: + sz = 0; + break; case XENVER_extraversion: sz = sizeof(xen_extraversion_t); break; @@ -467,6 +470,21 @@ int xc_version(xc_interface *xch, int cmd, void *arg) case XENVER_platform_parameters: sz = sizeof(xen_platform_parameters_t); break; + case XENVER_get_features: + sz = sizeof(xen_feature_info_t); + break; + case XENVER_pagesize: + sz = 0; + break; + case XENVER_guest_handle: + sz = sizeof(xen_domain_handle_t); + break; + case XENVER_commandline: + sz = sizeof(xen_commandline_t); + break; + default: + ERROR("xc_version: unknown command %d\n", cmd); + return -EINVAL; } HYPERCALL_BOUNCE_SET_SIZE(arg, sz);