Skip to contentSkip to conversation

xen: use 'Hardware domain' instead of 'Domain 0' in hwdom_shutdown()

PATCH Superseded Vitaly Kuznetsov 2 participants 4 messages Apr 23, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: use 'Hardware domain' instead of 'Domain 0' in hwdom_shutdown()

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

---
 xen/common/shutdown.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
xen/common/shutdown.c +5 -15
index 94d4c53..f229fa0 100644
@@ -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 */
     }
-    }
 }  
 
Signature · 1 line
1.9.3
#1 lore raw

xen/common/shutdown.c void hwdom_shutdown(u8 reason) · line 42

Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 23.04.15 at 12:39, <[email protected]> wrote:
xen/common/shutdown.c +1 -2
@@ -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

#2 lore raw
Quoted 15 lines · Jan Beulich

xen/common/shutdown.c void hwdom_shutdown(u8 reason) · line 42

Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 23.04.15 at 12:39, <[email protected]> wrote:
xen/common/shutdown.c +1 -2
@@ -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?

Signature · 1 line
  Vitaly
#3 lore raw
Quoted 19 lines
Quoted 1 line
Quoted 1 line · On 23.04.15 at 13:07, <[email protected]> wrote:
Quoted 15 lines · Jan Beulich

xen/common/shutdown.c void hwdom_shutdown(u8 reason) · line 42

Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 23.04.15 at 12:39, <[email protected]> wrote:
xen/common/shutdown.c +1 -2
@@ -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?

Quoted 3 lines

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