All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rikiya Ayukawa <ayukawa.rikiya@jp.fujitsu.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Rename device backend value when xm save/migrate
Date: Fri, 07 Aug 2009 12:01:49 +0900	[thread overview]
Message-ID: <4A7B991D.6090500@jp.fujitsu.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 815 bytes --]

Hi all,

The Xend has a problem that it often fails to restore/migrate
a PV domain whose device backends are partly a driver domain.

Because a checkpoint of the PV domain has device backend value as
domain id, you can restore/migrate the PV domain only when a driver
domain is the same id as device backend value in the checkpoint.

I attached a patch to fix it by renaming device backend value in a
checkpoint from domain id to domain name when xm save/migrate.

This patch doesn't rename device backend value if the value is 0,
which is Domain-0, so the checkpoint format is compatible if you use
only Domain-0 as device backend.

Signed-off-by: Rikiya Ayukawa <ayukawa.rikiya@jp.fujitsu.com>

Diffstat:
 XendCheckpoint.py |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

Best Regards,
--
Rikiya Ayukawa

[-- Attachment #2: rename-device-backend-value.patch --]
[-- Type: text/plain, Size: 1148 bytes --]

diff -r 68e8b8379244 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py	Sun Aug 02 13:43:15 2009 +0100
+++ b/tools/python/xen/xend/XendCheckpoint.py	Thu Aug 06 17:02:23 2009 +0900
@@ -66,6 +66,8 @@
 
 
 def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1):
+    from xen.xend import XendDomain
+
     try:
         if not os.path.isdir("/var/lib/xen"):
             os.makedirs("/var/lib/xen")
@@ -80,6 +82,18 @@
     if node > -1:
         insert_after(sxprep,'vcpus',['node', str(node)])
 
+    for device_sxp in sxp.children(sxprep, 'device'):
+        backend = sxp.child(device_sxp[1], 'backend')
+        if backend == None:
+            continue
+        bkdominfo = XendDomain.instance().domain_lookup_nr(backend[1])
+        if bkdominfo == None:
+            raise XendError("Could not find backend: %s" % backend[1])
+        if bkdominfo.getDomid() == XendDomain.DOM0_ID:
+            # Skip for compatibility of checkpoint data format
+            continue
+        backend[1] = bkdominfo.getName()
+        
     config = sxp.to_string(sxprep)
 
     domain_name = dominfo.getName()

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2009-08-07  3:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A7B991D.6090500@jp.fujitsu.com \
    --to=ayukawa.rikiya@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.