File Coverage

blib/lib/Sys/Async/Virt/NodeDevice.pm
Criterion Covered Total %
statement 26 137 18.9
branch n/a
condition 0 8 0.0
subroutine 9 32 28.1
pod 21 23 91.3
total 56 200 28.0


line stmt bran cond sub pod time code
1             ####################################################################
2             #
3             # This file was generated using XDR::Parse version v1.0.1
4             # and LibVirt version v12.1.0
5             #
6             # Don't edit this file, use the source template instead
7             #
8             # ANY CHANGES HERE WILL BE LOST !
9             #
10             ####################################################################
11              
12              
13 1     1   15 use v5.26;
  1         4  
14 1     1   6 use warnings;
  1         2  
  1         66  
15 1     1   6 use experimental 'signatures';
  1         3  
  1         7  
16 1     1   180 use Future::AsyncAwait;
  1         3  
  1         6  
17 1     1   63 use Object::Pad;
  1         4  
  1         7  
18              
19             class Sys::Async::Virt::NodeDevice v0.6.1;
20              
21 1     1   339 use Carp qw(croak);
  1         1  
  1         50  
22 1     1   4 use Log::Any qw($log);
  1         2  
  1         5  
23              
24 1     1   165 use Protocol::Sys::Virt::Remote::XDR v12.1.0;
  1         10  
  1         85  
25             my $remote = 'Protocol::Sys::Virt::Remote::XDR';
26              
27             use constant {
28 1         4189 XML_INACTIVE => 1 << 0,
29             UPDATE_AFFECT_CURRENT => 0,
30             UPDATE_AFFECT_LIVE => 1 << 0,
31             UPDATE_AFFECT_CONFIG => 1 << 1,
32             EVENT_CREATED => 0,
33             EVENT_DELETED => 1,
34             EVENT_DEFINED => 2,
35             EVENT_UNDEFINED => 3,
36 1     1   5 };
  1         1  
37              
38              
39 0     0 0   field $_rpc_id :param :reader;
  0            
40 0     0 0   field $_client :param :reader;
  0            
