All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: use 'Hardware domain' instead of 'Domain 0' in hwdom_shutdown()
@ 2015-04-23 10:39 Vitaly Kuznetsov
  2015-04-23 10:49 ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Vitaly Kuznetsov @ 2015-04-23 10:39 UTC (permalink / raw)
  To: xen-devel; +Cc: Keir Fraser, Ian Jackson, Ian Campbell, Jan Beulich, Tim Deegan

hwdom_shutdown() operates with hardware domains, use the proper wording.
Eliminate pointless braces from switch cases.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 xen/common/shutdown.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/xen/common/shutdown.c b/xen/common/shutdown.c
index 94d4c53..f229fa0 100644
--- a/xen/common/shutdown.c
+++ b/xen/common/shutdown.c
@@ -37,46 +37,36 @@ void hwdom_shutdown(u8 reason)
     switch ( reason )
     {
     case SHUTDOWN_poweroff:
-    {
-        printk("Domain 0 halted: halting machine.\n");
+        printk("Hardware domain halted: halting machine.\n");
         machine_halt();
         break; /* not reached */
-    }
 
     case SHUTDOWN_crash:
-    {
         debugger_trap_immediate();
-        printk("Domain 0 crashed: ");
+        printk("Hardware domain crashed: ");
 #ifdef CONFIG_KEXEC
         kexec_crash();
 #endif
         maybe_reboot();
         break; /* not reached */
-    }
 
     case SHUTDOWN_reboot:
-    {
-        printk("Domain 0 shutdown: rebooting machine.\n");
+        printk("Hardware domain shutdown: rebooting machine.\n");
         machine_restart(0);
         break; /* not reached */
-    }
 
     case SHUTDOWN_watchdog:
-    {
-        printk("Domain 0 shutdown: watchdog rebooting machine.\n");
+        printk("Hardware domain shutdown: watchdog rebooting machine.\n");
 #ifdef CONFIG_KEXEC
         kexec_crash();
 #endif
         machine_restart(0);
         break; /* not reached */
-    }
 
     default:
-    {
-        printk("Domain 0 shutdown (unknown reason %u): ", reason);
+        printk("Hardware domain shutdown (unknown reason %u): ", reason);
         maybe_reboot();
         break; /* not reached */
     }
-    }
 }  
 
-- 
1.9.3

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

* Re: [PATCH] xen: use 'Hardware domain' instead of 'Domain 0' in hwdom_shutdown()
  2015-04-23 10:39 [PATCH] xen: use 'Hardware domain' instead of 'Domain 0' in hwdom_shutdown() Vitaly Kuznetsov
@ 2015-04-23 10:49 ` Jan Beulich
  2015-04-23 11:07   ` Vitaly Kuznetsov
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2015-04-23 10:49 UTC (permalink / raw)
  To: Ian Campbell, Ian Jackson, Vitaly Kuznetsov, Keir Fraser,
	Tim Deegan
  Cc: xen-devel

>>> On 23.04.15 at 12:39, <vkuznets@redhat.com> wrote:
> --- a/xen/common/shutdown.c
> +++ b/xen/common/shutdown.c
> @@ -37,46 +37,36 @@ void hwdom_shutdown(u8 reason)
>      switch ( reason )
>      {
>      case SHUTDOWN_poweroff:
> -    {
> -        printk("Domain 0 halted: halting machine.\n");
> +        printk("Hardware domain halted: halting machine.\n");
>          machine_halt();
>          break; /* not reached */

Would it perhaps make sense (for the avoidance of ambiguity/
confusion) to also print the hardware domain's domain ID?

Jan

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

* Re: [PATCH] xen: use 'Hardware domain' instead of 'Domain 0' in hwdom_shutdown()
  2015-04-23 10:49 ` Jan Beulich
@ 2015-04-23 11:07   ` Vitaly Kuznetsov
  2015-04-23 11:35     ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Vitaly Kuznetsov @ 2015-04-23 11:07 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Keir Fraser, xen-devel, Ian Jackson, Ian Campbell, Tim Deegan

"Jan Beulich" <JBeulich@suse.com> writes:

>>>> On 23.04.15 at 12:39, <vkuznets@redhat.com> wrote:
>> --- a/xen/common/shutdown.c
>> +++ b/xen/common/shutdown.c
>> @@ -37,46 +37,36 @@ void hwdom_shutdown(u8 reason)
>>      switch ( reason )
>>      {
>>      case SHUTDOWN_poweroff:
>> -    {
>> -        printk("Domain 0 halted: halting machine.\n");
>> +        printk("Hardware domain halted: halting machine.\n");
>>          machine_halt();
>>          break; /* not reached */
>
> Would it perhaps make sense (for the avoidance of ambiguity/
> confusion) to also print the hardware domain's domain ID?

Sure, why not. Did I get it right that we need to print
hardware_domain->domain_id and not hardware_domid here to support hwdom
kexec case? 

-- 
  Vitaly

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

* Re: [PATCH] xen: use 'Hardware domain' instead of 'Domain 0' in hwdom_shutdown()
  2015-04-23 11:07   ` Vitaly Kuznetsov
@ 2015-04-23 11:35     ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2015-04-23 11:35 UTC (permalink / raw)
  To: Vitaly Kuznetsov
  Cc: Keir Fraser, Tim Deegan, Ian Jackson, Ian Campbell, xen-devel

>>> On 23.04.15 at 13:07, <vkuznets@redhat.com> wrote:
> "Jan Beulich" <JBeulich@suse.com> writes:
> 
>>>>> On 23.04.15 at 12:39, <vkuznets@redhat.com> wrote:
>>> --- a/xen/common/shutdown.c
>>> +++ b/xen/common/shutdown.c
>>> @@ -37,46 +37,36 @@ void hwdom_shutdown(u8 reason)
>>>      switch ( reason )
>>>      {
>>>      case SHUTDOWN_poweroff:
>>> -    {
>>> -        printk("Domain 0 halted: halting machine.\n");
>>> +        printk("Hardware domain halted: halting machine.\n");
>>>          machine_halt();
>>>          break; /* not reached */
>>
>> Would it perhaps make sense (for the avoidance of ambiguity/
>> confusion) to also print the hardware domain's domain ID?
> 
> Sure, why not. Did I get it right that we need to print
> hardware_domain->domain_id and not hardware_domid here to support hwdom
> kexec case? 

Irrespective of the kexec case I think you should print the actual
state of things, not the ID that was requested to become the
hardware domain (think e.g. also of an early death of Dom0
before the actual HW domain got created).

Jan

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

end of thread, other threads:[~2015-04-23 11:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-23 10:39 [PATCH] xen: use 'Hardware domain' instead of 'Domain 0' in hwdom_shutdown() Vitaly Kuznetsov
2015-04-23 10:49 ` Jan Beulich
2015-04-23 11:07   ` Vitaly Kuznetsov
2015-04-23 11:35     ` Jan Beulich

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.