|
|
6645a82 |
diff -rup xen-3.1.0-src/tools/ioemu/target-i386-dm/helper2.c xen-3.1.0-src.new/tools/ioemu/target-i386-dm/helper2.c
|
|
|
6645a82 |
--- xen-3.1.0-src/tools/ioemu/target-i386-dm/helper2.c 2007-05-18 10:45:21.000000000 -0400
|
|
|
6645a82 |
+++ xen-3.1.0-src.new/tools/ioemu/target-i386-dm/helper2.c 2007-06-11 08:25:16.000000000 -0400
|
|
|
6645a82 |
@@ -615,7 +615,7 @@ int main_loop(void)
|
|
|
6645a82 |
extern int suspend_requested;
|
|
|
6645a82 |
CPUState *env = cpu_single_env;
|
|
|
6645a82 |
int evtchn_fd = xc_evtchn_fd(xce_handle);
|
|
|
6645a82 |
- char qemu_file[20];
|
|
|
6645a82 |
+ char qemu_file[PATH_MAX];
|
|
|
6645a82 |
|
|
|
6645a82 |
buffered_io_timer = qemu_new_timer(rt_clock, handle_buffered_io,
|
|
|
6645a82 |
cpu_single_env);
|
|
|
6645a82 |
@@ -637,7 +637,9 @@ int main_loop(void)
|
|
|
6645a82 |
ide_stop_dma_thread();
|
|
|
6645a82 |
|
|
|
6645a82 |
/* Save the device state */
|
|
|
6645a82 |
- sprintf(qemu_file, "/tmp/xen.qemu-dm.%d", domid);
|
|
|
6645a82 |
+ snprintf(qemu_file, PATH_MAX-1, "/var/lib/xen/qemu-save.%d", domid);
|
|
|
6645a82 |
+ qemu_file[PATH_MAX-1] = '\0';
|
|
|
6645a82 |
+
|
|
|
6645a82 |
if (qemu_savevm(qemu_file) < 0)
|
|
|
6645a82 |
fprintf(stderr, "qemu save fail.\n");
|
|
|
6645a82 |
|
|
|
6645a82 |
diff -rup xen-3.1.0-src/tools/python/xen/xend/image.py xen-3.1.0-src.new/tools/python/xen/xend/image.py
|
|
|
6645a82 |
--- xen-3.1.0-src/tools/python/xen/xend/image.py 2007-05-18 10:45:21.000000000 -0400
|
|
|
6645a82 |
+++ xen-3.1.0-src.new/tools/python/xen/xend/image.py 2007-06-11 08:24:07.000000000 -0400
|
|
|
6645a82 |
@@ -433,7 +433,7 @@ class HVMImageHandler(ImageHandler):
|
|
|
6645a82 |
(self.getRequiredInitialReservation() / 1024) ])
|
|
|
6645a82 |
args = args + self.dmargs
|
|
|
6645a82 |
if restore:
|
|
|
6645a82 |
- args = args + ([ "-loadvm", "/tmp/xen.qemu-dm.%d" %
|
|
|
6645a82 |
+ args = args + ([ "-loadvm", "/var/lib/xen/qemu-save.%d" %
|
|
|
6645a82 |
self.vm.getDomid() ])
|
|
|
6645a82 |
env = dict(os.environ)
|
|
|
6645a82 |
if self.display:
|
|
|
6645a82 |
diff -rup xen-3.1.0-src/tools/python/xen/xend/XendCheckpoint.py xen-3.1.0-src.new/tools/python/xen/xend/XendCheckpoint.py
|
|
|
6645a82 |
--- xen-3.1.0-src/tools/python/xen/xend/XendCheckpoint.py 2007-05-18 10:45:21.000000000 -0400
|
|
|
6645a82 |
+++ xen-3.1.0-src.new/tools/python/xen/xend/XendCheckpoint.py 2007-06-11 08:24:07.000000000 -0400
|
|
|
6645a82 |
@@ -111,7 +111,8 @@ def save(fd, dominfo, network, live, dst
|
|
|
6645a82 |
# put qemu device model state
|
|
|
6645a82 |
if hvm:
|
|
|
6645a82 |
write_exact(fd, QEMU_SIGNATURE, "could not write qemu signature")
|
|
|
6645a82 |
- qemu_fd = os.open("/tmp/xen.qemu-dm.%d" % dominfo.getDomid(), os.O_RDONLY)
|
|
|
6645a82 |
+ qemu_fd = os.open("/var/lib/xen/qemu-save.%d" % dominfo.getDomid(),
|
|
|
6645a82 |
+ os.O_RDONLY)
|
|
|
6645a82 |
while True:
|
|
|
6645a82 |
buf = os.read(qemu_fd, dm_batch)
|
|
|
6645a82 |
if len(buf):
|
|
|
6645a82 |
@@ -119,7 +120,7 @@ def save(fd, dominfo, network, live, dst
|
|
|
6645a82 |
else:
|
|
|
6645a82 |
break
|
|
|
6645a82 |
os.close(qemu_fd)
|
|
|
6645a82 |
- os.remove("/tmp/xen.qemu-dm.%d" % dominfo.getDomid())
|
|
|
6645a82 |
+ os.remove("/var/lib/xen/qemu-save.%d" % dominfo.getDomid())
|
|
|
6645a82 |
|
|
|
6645a82 |
if checkpoint:
|
|
|
6645a82 |
dominfo.resumeDomain()
|
|
|
6645a82 |
@@ -238,7 +239,7 @@ def restore(xd, fd, dominfo = None, paus
|
|
|
6645a82 |
if qemu_signature != QEMU_SIGNATURE:
|
|
|
6645a82 |
raise XendError("not a valid device model state: found '%s'" %
|
|
|
6645a82 |
qemu_signature)
|
|
|
6645a82 |
- qemu_fd = os.open("/tmp/xen.qemu-dm.%d" % dominfo.getDomid(),
|
|
|
6645a82 |
+ qemu_fd = os.open("/var/lib/xen/qemu-save.%d" % dominfo.getDomid(),
|
|
|
6645a82 |
os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
|
|
|
6645a82 |
while True:
|
|
|
6645a82 |
buf = os.read(fd, dm_batch)
|