Skip to contentSkip to conversation

Reg domU shutdown

DISCUSSION Sandesh 2 participants 3 messages Jul 10, 2008 – Jul 11, 2008

lore
Share & tools
lore

Sandesh

author
#0 lore raw

Hi all,
I have a doubt about the way shutdown of domU is achieved.
When a 'xm shutdown domid' is done, it ensures that domU is shutdown normally. How does the hypervisor send this event to domU.

I could not find it in domain_shutdown func, all i could see is that is just removes the domU context from the scheduler runqueue.

I also looked at the xen drivers in domU kernel source. There i found cpu_die func in drivers/xen/core/smpboot.c and am assuming this might be the one invoked for shuting down domU.
Please tell me if my understanding is correct. I dont know where else
to look for???

Thanks,
Sandesh

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

author
#1 lore raw
Quoted 4 lines

I also looked at the xen drivers in domU kernel source. There i found cpu_die func in drivers/xen/core/smpboot.c and am assuming this might be the one invoked for shuting down domU.

i think shutdown_handler of drivers/xen/core/reboot.c is used to terminate the guest. I want to know what mechanism is used to invoke it??
I see that it is setup as a watch function on xenbus. But how is it
triggered??
Please tell me if my understanding is correct.

Thanks,
Sandesh

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

#2 lore raw
Quoted 10 lines · Sandesh
Quoted 3 lines

I also looked at the xen drivers in domU kernel source. There i found cpu_die func in drivers/xen/core/smpboot.c and am assuming this might be the one invoked for shuting down domU.

i think shutdown_handler of drivers/xen/core/reboot.c is used to terminate the guest. I want to know what mechanism is used to invoke it??
I see that it is setup as a watch function on xenbus. But how is it
triggered??
Please tell me if my understanding is correct.

I think you've got the right idea.

When you use the xm command, it talks to Xend in dom0 to instruct it to perform the appropriate management tasks.

The shutdown is then initiated by Xend in dom0 writing to Xenstore. The Xenbus driver (the Linux interface to Xenstore) picks up this modification to Xenstore and forwards it on to the registered watcher, resulting in shutdown_handler() being called in reboot.c. This in turn causes a userspace program to be run to initiate a clean domain shutdown.

Hope that helps.

Cheers,
Mark

Cheers,
Mark

Signature · 1 line
Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)