Support .domainSendSysrq in libxl driver.
Signed-off-by: Chunyan Liu <cyliu(a)suse.com>
---
src/libxl/libxl_driver.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 53c87ce..7c96bab 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -4729,6 +4729,30 @@ libxlDomainMigrateConfirm3Params(virDomainPtr domain,
return libxlDomainMigrationConfirm(driver, vm, flags, cancelled);
}
+static int
+libxlDomainSendSysrq(virDomainPtr dom, char key, unsigned int flags)
+{
+ virDomainObjPtr vm;
+ libxlDomainObjPrivatePtr priv;
+ int ret = -1;
+
+ virCheckFlags(0, -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);
+
+ cleanup:
+ if (vm)
+ virObjectUnlock(vm);
+ return ret;
+}
static virHypervisorDriver libxlDriver = {
.no = VIR_DRV_LIBXL,
@@ -4824,6 +4848,7 @@ static virHypervisorDriver libxlDriver = {
.domainMigratePerform3Params = libxlDomainMigratePerform3Params, /* 1.2.6 */
.domainMigrateFinish3Params = libxlDomainMigrateFinish3Params, /* 1.2.6 */
.domainMigrateConfirm3Params = libxlDomainMigrateConfirm3Params, /* 1.2.6 */
+ .domainSendSysrq = libxlDomainSendSysrq, /* 1.2.12 */
};
static virStateDriver libxlStateDriver = {
--
1.8.4.5