Skip to contentSkip to conversation

Fix xc_hvm_save/restore for non-x86 builds

PATCH New Alex Williamson 1 participant 1 message Jan 22, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix xc_hvm_save/restore for non-x86 builds

Tools currently won't build on non-x86 due to xc_hvm_save/restore
only being built for CONFIG_HVM, but called from xcutils regardless. This patch adds stub functions for those of us that don't support HVM save/restore just yet. Thanks,

Alex

---

tools/libxc/Makefile +5 -1
diff -r 1c0ca58e8c16 tools/libxc/Makefile
@@ -28,7 +28,11 @@ GUEST_SRCS-$(CONFIG_X86) += xc_linux_bui
 GUEST_SRCS-$(CONFIG_X86) += xc_linux_build.c
 GUEST_SRCS-$(CONFIG_IA64) += xc_linux_build.c
 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_linux_restore.c xc_linux_save.c
-GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c xc_hvm_restore.c xc_hvm_save.c
+ifeq ($(CONFIG_HVM),y)
+GUEST_SRCS-y += xc_hvm_build.c xc_hvm_restore.c xc_hvm_save.c
+else
+GUEST_SRCS-y += xc_hvm_stubs.c
+endif
 
 -include $(XEN_TARGET_ARCH)/Makefile
 
tools/libxc/xc_hvm_stubs.c new file +37 -0
diff -r 1c0ca58e8c16 tools/libxc/xc_hvm_stubs.c
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * xc_hvm_stubs.c
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ */
+
+#include "xg_private.h"
+
+int xc_hvm_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
+                  uint32_t max_factor, uint32_t flags, int (*suspend)(int))
+{
+    ERROR("HVM save is currently unsupported.");
+    return 1;
+}
+
+int xc_hvm_restore(int xc_handle, int io_fd,
+                     uint32_t dom, unsigned long nr_pfns,
+                     unsigned int store_evtchn, unsigned long *store_mfn,
+                     unsigned int console_evtchn, unsigned long *console_mfn,
+                     unsigned int pae, unsigned int apic)
+{
+    ERROR("HVM restore is currently unsupported.");
+    return 1;
+}
+