]> xenbits.xensource.com Git - people/jgross/xen.git/commitdiff
tools/misc: drop all libxc internals from xen-mfndump.c
authorJuergen Gross <jgross@suse.com>
Sun, 23 Aug 2020 08:00:13 +0000 (10:00 +0200)
committerJuergen Gross <jgross@suse.com>
Fri, 28 Aug 2020 15:00:29 +0000 (17:00 +0200)
The last libxc internal used by xen-mfndump.c is the ERROR() macro.
Add a simple definition for that macro to xen-mfndump.c and replace
the libxc private header includes by official ones.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wl@xen.org>
tools/misc/Makefile
tools/misc/xen-mfndump.c

index 2a7f2ec42d7cf1782c0782e6d3406e0f1e1f86dc..7d37f297a90ad257b294cb99ae5b488b8c4bc98e 100644 (file)
@@ -99,8 +99,6 @@ xen-hptool: xen-hptool.o
 
 xenhypfs.o: CFLAGS += $(CFLAGS_libxenhypfs)
 
-# xen-mfndump incorrectly uses libxc internals
-xen-mfndump.o: CFLAGS += -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall)
 xen-mfndump: xen-mfndump.o
        $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
 
index 92bc954ce01bdc4c91fb7b96ce6b79404c46d60f..62121bd24123aa195229c929bbf260360557cbd3 100644 (file)
@@ -1,15 +1,20 @@
-#define XC_WANT_COMPAT_MAP_FOREIGN_API
-#include <xenctrl.h>
-#include <xc_private.h>
-#include <xc_core.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
 #include <unistd.h>
 #include <inttypes.h>
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
+#include <xenctrl.h>
+#include <xenguest.h>
+
 #include <xen-tools/libs.h>
 
 #define M2P_SIZE(_m)    ROUNDUP(((_m) * sizeof(xen_pfn_t)), 21)
 #define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL))
 
+#define ERROR(msg, args...) fprintf(stderr, msg, ## args)
+
 static xc_interface *xch;
 
 int help_func(int argc, char *argv[])