WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 1/4] xen: Take into account Xen control interface cha

To: konrad.wilk@xxxxxxxxxx, ian.campbell@xxxxxxxxxx, vgoyal@xxxxxxxxxx, horms@xxxxxxxxxxxx, olaf@xxxxxxxxx, kexec@xxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 1/4] xen: Take into account Xen control interface changes since Xen Ver. 4.1
From: Daniel Kiper <dkiper@xxxxxxxxxxxx>
Date: Sun, 21 Aug 2011 15:51:39 +0200
Cc:
Delivery-date: Sun, 21 Aug 2011 06:54:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.3.28i
xc_interface_open() receive three arguments instead of void and returns
pointer to xc_interface type instead of int since Xen Ver. 4.1. Take into
account that and allow kexec-tools compilation with all versions of Xen.

Signed-off-by: Daniel Kiper <dkiper@xxxxxxxxxxxx>
---
 kexec/crashdump-xen.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/kexec/crashdump-xen.c b/kexec/crashdump-xen.c
index b347764..9dfabf8 100644
--- a/kexec/crashdump-xen.c
+++ b/kexec/crashdump-xen.c
@@ -126,19 +126,32 @@ unsigned long xen_architecture(struct crash_elf_info 
*elf_info)
 {
        unsigned long machine = elf_info->machine;
 #ifdef HAVE_LIBXENCTRL
-       int xc, rc;
+       int rc;
        xen_capabilities_info_t capabilities;
+#ifdef XENCTRL_HAS_XC_INTERFACE
+       xc_interface *xc;
+#else
+       int xc;
+#endif
 
        if (!xen_present())
                goto out;
 
        memset(capabilities, '0', XEN_CAPABILITIES_INFO_LEN);
 
+#ifdef XENCTRL_HAS_XC_INTERFACE
+       xc = xc_interface_open(NULL, NULL, 0);
+       if ( !xc ) {
+               fprintf(stderr, "failed to open xen control interface.\n");
+               goto out;
+       }
+#else
        xc = xc_interface_open();
        if ( xc == -1 ) {
                fprintf(stderr, "failed to open xen control interface.\n");
                goto out;
        }
+#endif
 
        rc = xc_version(xc, XENVER_capabilities, &capabilities[0]);
        if ( rc == -1 ) {
-- 
1.5.6.5

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

<Prev in Thread] Current Thread [Next in Thread>