Support .domainSendSysrq in libxl driver.
Signed-off-by: Chunyan Liu <cyliu(a)suse.com>
---
src/libxl/libxl_driver.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 53c87ce..0830d68 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -4729,6 +4729,28 @@ libxlDomainMigrateConfirm3Params(virDomainPtr domain,
return libxlDomainMigrationConfirm(driver, vm, flags, cancelled);
}
+static int
+libxlDomainSendSysrq(virDomainPtr dom, const char *key)
+{
+ virDomainObjPtr vm;
+ libxlDomainObjPrivatePtr priv;
+ int ret = -1;
+
+ if (!(vm = libxlDomObjFromDomain(dom)))
+ goto cleanup;
+
+ priv = vm->privateData;
+
+ if (virDomainSendSysrqEnsureACL(dom->conn, vm->def) < 0)
+ goto cleanup;
+
+ ret = libxl_send_sysrq(priv->ctx, vm->def->id, key[0]);
+
+ cleanup:
+ if (vm)
+ virObjectUnlock(vm);
+ return ret;
+}
static virHypervisorDriver libxlDriver = {
.no = VIR_DRV_LIBXL,
@@ -4824,6 +4846,7 @@ static virHypervisorDriver libxlDriver = {
.domainMigratePerform3Params = libxlDomainMigratePerform3Params, /* 1.2.6 */
.domainMigrateFinish3Params = libxlDomainMigrateFinish3Params, /* 1.2.6 */
.domainMigrateConfirm3Params = libxlDomainMigrateConfirm3Params, /* 1.2.6 */
+ .domainSendSysrq = libxlDomainSendSysrq, /* 1.2.11 */
};
static virStateDriver libxlStateDriver = {
--
1.8.4.5