All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] change the name of the qemu save file at restore time
@ 2011-01-19 13:53 Stefano Stabellini
  2011-01-20 15:12 ` Ian Jackson
  0 siblings, 1 reply; 5+ messages in thread
From: Stefano Stabellini @ 2011-01-19 13:53 UTC (permalink / raw)
  To: xen-devel

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>

diff -r 59396addc940 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Fri Jan 14 14:26:11 2011 +0000
+++ b/tools/libxc/xc_domain_restore.c	Wed Jan 19 12:47:23 2011 +0000
@@ -436,7 +436,7 @@ static int dump_qemu(xc_interface *xch, 
     char path[256];
     FILE *fp;
 
-    sprintf(path, "/var/lib/xen/qemu-save.%u", dom);
+    sprintf(path, "/var/lib/xen/qemu-resume.%u", dom);
     fp = fopen(path, "wb");
     if ( !fp )
         return -1;
diff -r 59396addc940 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Jan 14 14:26:11 2011 +0000
+++ b/tools/libxl/libxl_create.c	Wed Jan 19 12:47:23 2011 +0000
@@ -251,7 +251,7 @@ static int domain_restore(libxl_ctx *ctx
     dm_info->saved_state = NULL;
     if (info->hvm) {
         ret = asprintf(&dm_info->saved_state,
-                       "/var/lib/xen/qemu-save.%d", domid);
+                       RESTOREFILE".%d", domid);
         ret = (ret < 0) ? ERROR_FAIL : 0;
     }
 
diff -r 59396addc940 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Jan 14 14:26:11 2011 +0000
+++ b/tools/libxl/libxl_internal.h	Wed Jan 19 12:47:23 2011 +0000
@@ -45,6 +45,8 @@
 #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 RESTOREFILE "/var/lib/xen/qemu-resume"
 
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
 
diff -r 59396addc940 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py	Fri Jan 14 14:26:11 2011 +0000
+++ b/tools/python/xen/xend/image.py	Wed Jan 19 12:47:23 2011 +0000
@@ -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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/5] change the name of the qemu save file at restore time
  2011-01-19 13:53 [PATCH 1/5] change the name of the qemu save file at restore time Stefano Stabellini
@ 2011-01-20 15:12 ` Ian Jackson
  2011-01-20 15:44   ` Stefano Stabellini
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Jackson @ 2011-01-20 15:12 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel

Stefano Stabellini writes ("[Xen-devel] [PATCH 1/5] 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.
...
> -    sprintf(path, "/var/lib/xen/qemu-save.%u", dom);
> +    sprintf(path, "/var/lib/xen/qemu-resume.%u", dom);
...
> -                       "/var/lib/xen/qemu-save.%d", domid);
> +                       RESTOREFILE".%d", domid);
...
> +#define SAVEFILE "/var/lib/xen/qemu-save"
> +#define RESTOREFILE "/var/lib/xen/qemu-resume"

Uh, why is the latter not in libxc so that libxc can use it too ?

> -            args = args + ([ "-loadvm", "/var/lib/xen/qemu-save.%d" %
> +            args = args + ([ "-loadvm", "/var/lib/xen/qemu-resume.%d" %

At least this has some kind of excuse.  It's probably too painful to
do anything else but keep the 2nd hardcoded value (and anyway this is
in xend).

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/5] change the name of the qemu save file at restore time
  2011-01-20 15:12 ` Ian Jackson
@ 2011-01-20 15:44   ` Stefano Stabellini
  2011-01-21 11:04     ` Stefano Stabellini
  0 siblings, 1 reply; 5+ messages in thread
From: Stefano Stabellini @ 2011-01-20 15:44 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Stefano Stabellini

