[PATCH V4 2/5] implement remote protocol for domainSendSysrq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Chunyan Liu <cyliu@xxxxxxxx>
---
 src/remote/remote_driver.c   |  1 +
 src/remote/remote_protocol.x | 14 +++++++++++++-
 src/remote_protocol-structs  |  6 ++++++
 src/rpc/gendispatch.pl       | 12 ++++++++++++
 4 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 999f16d..b24de5c 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -8285,6 +8285,7 @@ static virHypervisorDriver hypervisor_driver = {
     .connectGetAllDomainStats = remoteConnectGetAllDomainStats, /* 1.2.8 */
     .nodeAllocPages = remoteNodeAllocPages, /* 1.2.9 */
     .domainGetFSInfo = remoteDomainGetFSInfo, /* 1.2.11 */
+    .domainSendSysrq = remoteDomainSendSysrq, /* 1.2.12 */
 };
 
 static virNetworkDriver network_driver = {
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index cbd3ec7..708983c 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -1084,6 +1084,12 @@ struct remote_domain_send_key_args {
     unsigned int flags;
 };
 
+struct remote_domain_send_sysrq_args {
+    remote_nonnull_domain dom;
+    char key;
+    unsigned int flags;
+};
+
 struct remote_domain_send_process_signal_args {
     remote_nonnull_domain dom;
     hyper pid_value;
@@ -5550,5 +5556,11 @@ enum remote_procedure {
      * @generate: none
      * @acl: domain:fs_freeze
      */
-    REMOTE_PROC_DOMAIN_GET_FSINFO = 349
+    REMOTE_PROC_DOMAIN_GET_FSINFO = 349,
+
+    /**
+     * @generate: both
+     * @acl: domain:send_input
+     */
+    REMOTE_PROC_DOMAIN_SEND_SYSRQ = 350
 };
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 2907fd5..afd9a8d 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -2605,6 +2605,11 @@ struct remote_domain_get_fsinfo_ret {
         } info;
         u_int                      ret;
 };
+struct remote_domain_send_sysrq_args {
+        remote_nonnull_domain dom;
+        char key;
+        unsigned int flags;
+};
 enum remote_procedure {
         REMOTE_PROC_CONNECT_OPEN = 1,
         REMOTE_PROC_CONNECT_CLOSE = 2,
@@ -2955,4 +2960,5 @@ enum remote_procedure {
         REMOTE_PROC_NODE_ALLOC_PAGES = 347,
         REMOTE_PROC_DOMAIN_EVENT_CALLBACK_AGENT_LIFECYCLE = 348,
         REMOTE_PROC_DOMAIN_GET_FSINFO = 349,
+        REMOTE_PROC_DOMAIN_SEND_SYSRQ = 350,
 };
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index 0dc167a..cafe5ab 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -592,6 +592,12 @@ elsif ($mode eq "server") {
                     } else {
                         push(@args_list, "args->$arg_name");
                     }
+                } elsif ($args_member =~ m/^(unsigned )?char (\S+);/) {
+                    if (! @args_list) {
+                        push(@args_list, "priv->conn");
+                    }
+
+                    push(@args_list, "args->$2");
                 } elsif ($args_member =~ m/^(\/)?\*/) {
                     # ignore comments
                 } else {
@@ -1228,6 +1234,12 @@ elsif ($mode eq "client") {
 
                     push(@args_list, "$type_name $arg_name");
                     push(@setters_list, "args.$arg_name = $arg_name;");
+                } elsif ($args_member =~ m/^((?:unsigned )?char) (\S+);/) {
+                    my $type_name = $1;
+                    my $arg_name = $2;
+
+                    push(@args_list, "$type_name $arg_name");
+                    push(@setters_list, "args.$arg_name = $arg_name;");
                 } elsif ($args_member =~ m/^(\/)?\*/) {
                     # ignore comments
                 } else {
-- 
1.8.4.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]