diff -r 200a9c6deeb3 tools/libxc/xenctrl.h --- a/tools/libxc/xenctrl.h Mon Jan 22 16:27:03 2007 +0000 +++ b/tools/libxc/xenctrl.h Tue Jan 23 01:11:31 2007 +0900 @@ -410,6 +410,16 @@ int xc_sched_credit_domain_get(int xc_ha uint32_t domid, struct xen_domctl_sched_credit *sdom); +/** + * This function sends INIT interruption to a HVM domain of ia64. + * + * @parm xc_handle a handle to an open hypervisor interface + * @parm domid the domain id to send + * return 0 on success, -1 on failure + */ +int xc_hvm_domain_send_init(int xc_handle, + uint32_t domid); + /* * EVENT CHANNEL FUNCTIONS */ diff -r 200a9c6deeb3 tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Mon Jan 22 16:27:03 2007 +0000 +++ b/tools/python/xen/lowlevel/xc/xc.c Tue Jan 23 08:35:25 2007 +0900 @@ -1014,6 +1014,14 @@ static PyObject *pyxc_prose_build(XcObje } #endif /* powerpc */ +#ifdef __ia64__ +static PyObject *pyxc_hvm_domain_send_init(XcObject *self, + PyObject *args) +{ + return dom_op(self, args, xc_hvm_domain_send_init); +} +#endif /* __ia64__ */ + static PyMethodDef pyxc_methods[] = { { "handle", (PyCFunction)pyxc_handle, @@ -1360,6 +1368,15 @@ static PyMethodDef pyxc_methods[] = { " vcpus [int, 1]: Number of Virtual CPUS in domain.\n\n" "Returns: [int] 0 on success; -1 on error.\n" }, #endif /* __powerpc */ + +#ifdef __ia64__ + { "arch_hvm_domain_send_init", + (PyCFunction)pyxc_hvm_domain_send_init, + METH_VARARGS, "\n" + "Send INIT interruption to a domain.\n" + " dom [int]: Identifier of domain to be sent INIT interruption.\n\n" + "Returns: [int] 0 on success; -1 on error.\n" }, +#endif /* __ia64__ */ { NULL, NULL, 0, NULL } }; diff -r 200a9c6deeb3 tools/python/xen/xend/XendDomain.py --- a/tools/python/xen/xend/XendDomain.py Mon Jan 22 16:27:03 2007 +0000 +++ b/tools/python/xen/xend/XendDomain.py Tue Jan 23 08:35:25 2007 +0900 @@ -46,6 +46,7 @@ from xen.xend.XendDevices import XendDev from xen.xend.XendDevices import XendDevices from xen.xend.xenstore.xstransact import xstransact +from xen.xend.xenstore.xsutil import GetDomainPath from xen.xend.xenstore.xswatch import xswatch from xen.util import mkdir, security from xen.xend import uuid @@ -1415,6 +1416,33 @@ class XendDomain: except Exception, ex: raise XendError(str(ex)) + def domain_send_init(self, domid): + """Send INIT interruption to a domain for ia64. + + @param domid: Domain ID or Name + @type domid: int or string. + @raise XendError: failed to send INIT interruption + @raise XendInvalidDomain: Domain is not valid + @rtype: 0 + """ + mch = os.uname()[4] + if mch != 'ia64': + raise XendError("This command is Xen/ia64 only") + + dominfo = self.domain_lookup_nr(domid) + if not dominfo: + raise XendInvalidDomain(str(domid)) + + vmpath = xstransact.Read(GetDomainPath(dominfo.getDomid()), "vm") + ostype = xstransact.Read(vmpath, "image/ostype") + if ostype != 'hvm': + raise XendError("This command is HVM domain only") + + try: + return xc.arch_hvm_domain_send_init(dominfo.getDomid()) + except Exception, ex: + raise XendError(str(ex)) + def instance(): """Singleton constructor. Use this instead of the class constructor. diff -r 200a9c6deeb3 tools/python/xen/xm/main.py --- a/tools/python/xen/xm/main.py Mon Jan 22 16:27:03 2007 +0000 +++ b/tools/python/xen/xm/main.py Fri Jan 19 13:07:07 2007 +0900 @@ -140,6 +140,7 @@ SUBCOMMAND_HELP = { 'vcpu-set' : (' ', 'Set the number of active VCPUs for allowed for the' ' domain.'), + 'os-init' : ('', 'Send a INIT to a domain.'), # device commands @@ -274,6 +275,7 @@ domain_commands = [ "mem-max", "mem-set", "migrate", + "os-init", "pause", "reboot", "rename", @@ -1328,6 +1330,11 @@ def xm_sysrq(args): req = args[1] server.xend.domain.send_sysrq(dom, req) +def xm_osinit(args): + arg_check(args, "os-init", 1) + dom = args[0] + server.xend.domain.send_init(dom) + def xm_top(args): arg_check(args, "top", 0) @@ -1652,6 +1659,7 @@ commands = { "uptime": xm_uptime, "suspend": xm_suspend, "list": xm_list, + "os-init": xm_osinit, # memory commands "mem-max": xm_mem_max, "mem-set": xm_mem_set,