aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2011-01-21 17:57:31 +0000
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2011-01-21 17:57:31 +0000
commit1b1d0b8b75864c6e26e7af5c95b90ecaeb37a9ff (patch)
tree0c47b7eda450575e04fc0cfdb8abe1da650e3a07
parente1e6f0f906c72f646b0b1213d202c19356b41de1 (diff)
downloadxen-1b1d0b8b75864c6e26e7af5c95b90ecaeb37a9ff.tar.gz
xen-1b1d0b8b75864c6e26e7af5c95b90ecaeb37a9ff.tar.bz2
xen-1b1d0b8b75864c6e26e7af5c95b90ecaeb37a9ff.zip
tools: Change the name of the qemu save file at restore time
Change the name of the qemu save file to qemu-resume at restore time so that it doesn't collide with the name of the next save file. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r--tools/libxc/xc_domain_restore.c2
-rw-r--r--tools/libxc/xenguest.h8
-rw-r--r--tools/libxl/libxl_create.c5
-rw-r--r--tools/libxl/libxl_internal.h1
-rw-r--r--tools/python/xen/xend/image.py2
5 files changed, 15 insertions, 3 deletions
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
index d895710a7b..eb9eee3009 100644
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -436,7 +436,7 @@ static int dump_qemu(xc_interface *xch, uint32_t dom, struct tailbuf_hvm *buf)
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;
diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
index dd0c4cf6e8..9ed0ea41fe 100644
--- a/tools/libxc/xenguest.h
+++ b/tools/libxc/xenguest.h
@@ -77,6 +77,14 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
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
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index d61e48c3a5..e2bd8d062c 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -22,6 +22,9 @@
#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"
@@ -252,7 +255,7 @@ static int domain_restore(libxl_ctx *ctx, libxl_domain_build_info *info,
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;
}
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 44b7e25d26..0271fcbad4 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -45,6 +45,7 @@
#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]))
diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
index 1983502a2e..f1464ac1f2 100644
--- a/tools/python/xen/xend/image.py
+++ b/tools/python/xen/xend/image.py
@@ -936,7 +936,7 @@ class HVMImageHandler(ImageHandler):
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