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

[Xen-changelog] [xen master] shut down domain when last vCPU goes down



commit d3b230fc46ee9853064e167f6cb4da8ea0a08112
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon Feb 19 14:00:31 2018 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Feb 19 14:00:31 2018 +0100

    shut down domain when last vCPU goes down
    
    I've just had to deal with an early boot crash of Linux which occurred
    so early that even "earlyprintk=xen" did not produce any useful output.
    Hence the domain appeared to hang, while in fact it had brought down its
    only vCPU. By translating this to a shutdown, the situation will be
    better recognizable.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/common/domain.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 4567773..e1c003d 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1321,6 +1321,22 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, 
XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
 
     case VCPUOP_down:
+        for_each_vcpu ( d, v )
+            if ( v->vcpu_id != vcpuid && !test_bit(_VPF_down, &v->pause_flags) 
)
+            {
+               rc = 1;
+               break;
+            }
+
+        if ( !rc ) /* Last vcpu going down? */
+        {
+            domain_shutdown(d, SHUTDOWN_poweroff);
+            break;
+        }
+
+        rc = 0;
+        v = d->vcpu[vcpuid];
+
 #ifdef CONFIG_X86
         if ( pv_shim )
             rc = continue_hypercall_on_cpu(0, pv_shim_cpu_down, v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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