Skip to contentSkip to conversation

Trivial error message fix: xm migrate

PATCH In review Masaki Kanno 2 participants 2 messages May 19, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Trivial error message fix: xm migrate

Hi,

When I tested xm migrate command to a non-running domain, I saw the following error message.

# xm list vm1
Name                                        ID   Mem VCPUs      State   Time(s)
vm1                                              256     1                 0.0
# xm migrate vm1 10.124.36.219
Error: /usr/lib/xen/bin/xc_save 22 None 0 0 0 failed
(snip)

This patch improves the error message as follows.

# xm migrate vm1 10.124.36.219
Error: Domain is not running
(snip)

BTW, do you have a plan to enable migration for non-running domains?

Best regards,
Kan

tools/python/xen/xend/XendDomain.py +4 -0
diff -r e66aefdfedcc tools/python/xen/xend/XendDomain.py
@@ -1282,6 +1282,10 @@ class XendDomain:
 
         if dominfo.getDomid() == DOM0_ID:
             raise XendError("Cannot migrate privileged domain %s" % domid)
+        if dominfo._stateGet() != DOM_STATE_RUNNING:
+            raise VMBadState("Domain is not running",
+                             POWER_STATE_NAMES[DOM_STATE_RUNNING],
+                             POWER_STATE_NAMES[dominfo._stateGet()])
 
         """ The following call may raise a XendError exception """
         dominfo.testMigrateDevices(True, dst)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Hi Kan,

It's great that you're providing all these tweaks to the codebase; there's often been a lack of attention to detail on things like error messages, etc.

Quoted 11 lines

When I tested xm migrate command to a non-running domain, I saw the following error message.

# xm list vm1
Name                                        ID   Mem VCPUs      State  
Time(s) vm1                                              256     1         
       0.0 # xm migrate vm1 10.124.36.219
Error: /usr/lib/xen/bin/xc_save 22 None 0 0 0 failed
(snip)
Quoted 8 lines

This patch improves the error message as follows.

# xm migrate vm1 10.124.36.219
Error: Domain is not running
(snip)

BTW, do you have a plan to enable migration for non-running domains?

Interesting question.

For a domain that's shutdown, there's not really anything for the tools to do (unless you want them to migrate a hard drive image and config to another machine. Which could be a useful administrative feature.)

For a VM that has been suspended, rather than shutdown, one could presumably copy the suspend image across to the other machine as part of a migration. I'm not really sure how Xend would store that information on the other end... Is it actually possible to do a managed suspend of a domain that's been live migrated? (as opposed to just doing xm save to a file, which Xend would have no record of).

I can certainly see interesting ways in which migration of non-running domains could be handled if Xend / xm were extended somewhat. I'm not aware of any plans for doing this...

Cheers,
Mark

Signature · 1 line
Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)