41              
42 0     0 1   method name() {
  0            
  0            
43 0           return $_rpc_id->{name};
44             }
45              
46              
47 0     0 1   method create($flags = 0) {
  0            
  0            
  0            
48 0   0       return $_client->_call(
49             $remote->PROC_NODE_DEVICE_CREATE,
50             { name => $_rpc_id, flags => $flags // 0 }, empty => 1 );
51             }
52              
53 0     0 1   async method create_xml($flags = 0) {
  0            
  0            
  0            
  0            
54 0           return await $_client->_call(
55             $remote->PROC_NODE_DEVICE_CREATE_XML,
56             { xml_desc => $_rpc_id, flags => $flags // 0 }, unwrap => 'dev' );
57             }
58              
59 0     0 1   async method define_xml($flags = 0) {
  0            
  0            
  0            
  0            
60 0           return await $_client->_call(
61             $remote->PROC_NODE_DEVICE_DEFINE_XML,
62             { xml_desc => $_rpc_id, flags => $flags // 0 }, unwrap => 'dev' );
63             }
64              
65 0     0 1   method destroy() {
  0            
  0            
66 0           return $_client->_call(
67             $remote->PROC_NODE_DEVICE_DESTROY,
68             { name => $_rpc_id }, empty => 1 );
69             }
70              
71 0     0 1   method detach_flags($driverName, $flags = 0) {
  0            
  0            
  0            
  0            
72 0   0       return $_client->_call(
73             $remote->PROC_NODE_DEVICE_DETACH_FLAGS,
74             { name => $_rpc_id, driverName => $driverName, flags => $flags // 0 }, empty => 1 );
75             }
76              
77 0     0 1   method dettach() {
  0            
  0            
78 0           return $_client->_call(
79             $remote->PROC_NODE_DEVICE_DETTACH,
80             { name => $_rpc_id }, empty => 1 );
81             }
82              
83 0     0 1   async method get_autostart() {
  0            
  0            
  0            
84 0           return await $_client->_call(
85             $remote->PROC_NODE_DEVICE_GET_AUTOSTART,
86             { name => $_rpc_id }, unwrap => 'autostart' );
87             }
88              
89 0     0 1   async method get_parent() {
  0            
  0            
  0            
90 0           return await $_client->_call(
91             $remote->PROC_NODE_DEVICE_GET_PARENT,
92             { name => $_rpc_id }, unwrap => 'parentName' );
93             }
94              
95 0     0 1   async method get_xml_desc($flags = 0) {
  0            
  0            
  0            
  0            
96 0           return await $_client->_call(
97             $remote->PROC_NODE_DEVICE_GET_XML_DESC,
98             { name => $_rpc_id, flags => $flags // 0 }, unwrap => 'xml' );
99             }
100              
101 0     0 1   async method is_active() {
  0            
  0            
  0            
102 0           return await $_client->_call(
103             $remote->PROC_NODE_DEVICE_IS_ACTIVE,
104             { name => $_rpc_id }, unwrap => 'active' );
105             }
106              
107 0     0 1   async method is_persistent() {
  0            
  0            
  0            
108 0           return await $_client->_call(
109             $remote->PROC_NODE_DEVICE_IS_PERSISTENT,
110             { name => $_rpc_id }, unwrap => 'persistent' );
111             }
112              
113 0     0 1   async method list_caps() {
  0            
  0            
  0            
114 0           return await $_client->_call(
115             $remote->PROC_NODE_DEVICE_LIST_CAPS,
116             { name => $_rpc_id, maxnames => $remote->NODE_DEVICE_CAPS_LIST_MAX }, unwrap => 'names' );
117             }
118              
119 0     0 1   async method lookup_by_name() {
  0            
  0            
  0            
120 0           return await $_client->_call(
121             $remote->PROC_NODE_DEVICE_LOOKUP_BY_NAME,
122             { name => $_rpc_id }, unwrap => 'dev' );
123             }
124              
125 0     0 1   async method lookup_scsi_host_by_wwn($wwpn, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
126 0           return await $_client->_call(
127             $remote->PROC_NODE_DEVICE_LOOKUP_SCSI_HOST_BY_WWN,
128             { wwnn => $_rpc_id, wwpn => $wwpn, flags => $flags // 0 }, unwrap => 'dev' );
129             }
130              
131 0     0 1   async method num_of_caps() {
  0            
  0            
  0            
132 0           return await $_client->_call(
133             $remote->PROC_NODE_DEVICE_NUM_OF_CAPS,
134             { name => $_rpc_id }, unwrap => 'num' );
135             }
136              
137 0     0 1   method reattach() {
  0            
  0            
138 0           return $_client->_call(
139             $remote->PROC_NODE_DEVICE_RE_ATTACH,
140             { name => $_rpc_id }, empty => 1 );
141             }
142              
143 0     0 1   method reset() {
  0            
  0            
144 0           return $_client->_call(
145             $remote->PROC_NODE_DEVICE_RESET,
146             { name => $_rpc_id }, empty => 1 );
147             }
148              
149 0     0 1   method set_autostart($autostart) {
  0            
  0            
  0            
150 0           return $_client->_call(
151             $remote->PROC_NODE_DEVICE_SET_AUTOSTART,
152             { name => $_rpc_id, autostart => $autostart }, empty => 1 );
153             }
154              
155 0     0 1   method undefine($flags = 0) {
  0            
  0            
  0            
156 0   0       return $_client->_call(
157             $remote->PROC_NODE_DEVICE_UNDEFINE,
158             { name => $_rpc_id, flags => $flags // 0 }, empty => 1 );
159             }
160              
161 0     0 1   method update($xml_desc, $flags = 0) {
  0            
  0            
  0            
  0            
162 0   0       return $_client->_call(
163             $remote->PROC_NODE_DEVICE_UPDATE,
164             { name => $_rpc_id, xml_desc => $xml_desc, flags => $flags // 0 }, empty => 1 );
165             }
166              
167              
168              
169             1;
170              
171              
172             __END__