On Thu, 20 Jan 2011, Ian Jackson wrote:
> Stefano Stabellini writes ("[Xen-devel] [PATCH 1/5] 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.
> ...
> > -    sprintf(path, "/var/lib/xen/qemu-save.%u", dom);
> > +    sprintf(path, "/var/lib/xen/qemu-resume.%u", dom);
> ...
> > -                       "/var/lib/xen/qemu-save.%d", domid);
> > +                       RESTOREFILE".%d", domid);
> ...
> > +#define SAVEFILE "/var/lib/xen/qemu-save"
> > +#define RESTOREFILE "/var/lib/xen/qemu-resume"
> 
> Uh, why is the latter not in libxc so that libxc can use it too ?

It should probably be in xenguest.h, close to xc_domain_restore.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/5] change the name of the qemu save file at restore time
  2011-01-20 15:44   ` Stefano Stabellini
@ 2011-01-21 11:04     ` Stefano Stabellini
  2011-01-21 17:57       ` Ian Jackson
  0 siblings, 1 reply; 5+ messages in thread
From: Stefano Stabellini @ 2011-01-21 11:04 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel, Ian Jackson

On Thu, 20 Jan 2011, Stefano Stabellini wrote:
> On Thu, 20 Jan 2011, Ian Jackson wrote:
> > Stefano Stabellini writes ("[Xen-devel] [PATCH 1/5] 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.
> > ...
> > > -    sprintf(path, "/var/lib/xen/qemu-save.%u", dom);
> > > +    sprintf(path, "/var/lib/xen/qemu-resume.%u", dom);
> > ...
> > > -                       "/var/lib/xen/qemu-save.%d", domid);
> > > +                       RESTOREFILE".%d", domid);
> > ...
> > > +#define SAVEFILE "/var/lib/xen/qemu-save"
> > > +#define RESTOREFILE "/var/lib/xen/qemu-resume"
> > 
> > Uh, why is the latter not in libxc so that libxc can use it too ?
> 
> It should probably be in xenguest.h, close to xc_domain_restore.
> 

I am appending the updated version of this patch.

---

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>


diff -r 59396addc940 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Fri Jan 14 14:26:11 2011 +0000
+++ b/tools/libxc/xc_domain_restore.c	Fri Jan 21 11:03:40 2011 +0000
@@ -436,7 +436,7 @@ static int dump_qemu(xc_interface *xch, 
     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 -r 59396addc940 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h	Fri Jan 14 14:26:11 2011 +0000
+++ b/tools/libxc/xenguest.h	Fri Jan 21 11:03:40 2011 +0000
@@ -77,6 +77,14 @@ int xc_domain_restore(xc_interface *xch,
                       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 -r 59396addc940 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Fri Jan 14 14:26:11 2011 +0000
+++ b/tools/libxl/libxl_create.c	Fri Jan 21 11:03:40 2011 +0000
@@ -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"
@@ -251,7 +254,7 @@ static int domain_restore(libxl_ctx *ctx
     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 -r 59396addc940 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Fri Jan 14 14:26:11 2011 +0000
+++ b/tools/libxl/libxl_internal.h	Fri Jan 21 11:03:40 2011 +0000
@@ -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 -r 59396addc940 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py	Fri Jan 14 14:26:11 2011 +0000
+++ b/tools/python/xen/xend/image.py	Fri Jan 21 11:03:40 2011 +0000
@@ -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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/5] change the name of the qemu save file at restore time
  2011-01-21 11:04     ` Stefano Stabellini
@ 2011-01-21 17:57       ` Ian Jackson
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Jackson @ 2011-01-21 17:57 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel

Stefano Stabellini writes ("Re: [Xen-devel] [PATCH 1/5] change the name of the qemu save file at restore time"):
> I am appending the updated version of this patch.

Thanks, applied.

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-21 17:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-19 13:53 [PATCH 1/5] change the name of the qemu save file at restore time Stefano Stabellini
2011-01-20 15:12 ` Ian Jackson
2011-01-20 15:44   ` Stefano Stabellini
2011-01-21 11:04     ` Stefano Stabellini
2011-01-21 17:57       ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.