[PATCH 2/4] remote: Wire up the remote protocol

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

 



Like virNodeDeviceCreateXML, virNodeDeviceLookupSCSIHostByWWN
has to be treated specially when generating the RPC codes. Also
new rules are added in fixup_name to keep the name SCSIHostByWWN.
---
 src/remote/remote_driver.c   |    1 +
 src/remote/remote_protocol.x |   13 ++++++++++++-
 src/remote_protocol-structs  |    9 +++++++++
 src/rpc/gendispatch.pl       |    5 ++++-
 4 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 341321b..feb372e 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -6359,6 +6359,7 @@ static virDeviceMonitor dev_monitor = {
     .listDevices = remoteNodeListDevices, /* 0.5.0 */
     .listAllNodeDevices  = remoteConnectListAllNodeDevices, /* 0.10.2 */
     .deviceLookupByName = remoteNodeDeviceLookupByName, /* 0.5.0 */
+    .deviceLookupSCSIHostByWWN = remoteNodeDeviceLookupSCSIHostByWWN, /* 1.0.2 */
     .deviceGetXMLDesc = remoteNodeDeviceGetXMLDesc, /* 0.5.0 */
     .deviceGetParent = remoteNodeDeviceGetParent, /* 0.5.0 */
     .deviceNumOfCaps = remoteNodeDeviceNumOfCaps, /* 0.5.0 */
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 9035776..5ace31f 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -1852,6 +1852,16 @@ struct remote_node_device_lookup_by_name_ret {
     remote_nonnull_node_device dev;
 };
 
+struct remote_node_device_lookup_scsi_host_by_wwn_args {
+    remote_nonnull_string wwnn;
+    remote_nonnull_string wwpn;
+    unsigned int flags;
+};
+
+struct remote_node_device_lookup_scsi_host_by_wwn_ret {
+    remote_nonnull_node_device dev;
+};
+
 struct remote_node_device_get_xml_desc_args {
     remote_nonnull_string name;
     unsigned int flags;
@@ -3049,7 +3059,8 @@ enum remote_procedure {
     REMOTE_PROC_NODE_GET_CPU_MAP = 293, /* skipgen skipgen */
     REMOTE_PROC_DOMAIN_FSTRIM = 294, /* autogen autogen */
     REMOTE_PROC_DOMAIN_SEND_PROCESS_SIGNAL = 295, /* autogen autogen */
-    REMOTE_PROC_DOMAIN_OPEN_CHANNEL = 296 /* autogen autogen | readstream@2 */
+    REMOTE_PROC_DOMAIN_OPEN_CHANNEL = 296, /* autogen autogen | readstream@2 */
+    REMOTE_PROC_NODE_DEVICE_LOOKUP_SCSI_HOST_BY_WWN = 297 /* autogen autogen priority:high */
 
     /*
      * Notice how the entries are grouped in sets of 10 ?
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 91414d4..b8ca88b 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -1400,6 +1400,14 @@ struct remote_node_device_lookup_by_name_args {
 struct remote_node_device_lookup_by_name_ret {
         remote_nonnull_node_device dev;
 };
+struct remote_node_device_lookup_scsi_host_by_wwn_args {
+        remote_nonull_string wwnn;
+        remote_nonull_string wwpn;
+        unsigned int flags;
+};
+struct remote_node_device_lookup_scsi_host_by_wwn_ret {
+        remote_nonnull_node_device dev;
+};
 struct remote_node_device_get_xml_desc_args {
         remote_nonnull_string      name;
         u_int                      flags;
@@ -2453,4 +2461,5 @@ enum remote_procedure {
         REMOTE_PROC_DOMAIN_FSTRIM = 294,
         REMOTE_PROC_DOMAIN_SEND_PROCESS_SIGNAL = 295,
         REMOTE_PROC_DOMAIN_OPEN_CHANNEL = 296,
+        REMOTE_PROC_NODE_DEVICE_LOOKUP_SCSI_HOST_BY_WWN = 297,
 };
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index f00ed7c..1da28a4 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -45,6 +45,8 @@ sub fixup_name {
     $name =~ s/Nmi$/NMI/;
     $name =~ s/Pm/PM/;
     $name =~ s/Fstrim$/FSTrim/;
+    $name =~ s/Scsi/SCSI/;
+    $name =~ s/Wwn$/WWN/;
 
     return $name;
 }
@@ -402,7 +404,8 @@ elsif ($opt_b) {
             # node device is special, as it's identified by name
             if ($argtype =~ m/^remote_node_device_/ and
                 !($argtype =~ m/^remote_node_device_lookup_by_name_/) and
-                !($argtype =~ m/^remote_node_device_create_xml_/)) {
+                !($argtype =~ m/^remote_node_device_create_xml_/) and
+                !($argtype =~ m/^remote_node_device_lookup_scsi_host_by_wwn_/)) {
                 $has_node_device = 1;
                 push(@vars_list, "virNodeDevicePtr dev = NULL");
                 push(@getters_list,
-- 
1.7.7.6

--
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]