[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Fix xm shutdown for xendomains



Hi,

When I tested xm shutdown command with a domain name, xm shutdown command 
waited for a shutdown completion of a guest OS as I had expected. 
But, when I tested xm shutdown command with a domain ID, xm shutdown 
command did not wait for it. 

Domain name:
 # time xm shutdown vm1 --wait
 Domain vm1 terminated
 All domains terminated
 
 real    0m21.093s
 user    0m0.490s
 sys     0m0.090s
 # xm list
 Name                                        ID   Mem VCPUs      State   Time(s)
 Domain-0                                     0   743     2     r-----    272.6

Domain ID:
 # time xm shutdown 9 --wait
 Domain 9 terminated
 All domains terminated
 
 real    0m1.551s
 user    0m0.410s
 sys     0m0.060s
 # xm list
 Name                                        ID   Mem VCPUs      State   Time(s)
 Domain-0                                     0   743     2     r-----    262.3
 vm1                                          9   256     1     r-----     34.1


I think that this problem has an impact to shutting down guest OSes by 
xendomains because xendomains uses xm shutdown command with the domain 
ID.  Guest OSes may be not shut down as expected because xm shutdown 
command is executed twice in the short term as follows. 

 # service xendomains stop
 Shutting down Xen domains: vm1(shut).Domain 7 terminated
 All domains terminated
  SHUTDOWN_ALL ...Domain vm1 terminated
 All domains terminated
 /etc/init.d/xendomains: line 318:  6736 Terminated              watchdog_xm 
shutdown
 /etc/init.d/xendomains: line 318:  6768 Terminated              watchdog_xm 
shutdown 1


This patch solves the problem.  Even if xm shutdown command with the 
domain ID, xm shutdown command waits for the shutdown completion of 
guest OSes. 

 # time xm shutdown 11 --wait
 Domain vm1 terminated
 All domains terminated
 
 real    0m21.678s
 user    0m0.540s
 sys     0m0.030s

 # service xendomains stop
 Shutting down Xen domains: vm1(shut)............Domain vm1 terminated
 All domains terminated
 /etc/init.d/xendomains: line 280:  8236 Terminated              watchdog_xm 
shutdown
 /etc/init.d/xendomains: line 318:  8236 Terminated              watchdog_xm 
shutdown


Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>

Best regards,
 Kan

Attachment: xm_shutdown_wait.patch
Description: Binary data

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.