Like virNodeDeviceFindByName, virNodeDeviceFindByWWN has to be
treated specially when generating the RPC codes. Also new rule
is added in fixup_name to keep the name FindByWWN.
---
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 13 ++++++++++++-
src/remote_protocol-structs | 9 +++++++++
src/rpc/gendispatch.pl | 4 +++-
4 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index c078cb5..3c0aeaf 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -6274,6 +6274,7 @@ static virDeviceMonitor dev_monitor = {
.listDevices = remoteNodeListDevices, /* 0.5.0 */
.listAllNodeDevices = remoteConnectListAllNodeDevices, /* 0.10.2 */
.deviceLookupByName = remoteNodeDeviceLookupByName, /* 0.5.0 */
+ .deviceLookupByWWN = remoteNodeDeviceLookupByWWN, /* 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..ccdaea2 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_by_wwn_args {
+ remote_nonnull_string wwnn;
+ remote_nonnull_string wwpn;
+ unsigned int flags;
+};
+
+struct remote_node_device_lookup_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_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..368833a 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_by_wwn_args {
+ remote_nonull_string wwnn;
+ remote_nonull_string wwpn;
+ unsigned int flags;
+};
+struct remote_node_device_lookup_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_BY_WWN = 297,
};
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index 899f4bc..1f895ba 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -45,6 +45,7 @@ sub fixup_name {
$name =~ s/Nmi$/NMI/;
$name =~ s/Pm/PM/;
$name =~ s/Fstrim$/FSTrim/;
+ $name =~ s/Wwn$/WWN/;
return $name;
}
@@ -402,7 +403,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_by_wwn_/)) {
$has_node_device = 1;
push(@vars_list, "virNodeDevicePtr dev = NULL");
push(@getters_list,
--
1.7.7.6