char path[256];
FILE *fp;
- sprintf(path, "/var/lib/xen/qemu-save.%u", dom);
+ sprintf(path, XC_DEVICE_MODEL_RESTORE_FILE".%u", dom);
fp = fopen(path, "wb");
if ( !fp )
return -1;
unsigned int store_evtchn, unsigned long *store_mfn,
unsigned int console_evtchn, unsigned long *console_mfn,
unsigned int hvm, unsigned int pae, int superpages);
+/**
+ * xc_domain_restore writes a file to disk that contains the device
+ * model saved state.
+ * The pathname of this file is XC_DEVICE_MODEL_RESTORE_FILE; The domid
+ * of the new domain is automatically appended to the filename,
+ * separated by a ".".
+ */
+#define XC_DEVICE_MODEL_RESTORE_FILE "/var/lib/xen/qemu-resume"
/**
* This function will create a domain for a paravirtualized Linux
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
+#include <xenctrl.h>
+#include <xc_dom.h>
+#include <xenguest.h>
#include "libxl.h"
#include "libxl_utils.h"
#include "libxl_internal.h"
dm_info->saved_state = NULL;
if (info->hvm) {
ret = asprintf(&dm_info->saved_state,
- "/var/lib/xen/qemu-save.%d", domid);
+ XC_DEVICE_MODEL_RESTORE_FILE".%d", domid);
ret = (ret < 0) ? ERROR_FAIL : 0;
}
#define LIBXL_HVM_EXTRA_MEMORY 2048
#define LIBXL_MIN_DOM0_MEM (128*1024)
#define QEMU_SIGNATURE "DeviceModelRecord0002"
+#define SAVEFILE "/var/lib/xen/qemu-save"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
args = ImageHandler.getDeviceModelArgs(self, restore)
args = args + ([ "-M", "xenfv"])
if restore:
- args = args + ([ "-loadvm", "/var/lib/xen/qemu-save.%d" %
+ args = args + ([ "-loadvm", "/var/lib/xen/qemu-resume.%d" %
self.vm.getDomid() ])
return args