All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix xm shutdown
@ 2005-12-13  9:54 Masaki Kanno
  2005-12-13 10:49 ` Ewan Mellor
  0 siblings, 1 reply; 4+ messages in thread
From: Masaki Kanno @ 2005-12-13  9:54 UTC (permalink / raw)
  To: xen-devel

Hi,

This patch adds error message to xm shutdown command. 

I ran xm shutdown command specifying Domain-0. (example: xm shutdown 0)
However, the error message was not shown. 
I think that the error message should be shown.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>

Best Regards,
 Kan

diff -r 0255f48b757f tools/python/xen/xm/shutdown.py
--- a/tools/python/xen/xm/shutdown.py   Sun Dec  4 19:12:00 2005
+++ b/tools/python/xen/xm/shutdown.py   Tue Dec 13 13:28:26 2005
@@ -92,6 +92,10 @@
     if len(args) < 1: opts.err('Missing domain')
     dom = args[0]
     mode = shutdown_mode(opts)  
+    dom0_name = sxp.child_value(server.xend_domain(0), 'name')
+    for x in [dom0_name, DOM0_ID]:
+        if x in dom:
+            opts.err("Can't specify Domain-0")
     shutdown(opts, [ dom ], mode, opts.vals.wait)
     
 def main(argv):

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

* Re: [PATCH] Fix xm shutdown
  2005-12-13  9:54 [PATCH] Fix xm shutdown Masaki Kanno
@ 2005-12-13 10:49 ` Ewan Mellor
  2005-12-14  2:31   ` Masaki Kanno
  0 siblings, 1 reply; 4+ messages in thread
From: Ewan Mellor @ 2005-12-13 10:49 UTC (permalink / raw)
  To: Masaki Kanno; +Cc: xen-devel

On Tue, Dec 13, 2005 at 06:54:05PM +0900, Masaki Kanno wrote:

> Hi,
> 
> This patch adds error message to xm shutdown command. 
> 
> I ran xm shutdown command specifying Domain-0. (example: xm shutdown 0)
> However, the error message was not shown. 
> I think that the error message should be shown.
> 
> Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
> 
> Best Regards,
>  Kan
> 
> diff -r 0255f48b757f tools/python/xen/xm/shutdown.py
> --- a/tools/python/xen/xm/shutdown.py   Sun Dec  4 19:12:00 2005
> +++ b/tools/python/xen/xm/shutdown.py   Tue Dec 13 13:28:26 2005
> @@ -92,6 +92,10 @@
>      if len(args) < 1: opts.err('Missing domain')
>      dom = args[0]
>      mode = shutdown_mode(opts)  
> +    dom0_name = sxp.child_value(server.xend_domain(0), 'name')
> +    for x in [dom0_name, DOM0_ID]:
> +        if x in dom:
> +            opts.err("Can't specify Domain-0")
>      shutdown(opts, [ dom ], mode, opts.vals.wait)
>      
>  def main(argv):

I agree that an error message would be better than silently ignoring this.
However, your patch now leaves us performing this check twice -- once in
main_dom(), and once in shutdown().  Could you not just show the error message
if the check fails in shutdown() instead?

Ewan.

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

* Re: [PATCH] Fix xm shutdown
  2005-12-13 10:49 ` Ewan Mellor
@ 2005-12-14  2:31   ` Masaki Kanno
  2005-12-14 12:03     ` Ewan Mellor
  0 siblings, 1 reply; 4+ messages in thread
From: Masaki Kanno @ 2005-12-14  2:31 UTC (permalink / raw)
  To: Ewan Mellor, xen-devel

Hi Ewan,

Thanks for your advice.
I thought that the purpose of checking in shutdown() was for -all option,
so I approved twice checking.

The following is new patch.

Best Regards,
 Kan

diff -r 0255f48b757f tools/python/xen/xm/shutdown.py
--- a/tools/python/xen/xm/shutdown.py   Sun Dec  4 19:12:00 2005
+++ b/tools/python/xen/xm/shutdown.py   Wed Dec 14 10:17:38 2005
@@ -57,7 +57,10 @@
     dom0_name = sxp.child_value(server.xend_domain(0), 'name')
     for x in [dom0_name, DOM0_ID]:
         if x in doms:
-            doms.remove(x)
+            if opts.vals.all:
+                doms.remove(x)
+            else:
+                opts.err("Can't specify Domain-0")
     for d in doms:
         server.xend_domain_shutdown(d, mode)
     if wait:


Ewan Mellor wrote:
>On Tue, Dec 13, 2005 at 06:54:05PM +0900, Masaki Kanno wrote:
>
>> Hi,
>> 
>> This patch adds error message to xm shutdown command. 
>> 
>> I ran xm shutdown command specifying Domain-0. (example: xm shutdown 0)
>> However, the error message was not shown. 
>> I think that the error message should be shown.
>> 
>> Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
>> 
>> Best Regards,
>>  Kan
>> 
>> diff -r 0255f48b757f tools/python/xen/xm/shutdown.py
>> --- a/tools/python/xen/xm/shutdown.py   Sun Dec  4 19:12:00 2005
>> +++ b/tools/python/xen/xm/shutdown.py   Tue Dec 13 13:28:26 2005
>> @@ -92,6 +92,10 @@
>>      if len(args) < 1: opts.err('Missing domain')
>>      dom = args[0]
>>      mode = shutdown_mode(opts)  
>> +    dom0_name = sxp.child_value(server.xend_domain(0), 'name')
>> +    for x in [dom0_name, DOM0_ID]:
>> +        if x in dom:
>> +            opts.err("Can't specify Domain-0")
>>      shutdown(opts, [ dom ], mode, opts.vals.wait)
>>      
>>  def main(argv):
>
>I agree that an error message would be better than silently ignoring this.
>However, your patch now leaves us performing this check twice -- once in
>main_dom(), and once in shutdown().  Could you not just show the error message
>if the check fails in shutdown() instead?
>
>Ewan.

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

* Re: [PATCH] Fix xm shutdown
  2005-12-14  2:31   ` Masaki Kanno
@ 2005-12-14 12:03     ` Ewan Mellor
  0 siblings, 0 replies; 4+ messages in thread
From: Ewan Mellor @ 2005-12-14 12:03 UTC (permalink / raw)
  To: Masaki Kanno; +Cc: xen-devel

On Wed, Dec 14, 2005 at 11:31:00AM +0900, Masaki Kanno wrote:

> Hi Ewan,
> 
> Thanks for your advice.
> I thought that the purpose of checking in shutdown() was for -all option,
> so I approved twice checking.
> 
> The following is new patch.
> 
> Best Regards,
>  Kan

Applied, thank you.

Ewan.

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

end of thread, other threads:[~2005-12-14 12:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-13  9:54 [PATCH] Fix xm shutdown Masaki Kanno
2005-12-13 10:49 ` Ewan Mellor
2005-12-14  2:31   ` Masaki Kanno
2005-12-14 12:03     ` Ewan Mellor

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.