From: Don Slutz <dslutz@verizon.com>
To: xen-devel@lists.xen.org
Cc: Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Jun Nakajima <jun.nakajima@intel.com>,
Eddie Dong <eddie.dong@intel.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Don Slutz <dslutz@verizon.com>, Tim Deegan <tim@xen.org>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: [PATCH v3 10/16] Add VMware tool's triggers
Date: Mon, 8 Sep 2014 09:15:52 -0400 [thread overview]
Message-ID: <1410182158-8542-11-git-send-email-dslutz@verizon.com> (raw)
In-Reply-To: <1410182158-8542-1-git-send-email-dslutz@verizon.com>
These are not the same as the PV control interface; they
are more like the ACPI power event.
For anything to happen when they are used, the domU must
be running a VMware tools daemon that is polling for triggers.
If the domU is running VMware tools, then the "build version" of
the tools is also available via xc_get_HVM_param(). This also
enables the use of new triggers that will use the VMware hyper-call
to do some limited control of the domU. The most useful are
poweroff and reboot. Since a guest process needs to be running
for these to work, a tool stack should check that the build version
is non zero before assuming these will work.
The 2 hvm param's HVM_PARAM_VMPORT_BUILD_NUMBER_TIME and
HVM_PARAM_VMPORT_BUILD_NUMBER_VALUE are how "build version" is
accessed. These 2 params are only allowed to be set to zero. The
HVM_PARAM_VMPORT_BUILD_NUMBER_TIME can be used to track the last
time the VMware tools in the guest responded. One such use would
be the health of the tools in the guest. The hvm param
HVM_PARAM_VMPORT_RESET_TIME controls how often to request them in
seconds minus 1. The minus 1 is to handle to 0 case. I.E. the
fastest that can be selected is every second. The default is 4
times a minute.
XEN_DOMCTL_SENDTRIGGER_VTPING is the same as what is done using
HVM_PARAM_VMPORT_RESET_TIME. This trigger allows the tool
stack to request a sooner update of HVM_PARAM_VMPORT_BUILD_NUMBER_TIME
and HVM_PARAM_VMPORT_BUILD_NUMBER_VALUE.
Signed-off-by: Don Slutz <dslutz@verizon.com>
---
xen/arch/x86/domctl.c | 34 ++++++++++++++++++++++++++++++++++
xen/include/asm-x86/hvm/vmport.h | 1 +
xen/include/public/domctl.h | 3 +++
3 files changed, 38 insertions(+)
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 7a5de43..50596a6 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -23,6 +23,7 @@
#include <xen/paging.h>
#include <asm/irq.h>
#include <asm/hvm/hvm.h>
+#include <asm/hvm/vmport.h>
#include <asm/hvm/support.h>
#include <asm/hvm/cacheattr.h>
#include <asm/processor.h>
@@ -579,6 +580,39 @@ long arch_do_domctl(
}
break;
+ case XEN_DOMCTL_SENDTRIGGER_VTPOWER:
+ {
+ ret = -EINVAL;
+ if ( is_hvm_domain(d) )
+ {
+ ret = 0;
+ vmport_ctrl_send(&d->arch.hvm_domain, "OS_Halt");
+ }
+ }
+ break;
+
+ case XEN_DOMCTL_SENDTRIGGER_VTREBOOT:
+ {
+ ret = -EINVAL;
+ if ( is_hvm_domain(d) )
+ {
+ ret = 0;
+ vmport_ctrl_send(&d->arch.hvm_domain, "OS_Reboot");
+ }
+ }
+ break;
+
+ case XEN_DOMCTL_SENDTRIGGER_VTPING:
+ {
+ ret = -EINVAL;
+ if ( is_hvm_domain(d) )
+ {
+ ret = 0;
+ vmport_ctrl_send(&d->arch.hvm_domain, "ping");
+ }
+ }
+ break;
+
default:
ret = -ENOSYS;
}
diff --git a/xen/include/asm-x86/hvm/vmport.h b/xen/include/asm-x86/hvm/vmport.h
index e2864ab..8503307 100644
--- a/xen/include/asm-x86/hvm/vmport.h
+++ b/xen/include/asm-x86/hvm/vmport.h
@@ -57,6 +57,7 @@ int vmport_rpc_hvmop_precheck(unsigned long op,
struct xen_hvm_vmport_guest_info *a);
int vmport_rpc_hvmop_do(struct domain *d, unsigned long op,
struct xen_hvm_vmport_guest_info *a);
+void vmport_ctrl_send(struct hvm_domain *hd, char *msg);
#endif /* ASM_X86_HVM_VMPORT_H__ */
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 69a8b44..2508ffa 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -459,6 +459,9 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_address_size_t);
#define XEN_DOMCTL_SENDTRIGGER_INIT 2
#define XEN_DOMCTL_SENDTRIGGER_POWER 3
#define XEN_DOMCTL_SENDTRIGGER_SLEEP 4
+#define XEN_DOMCTL_SENDTRIGGER_VTPOWER 5
+#define XEN_DOMCTL_SENDTRIGGER_VTREBOOT 6
+#define XEN_DOMCTL_SENDTRIGGER_VTPING 7
struct xen_domctl_sendtrigger {
uint32_t trigger; /* IN */
uint32_t vcpu; /* IN */
--
1.8.4
next prev parent reply other threads:[~2014-09-08 13:15 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-08 13:15 [PATCH v3 00/16] Xen VMware tools support Don Slutz
2014-09-08 13:15 ` [PATCH v3 01/16] hypervisor part of add vmware_hw to xl.cfg Don Slutz
2014-09-11 10:52 ` George Dunlap
2014-09-11 17:21 ` Don Slutz
2014-09-08 13:15 ` [PATCH v3 02/16] tools " Don Slutz
2014-09-11 11:23 ` George Dunlap
2014-09-11 17:48 ` Don Slutz
2014-09-08 13:15 ` [PATCH v3 03/16] vmware: Add VMware provided include files Don Slutz
2014-09-08 13:15 ` [PATCH v3 04/16] hypervisor part of add vmware_port to xl.cfg Don Slutz
2014-09-08 15:01 ` Boris Ostrovsky
2014-09-08 15:22 ` Jan Beulich
2014-09-08 15:32 ` Andrew Cooper
2014-09-08 15:43 ` Boris Ostrovsky
2014-09-08 17:56 ` Don Slutz
2014-09-08 17:20 ` Don Slutz
2014-09-11 15:34 ` George Dunlap
2014-09-08 13:15 ` [PATCH v3 05/16] tools " Don Slutz
2014-09-15 10:03 ` George Dunlap
2014-09-20 15:52 ` Slutz, Donald Christopher
2014-09-08 13:15 ` [PATCH v3 06/16] hypervisor part of convert vmware_port to xentrace usage Don Slutz
2014-09-08 13:15 ` [PATCH v3 07/16] tools " Don Slutz
2014-09-08 13:15 ` [PATCH v3 08/16] hypervisor part of add limited support of VMware's hyper-call rpc Don Slutz
2014-09-08 13:15 ` [PATCH v3 09/16] tools " Don Slutz
2014-09-08 13:15 ` Don Slutz [this message]
2014-09-08 13:15 ` [PATCH v3 11/16] Add live migration of VMware's hyper-call RPC Don Slutz
2014-09-08 13:15 ` [PATCH v3 12/16] Add dump of HVM_SAVE_CODE(VMPORT) to xen-hvmctx Don Slutz
2014-09-08 13:15 ` [optional][PATCH v3 13/16] Add xen-hvm-param Don Slutz
2014-09-08 13:15 ` [optional][PATCH v3 14/16] Add xen-vmware-guestinfo Don Slutz
2014-09-08 13:15 ` [optional][PATCH v3 15/16] Add xen-list-vmware-guestinfo Don Slutz
2014-09-08 13:15 ` [optional][PATCH v3 16/16] Add xen-hvm-send-trigger Don Slutz
2014-09-08 13:38 ` [PATCH v3 00/16] Xen VMware tools support Ian Campbell
2014-09-08 16:58 ` Don Slutz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1410182158-8542-11-git-send-email-dslutz@verizon.com \
--to=dslutz@verizon.com \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=eddie.dong@intel.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=jun.nakajima@intel.com \
--cc=keir@xen.org \
--cc=kevin.tian@intel.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).