[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [XEN] Fix XENVER_capabilities hypercall.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
# Date 1170238286 0
# Node ID 7d3bb465e938575dfa54f362b87337d3ee012f4b
# Parent  61262143a4b07687b47a444a46e5538a9744fd0f
[XEN] Fix XENVER_capabilities hypercall.

Passing an array to a function turns it into a pointer which confuses
safe_strcat.

Also fix 54->64 typo in ia64 tree.

Thanks to Alex Williamson for pointing out the problem.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
---
 xen/arch/ia64/xen/xensetup.c |   18 +++++++++---------
 xen/arch/powerpc/setup.c     |    4 ++--
 xen/arch/x86/setup.c         |   24 ++++++++++++------------
 xen/common/kernel.c          |    4 ++--
 4 files changed, 25 insertions(+), 25 deletions(-)

diff -r 61262143a4b0 -r 7d3bb465e938 xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c      Tue Jan 30 18:30:18 2007 +0000
+++ b/xen/arch/ia64/xen/xensetup.c      Wed Jan 31 10:11:26 2007 +0000
@@ -545,21 +545,21 @@ printk("num_online_cpus=%d, max_cpus=%d\
     startup_cpu_idle_loop();
 }
 
-void arch_get_xen_caps(xen_capabilities_info_t info)
+void arch_get_xen_caps(xen_capabilities_info_t *info)
 {
     int major = xen_major_version();
     int minor = xen_minor_version();
     char s[32];
 
-    info[0] = '\0';
-
-    snprintf(s, sizeof(s), "xen-%d.%d-ia54 ", major, minor);
-    safe_strcat(info, s);
+    (*info)[0] = '\0';
+
+    snprintf(s, sizeof(s), "xen-%d.%d-ia64 ", major, minor);
+    safe_strcat(*info, s);
 
     if (vmx_enabled)
     {
         snprintf(s, sizeof(s), "hvm-%d.%d-ia64 ", major, minor);
-        safe_strcat(info, s);
-    }
-}
-
+        safe_strcat(*info, s);
+    }
+}
+
diff -r 61262143a4b0 -r 7d3bb465e938 xen/arch/powerpc/setup.c
--- a/xen/arch/powerpc/setup.c  Tue Jan 30 18:30:18 2007 +0000
+++ b/xen/arch/powerpc/setup.c  Wed Jan 31 10:11:26 2007 +0000
@@ -444,8 +444,8 @@ void __init __start_xen_ppc(
 
 }
 
-extern void arch_get_xen_caps(xen_capabilities_info_t info);
-void arch_get_xen_caps(xen_capabilities_info_t info)
+extern void arch_get_xen_caps(xen_capabilities_info_t *info);
+void arch_get_xen_caps(xen_capabilities_info_t *info)
 {
 }
 
diff -r 61262143a4b0 -r 7d3bb465e938 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Tue Jan 30 18:30:18 2007 +0000
+++ b/xen/arch/x86/setup.c      Wed Jan 31 10:11:26 2007 +0000
@@ -800,52 +800,52 @@ void __init __start_xen(multiboot_info_t
     startup_cpu_idle_loop();
 }
 
-void arch_get_xen_caps(xen_capabilities_info_t info)
+void arch_get_xen_caps(xen_capabilities_info_t *info)
 {
     int major = xen_major_version();
     int minor = xen_minor_version();
     char s[32];
 
-    info[0] = '\0';
+    (*info)[0] = '\0';
 
 #if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
 
     snprintf(s, sizeof(s), "xen-%d.%d-x86_32 ", major, minor);
-    safe_strcat(info, s);
+    safe_strcat(*info, s);
     if ( hvm_enabled )
     {
         snprintf(s, sizeof(s), "hvm-%d.%d-x86_32 ", major, minor);
-        safe_strcat(info, s);
+        safe_strcat(*info, s);
     }
 
 #elif defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE)
 
     snprintf(s, sizeof(s), "xen-%d.%d-x86_32p ", major, minor);
-    safe_strcat(info, s);
+    safe_strcat(*info, s);
     if ( hvm_enabled )
     {
         snprintf(s, sizeof(s), "hvm-%d.%d-x86_32 ", major, minor);
-        safe_strcat(info, s);
+        safe_strcat(*info, s);
         snprintf(s, sizeof(s), "hvm-%d.%d-x86_32p ", major, minor);
-        safe_strcat(info, s);
+        safe_strcat(*info, s);
     }
 
 #elif defined(CONFIG_X86_64)
 
     snprintf(s, sizeof(s), "xen-%d.%d-x86_64 ", major, minor);
-    safe_strcat(info, s);
+    safe_strcat(*info, s);
 #ifdef CONFIG_COMPAT
     snprintf(s, sizeof(s), "xen-%d.%d-x86_32p ", major, minor);
-    safe_strcat(info, s);
+    safe_strcat(*info, s);
 #endif
     if ( hvm_enabled )
     {
         snprintf(s, sizeof(s), "hvm-%d.%d-x86_32 ", major, minor);
-        safe_strcat(info, s);
+        safe_strcat(*info, s);
         snprintf(s, sizeof(s), "hvm-%d.%d-x86_32p ", major, minor);
-        safe_strcat(info, s);
+        safe_strcat(*info, s);
         snprintf(s, sizeof(s), "hvm-%d.%d-x86_64 ", major, minor);
-        safe_strcat(info, s);
+        safe_strcat(*info, s);
     }
 
 #endif
diff -r 61262143a4b0 -r 7d3bb465e938 xen/common/kernel.c
--- a/xen/common/kernel.c       Tue Jan 30 18:30:18 2007 +0000
+++ b/xen/common/kernel.c       Wed Jan 31 10:11:26 2007 +0000
@@ -162,10 +162,10 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL
     case XENVER_capabilities:
     {
         xen_capabilities_info_t info;
-        extern void arch_get_xen_caps(xen_capabilities_info_t info);
+        extern void arch_get_xen_caps(xen_capabilities_info_t *info);
 
         memset(info, 0, sizeof(info));
-        arch_get_xen_caps(info);
+        arch_get_xen_caps(&info);
 
         if ( copy_to_guest(arg, (char *)info, sizeof(info)) )
             return -EFAULT;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.