use 'Hardware domain' instead of 'Domain 0' in hwdom_shutdown()
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 24 Apr 2015 10:07:00 +0000 (12:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 24 Apr 2015 10:07:00 +0000 (12:07 +0200)
hwdom_shutdown() operates with hardware domains, use the proper wording.
Eliminate pointless braces from switch cases.

Use hardware_domain->domain_id instead of hardware_domid to print the actual
domain ID as in some cases it can differ (e.g. Dom0 dies before the actual HW
domain got created, kexec for the HW domain is being performed,...).

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/common/shutdown.c

index 94d4c53e6d77cc528242f579a2660b3edc57f912..9cfbf7a9093dee91b87e02bf3db7820877e26de7 100644 (file)
@@ -37,46 +37,40 @@ void hwdom_shutdown(u8 reason)
     switch ( reason )
     {
     case SHUTDOWN_poweroff:
-    {
-        printk("Domain 0 halted: halting machine.\n");
+        printk("Hardware Dom%u halted: halting machine\n",
+               hardware_domain->domain_id);
         machine_halt();
         break; /* not reached */
-    }
 
     case SHUTDOWN_crash:
-    {
         debugger_trap_immediate();
-        printk("Domain 0 crashed: ");
+        printk("Hardware Dom%u crashed: ", hardware_domain->domain_id);
 #ifdef CONFIG_KEXEC
         kexec_crash();
 #endif
         maybe_reboot();
         break; /* not reached */
-    }
 
     case SHUTDOWN_reboot:
-    {
-        printk("Domain 0 shutdown: rebooting machine.\n");
+        printk("Hardware Dom%u shutdown: rebooting machine\n",
+               hardware_domain->domain_id);
         machine_restart(0);
         break; /* not reached */
-    }
 
     case SHUTDOWN_watchdog:
-    {
-        printk("Domain 0 shutdown: watchdog rebooting machine.\n");
+        printk("Hardware Dom%u shutdown: watchdog rebooting machine\n",
+               hardware_domain->domain_id);
 #ifdef CONFIG_KEXEC
         kexec_crash();
 #endif
         machine_restart(0);
         break; /* not reached */
-    }
 
     default:
-    {
-        printk("Domain 0 shutdown (unknown reason %u): ", reason);
+        printk("Hardware Dom%u shutdown (unknown reason %u): ",
+               hardware_domain->domain_id, reason);
         maybe_reboot();
         break; /* not reached */
     }
-    }
 }