File Coverage

blib/lib/Sys/Async/Virt.pm
Criterion Covered Total %
statement 107 1483 7.2
branch 0 180 0.0
condition 0 66 0.0
subroutine 36 237 15.1
pod 121 122 99.1
total 264 2088 12.6


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.3.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   177168 use v5.26;
  1         3  
14 1     1   8 use warnings;
  1         9  
  1         71  
15 1     1   4 no warnings qw(void);
  1         2  
  1         28  
16 1     1   530 use experimental 'signatures';
  1         3032  
  1         5  
17 1     1   712 use Feature::Compat::Try;
  1         345  
  1         7  
18 1     1   504 use Future::AsyncAwait;
  1         17537  
  1         4  
19 1     1   652 use Object::Pad 0.821;
  1         3996  
  1         71  
20 1     1   595 use Sublike::Extended 0.29 'method', 'sub'; # From XS-Parse-Sublike, used by Future::AsyncAwait
  1         470  
  1         3  
21              
22             class Sys::Async::Virt v0.6.3;
23              
24              
25 1     1   185 use Carp qw(croak);
  1         1  
  1         42  
26 1     1   4 use Future;
  1         1  
  1         19  
27 1     1   475 use Future::IO;
  1         30664  
  1         55  
28 1     1   552 use Future::Selector;
  1         3181  
  1         57  
29 1     1   391 use Log::Any qw($log);
  1         8931  
  1         4  
30 1     1   2044 use Scalar::Util qw(reftype weaken);
  1         1  
  1         56  
31              
32 1     1   7141 use Protocol::Sys::Virt::Remote::XDR v12.3.0;
  1         377642  
  1         7705  
33             my $remote = 'Protocol::Sys::Virt::Remote::XDR';
34              
35 1     1   1364 use Protocol::Sys::Virt::KeepAlive v12.3.0;
  1         11945  
  1         56  
36 1     1   1409 use Protocol::Sys::Virt::Remote v12.3.0;
  1         243400  
  1         266  
37 1     1   849 use Protocol::Sys::Virt::Transport v12.3.0;
  1         3450  
  1         298  
38 1     1   513 use Protocol::Sys::Virt::URI v12.3.0; # imports parse_url
  1         23703  
  1         82  
39              
40 1     1   641 use Sys::Async::Virt::Connection::Factory v0.6.3;
  1         20  
  1         40  
41 1     1   1487 use Sys::Async::Virt::Domain v0.6.3;
  1         25  
  1         69  
42 1     1   660 use Sys::Async::Virt::DomainCheckpoint v0.6.3;
  1         17  
  1         103  
43 1     1   535 use Sys::Async::Virt::DomainSnapshot v0.6.3;
  1         17  
  1         94  
44 1     1   555 use Sys::Async::Virt::Network v0.6.3;
  1         15  
  1         142  
45 1     1   512 use Sys::Async::Virt::NetworkPort v0.6.3;
  1         16  
  1         70  
46 1     1   545 use Sys::Async::Virt::NwFilter v0.6.3;
  1         13  
  1         55  
47 1     1   520 use Sys::Async::Virt::NwFilterBinding v0.6.3;
  1         14  
  1         47  
48 1     1   561 use Sys::Async::Virt::Interface v0.6.3;
  1         16  
  1         67  
49 1     1   594 use Sys::Async::Virt::StoragePool v0.6.3;
  1         16  
  1         192  
50 1     1   483 use Sys::Async::Virt::StorageVol v0.6.3;
  1         15  
  1         69  
51 1     1   536 use Sys::Async::Virt::NodeDevice v0.6.3;
  1         15  
  1         97  
52 1     1   530 use Sys::Async::Virt::Secret v0.6.3;
  1         52  
  1         40  
53              
54 1     1   529 use Sys::Async::Virt::Callback v0.6.3;
  1         15  
  1         55  
55 1     1   547 use Sys::Async::Virt::Stream v0.6.3;
  1         23  
  1         1082  
56              
57             use constant {
58 1         1468 CLOSE_REASON_ERROR => 0,
59             CLOSE_REASON_EOF => 1,
60             CLOSE_REASON_KEEPALIVE => 2,
61             CLOSE_REASON_CLIENT => 3,
62             TYPED_PARAM_INT => 1,
63             TYPED_PARAM_UINT => 2,
64             TYPED_PARAM_LLONG => 3,
65             TYPED_PARAM_ULLONG => 4,
66             TYPED_PARAM_DOUBLE => 5,
67             TYPED_PARAM_BOOLEAN => 6,
68             TYPED_PARAM_STRING => 7,
69             TYPED_PARAM_STRING_OKAY => 1 << 2,
70             TYPED_PARAM_FIELD_LENGTH => 80,
71             GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES => (1 << 0),
72             GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES => (1 << 1),
73             DOMAIN_DEFINE_VALIDATE => (1 << 0),
74             LIST_DOMAINS_ACTIVE => 1 << 0,
75             LIST_DOMAINS_INACTIVE => 1 << 1,
76             LIST_DOMAINS_PERSISTENT => 1 << 2,
77             LIST_DOMAINS_TRANSIENT => 1 << 3,
78             LIST_DOMAINS_RUNNING => 1 << 4,
79             LIST_DOMAINS_PAUSED => 1 << 5,
80             LIST_DOMAINS_SHUTOFF => 1 << 6,
81             LIST_DOMAINS_OTHER => 1 << 7,
82             LIST_DOMAINS_MANAGEDSAVE => 1 << 8,
83             LIST_DOMAINS_NO_MANAGEDSAVE => 1 << 9,
84             LIST_DOMAINS_AUTOSTART => 1 << 10,
85             LIST_DOMAINS_NO_AUTOSTART => 1 << 11,
86             LIST_DOMAINS_HAS_SNAPSHOT => 1 << 12,
87             LIST_DOMAINS_NO_SNAPSHOT => 1 << 13,
88             LIST_DOMAINS_HAS_CHECKPOINT => 1 << 14,
89             LIST_DOMAINS_NO_CHECKPOINT => 1 << 15,
90             GET_ALL_DOMAINS_STATS_ACTIVE => 1 << 0,
91             GET_ALL_DOMAINS_STATS_INACTIVE => 1 << 1,
92             GET_ALL_DOMAINS_STATS_PERSISTENT => 1 << 2,
93             GET_ALL_DOMAINS_STATS_TRANSIENT => 1 << 3,
94             GET_ALL_DOMAINS_STATS_RUNNING => 1 << 4,
95             GET_ALL_DOMAINS_STATS_PAUSED => 1 << 5,
96             GET_ALL_DOMAINS_STATS_SHUTOFF => 1 << 6,
97             GET_ALL_DOMAINS_STATS_OTHER => 1 << 7,
98             GET_ALL_DOMAINS_STATS_NOWAIT => 1 << 29,
99             GET_ALL_DOMAINS_STATS_BACKING => 1 << 30,
100             GET_ALL_DOMAINS_STATS_ENFORCE_STATS => 1 << 31,
101             DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED => 1,
102             DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED => 2,
103             DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN => 0,
104             DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED => 1,
105             DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL => 2,
106             DOMAIN_EVENT_ID_LIFECYCLE => 0,
107             DOMAIN_EVENT_ID_REBOOT => 1,
108             DOMAIN_EVENT_ID_RTC_CHANGE => 2,
109             DOMAIN_EVENT_ID_WATCHDOG => 3,
110             DOMAIN_EVENT_ID_IO_ERROR => 4,
111             DOMAIN_EVENT_ID_GRAPHICS => 5,
112             DOMAIN_EVENT_ID_IO_ERROR_REASON => 6,
113             DOMAIN_EVENT_ID_CONTROL_ERROR => 7,
114             DOMAIN_EVENT_ID_BLOCK_JOB => 8,
115             DOMAIN_EVENT_ID_DISK_CHANGE => 9,
116             DOMAIN_EVENT_ID_TRAY_CHANGE => 10,
117             DOMAIN_EVENT_ID_PMWAKEUP => 11,
118             DOMAIN_EVENT_ID_PMSUSPEND => 12,
119             DOMAIN_EVENT_ID_BALLOON_CHANGE => 13,
120             DOMAIN_EVENT_ID_PMSUSPEND_DISK => 14,
121             DOMAIN_EVENT_ID_DEVICE_REMOVED => 15,
122             DOMAIN_EVENT_ID_BLOCK_JOB_2 => 16,
123             DOMAIN_EVENT_ID_TUNABLE => 17,
124             DOMAIN_EVENT_ID_AGENT_LIFECYCLE => 18,
125             DOMAIN_EVENT_ID_DEVICE_ADDED => 19,
126             DOMAIN_EVENT_ID_MIGRATION_ITERATION => 20,
127             DOMAIN_EVENT_ID_JOB_COMPLETED => 21,
128             DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED => 22,
129             DOMAIN_EVENT_ID_METADATA_CHANGE => 23,
130             DOMAIN_EVENT_ID_BLOCK_THRESHOLD => 24,
131             DOMAIN_EVENT_ID_MEMORY_FAILURE => 25,
132             DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE => 26,
133             DOMAIN_EVENT_ID_NIC_MAC_CHANGE => 27,
134             SUSPEND_TARGET_MEM => 0,
135             SUSPEND_TARGET_DISK => 1,
136             SUSPEND_TARGET_HYBRID => 2,
137             SECURITY_LABEL_BUFLEN => (4096 + 1),
138             SECURITY_MODEL_BUFLEN => (256 + 1),
139             SECURITY_DOI_BUFLEN => (256 + 1),
140             CPU_STATS_FIELD_LENGTH => 80,
141             CPU_STATS_ALL_CPUS => -1,
142             CPU_STATS_KERNEL => "kernel",
143             CPU_STATS_USER => "user",
144             CPU_STATS_IDLE => "idle",
145             CPU_STATS_IOWAIT => "iowait",
146             CPU_STATS_INTR => "intr",
147             CPU_STATS_GUEST => "guest",
148             CPU_STATS_UTILIZATION => "utilization",
149             MEMORY_STATS_FIELD_LENGTH => 80,
150             MEMORY_STATS_ALL_CELLS => -1,
151             MEMORY_STATS_TOTAL => "total",
152             MEMORY_STATS_FREE => "free",
153             MEMORY_STATS_BUFFERS => "buffers",
154             MEMORY_STATS_CACHED => "cached",
155             MEMORY_STATS_AVAILABLE => "available",
156             MEMORY_SHARED_PAGES_TO_SCAN => "shm_pages_to_scan",
157             MEMORY_SHARED_SLEEP_MILLISECS => "shm_sleep_millisecs",
158             MEMORY_SHARED_PAGES_SHARED => "shm_pages_shared",
159             MEMORY_SHARED_PAGES_SHARING => "shm_pages_sharing",
160             MEMORY_SHARED_PAGES_UNSHARED => "shm_pages_unshared",
161             MEMORY_SHARED_PAGES_VOLATILE => "shm_pages_volatile",
162             MEMORY_SHARED_FULL_SCANS => "shm_full_scans",
163             MEMORY_SHARED_MERGE_ACROSS_NODES => "shm_merge_across_nodes",
164             SEV_PDH => "pdh",
165             SEV_CERT_CHAIN => "cert-chain",
166             SEV_CPU0_ID => "cpu0-id",
167             SEV_CBITPOS => "cbitpos",
168             SEV_REDUCED_PHYS_BITS => "reduced-phys-bits",
169             SEV_MAX_GUESTS => "max-guests",
170             SEV_MAX_ES_GUESTS => "max-es-guests",
171             RO => (1 << 0),
172             NO_ALIASES => (1 << 1),
173             CRED_USERNAME => 1,
174             CRED_AUTHNAME => 2,
175             CRED_LANGUAGE => 3,
176             CRED_CNONCE => 4,
177             CRED_PASSPHRASE => 5,
178             CRED_ECHOPROMPT => 6,
179             CRED_NOECHOPROMPT => 7,
180             CRED_REALM => 8,
181             CRED_EXTERNAL => 9,
182             UUID_BUFLEN => (16),
183             UUID_STRING_BUFLEN => (36+1),
184             IDENTITY_USER_NAME => "user-name",
185             IDENTITY_UNIX_USER_ID => "unix-user-id",
186             IDENTITY_GROUP_NAME => "group-name",
187             IDENTITY_UNIX_GROUP_ID => "unix-group-id",
188             IDENTITY_PROCESS_ID => "process-id",
189             IDENTITY_PROCESS_TIME => "process-time",
190             IDENTITY_SASL_USER_NAME => "sasl-user-name",
191             IDENTITY_X509_DISTINGUISHED_NAME => "x509-distinguished-name",
192             IDENTITY_SELINUX_CONTEXT => "selinux-context",
193             CPU_COMPARE_ERROR => -1,
194             CPU_COMPARE_INCOMPATIBLE => 0,
195             CPU_COMPARE_IDENTICAL => 1,
196             CPU_COMPARE_SUPERSET => 2,
197             COMPARE_CPU_FAIL_INCOMPATIBLE => (1 << 0),
198             COMPARE_CPU_VALIDATE_XML => (1 << 1),
199             BASELINE_CPU_EXPAND_FEATURES => (1 << 0),
200             BASELINE_CPU_MIGRATABLE => (1 << 1),
201             BASELINE_CPU_IGNORE_HOST => (1 << 2),
202             ALLOC_PAGES_ADD => 0,
203             ALLOC_PAGES_SET => (1 << 0),
204             LIST_INTERFACES_INACTIVE => 1 << 0,
205             LIST_INTERFACES_ACTIVE => 1 << 1,
206             INTERFACE_DEFINE_VALIDATE => 1 << 0,
207             LIST_NETWORKS_INACTIVE => 1 << 0,
208             LIST_NETWORKS_ACTIVE => 1 << 1,
209             LIST_NETWORKS_PERSISTENT => 1 << 2,
210             LIST_NETWORKS_TRANSIENT => 1 << 3,
211             LIST_NETWORKS_AUTOSTART => 1 << 4,
212             LIST_NETWORKS_NO_AUTOSTART => 1 << 5,
213             NETWORK_CREATE_VALIDATE => 1 << 0,
214             NETWORK_DEFINE_VALIDATE => 1 << 0,
215             NETWORK_EVENT_ID_LIFECYCLE => 0,
216             NETWORK_EVENT_ID_METADATA_CHANGE => 1,
217             LIST_NODE_DEVICES_CAP_SYSTEM => 1 << 0,
218             LIST_NODE_DEVICES_CAP_PCI_DEV => 1 << 1,
219             LIST_NODE_DEVICES_CAP_USB_DEV => 1 << 2,
220             LIST_NODE_DEVICES_CAP_USB_INTERFACE => 1 << 3,
221             LIST_NODE_DEVICES_CAP_NET => 1 << 4,
222             LIST_NODE_DEVICES_CAP_SCSI_HOST => 1 << 5,
223             LIST_NODE_DEVICES_CAP_SCSI_TARGET => 1 << 6,
224             LIST_NODE_DEVICES_CAP_SCSI => 1 << 7,
225             LIST_NODE_DEVICES_CAP_STORAGE => 1 << 8,
226             LIST_NODE_DEVICES_CAP_FC_HOST => 1 << 9,
227             LIST_NODE_DEVICES_CAP_VPORTS => 1 << 10,
228             LIST_NODE_DEVICES_CAP_SCSI_GENERIC => 1 << 11,
229             LIST_NODE_DEVICES_CAP_DRM => 1 << 12,
230             LIST_NODE_DEVICES_CAP_MDEV_TYPES => 1 << 13,
231             LIST_NODE_DEVICES_CAP_MDEV => 1 << 14,
232             LIST_NODE_DEVICES_CAP_CCW_DEV => 1 << 15,
233             LIST_NODE_DEVICES_CAP_CSS_DEV => 1 << 16,
234             LIST_NODE_DEVICES_CAP_VDPA => 1 << 17,
235             LIST_NODE_DEVICES_CAP_AP_CARD => 1 << 18,
236             LIST_NODE_DEVICES_CAP_AP_QUEUE => 1 << 19,
237             LIST_NODE_DEVICES_CAP_AP_MATRIX => 1 << 20,
238             LIST_NODE_DEVICES_CAP_VPD => 1 << 21,
239             LIST_NODE_DEVICES_CAP_CCWGROUP_DEV => 1 << 22,
240             LIST_NODE_DEVICES_CAP_CCWGROUP_MEMBER => 1 << 23,
241             LIST_NODE_DEVICES_PERSISTENT => 1 << 28,
242             LIST_NODE_DEVICES_TRANSIENT => 1 << 29,
243             LIST_NODE_DEVICES_INACTIVE => 1 << 30,
244             LIST_NODE_DEVICES_ACTIVE => 1 << 31,
245             NODE_DEVICE_CREATE_XML_VALIDATE => 1 << 0,
246             NODE_DEVICE_DEFINE_XML_VALIDATE => 1 << 0,
247             NODE_DEVICE_EVENT_ID_LIFECYCLE => 0,
248             NODE_DEVICE_EVENT_ID_UPDATE => 1,
249             NWFILTER_DEFINE_VALIDATE => 1 << 0,
250             NWFILTER_BINDING_CREATE_VALIDATE => 1 << 0,
251             SECRET_USAGE_TYPE_NONE => 0,
252             SECRET_USAGE_TYPE_VOLUME => 1,
253             SECRET_USAGE_TYPE_CEPH => 2,
254             SECRET_USAGE_TYPE_ISCSI => 3,
255             SECRET_USAGE_TYPE_TLS => 4,
256             SECRET_USAGE_TYPE_VTPM => 5,
257             LIST_SECRETS_EPHEMERAL => 1 << 0,
258             LIST_SECRETS_NO_EPHEMERAL => 1 << 1,
259             LIST_SECRETS_PRIVATE => 1 << 2,
260             LIST_SECRETS_NO_PRIVATE => 1 << 3,
261             SECRET_DEFINE_VALIDATE => 1 << 0,
262             SECRET_EVENT_ID_LIFECYCLE => 0,
263             SECRET_EVENT_ID_VALUE_CHANGED => 1,
264             STORAGE_POOL_CREATE_NORMAL => 0,
265             STORAGE_POOL_CREATE_WITH_BUILD => 1 << 0,
266             STORAGE_POOL_CREATE_WITH_BUILD_OVERWRITE => 1 << 1,
267             STORAGE_POOL_CREATE_WITH_BUILD_NO_OVERWRITE => 1 << 2,
268             LIST_STORAGE_POOLS_INACTIVE => 1 << 0,
269             LIST_STORAGE_POOLS_ACTIVE => 1 << 1,
270             LIST_STORAGE_POOLS_PERSISTENT => 1 << 2,
271             LIST_STORAGE_POOLS_TRANSIENT => 1 << 3,
272             LIST_STORAGE_POOLS_AUTOSTART => 1 << 4,
273             LIST_STORAGE_POOLS_NO_AUTOSTART => 1 << 5,
274             LIST_STORAGE_POOLS_DIR => 1 << 6,
275             LIST_STORAGE_POOLS_FS => 1 << 7,
276             LIST_STORAGE_POOLS_NETFS => 1 << 8,
277             LIST_STORAGE_POOLS_LOGICAL => 1 << 9,
278             LIST_STORAGE_POOLS_DISK => 1 << 10,
279             LIST_STORAGE_POOLS_ISCSI => 1 << 11,
280             LIST_STORAGE_POOLS_SCSI => 1 << 12,
281             LIST_STORAGE_POOLS_MPATH => 1 << 13,
282             LIST_STORAGE_POOLS_RBD => 1 << 14,
283             LIST_STORAGE_POOLS_SHEEPDOG => 1 << 15,
284             LIST_STORAGE_POOLS_GLUSTER => 1 << 16,
285             LIST_STORAGE_POOLS_ZFS => 1 << 17,
286             LIST_STORAGE_POOLS_VSTORAGE => 1 << 18,
287             LIST_STORAGE_POOLS_ISCSI_DIRECT => 1 << 19,
288             STORAGE_POOL_DEFINE_VALIDATE => 1 << 0,
289             STORAGE_VOL_CREATE_PREALLOC_METADATA => 1 << 0,
290             STORAGE_VOL_CREATE_REFLINK => 1 << 1,
291             STORAGE_VOL_CREATE_VALIDATE => 1 << 2,
292             STORAGE_POOL_EVENT_ID_LIFECYCLE => 0,
293             STORAGE_POOL_EVENT_ID_REFRESH => 1,
294 1     1   7 };
  1         3  
295              
296              
297             use constant {
298 1         68166 _STATE_NONE => 0,
299             _STATE_INITIALIZING => 1,
300             _STATE_INITIALIZED => 2, # Process transports: in/out pipes have been connected
301             _STATE_AUTHENTICATING => 3, # Process transports: failure to start is discovered in this state
302             _STATE_AUTHENTICATED => 4,
303             _STATE_OPENING => 5,
304             _STATE_OPENED => 6,
305             _STATE_CLEANING_UP => 7,
306             _STATE_CLOSING => 8,
307             _STATE_CLOSED => 9,
308 1     1   7 };
  1         1  
309              
310             field $_domains = {};
311             field $_domain_checkpoints = {};
312             field $_domain_snapshots = {};
313             field $_networks = {};
314             field $_network_ports = {};
315             field $_nwfilters = {};
316             field $_nwfilter_bindings = {};
317             field $_interfaces = {};
318             field $_storage_pools = {};
319             field $_storage_vols = {};
320             field $_node_devices = {};
321             field $_secrets = {};
322             field $_callbacks = {};
323             field $_streams = {};
324              
325             # cached host data:
326             field $_maplen = 0; # length of the cpu map in bytes
327             field $_cpus = 0; # number of cpus in the hypervisor
328             field $_typed_param_string_okay = undef;
329              
330              
331             field $_url :param = $ENV{LIBVIRT_DEFAULT_URI};
332             field $_readonly :reader :param = undef;
333 0     0 0   field $_sasl :param = undef;
  0            
334             field $_connection :param = undef;
335             field $_transport :param = undef;
336             field $_remote :reader :param = undef;
337 0     0 1   field $_factory :param = undef;
  0            
338             field $_keepalive :param = undef;
339             field $_ping_interval :param = 60;
340              
341             field $_on_close :param = sub {};
342             field $_on_stream :param = undef;
343             field $_on_message :param = sub {};
344              
345             field $_sasl_session = undef;
346             field $_selector = Future::Selector->new;
347             field $_completed_f = undef;
348             field $_eof = 0;
349             field $_state = _STATE_NONE; # state machine
350             field $_replies = {};
351              
352              
353 0     0     method _no_translation(@args) {
  0            
  0            
  0            
354 0           return @args;
355             }
356              
357 0     0     method _translate_remote_nonnull_domain($dom, @) {
  0            
  0            
  0            
358 0           $self->_domain_instance( $dom );
359             }
360              
361 0     0     method _translate_remote_nonnull_domain_checkpoint($checkpoint, @) {
  0            
  0            
  0            
362 0           $self->_domain_checkpoint_instance( $checkpoint );
363             }
364              
365 0     0     method _translate_remote_nonnull_domain_snapshot($snapshot, @) {
  0            
  0            
  0            
366 0           $self->_domain_snapshot_instance( $snapshot );
367             }
368              
369 0     0     method _translate_remote_nonnull_network($network, @) {
  0            
  0            
  0            
370 0           $self->_network_instance( $network );
371             }
372              
373 0     0     method _translate_remote_nonnull_network_port($network_port, @) {
  0            
  0            
  0            
374 0           $self->_network_port_instance( $network_port );
375             }
376              
377 0     0     method _translate_remote_nonnull_nwfilter($nwfilter, @) {
  0            
  0            
  0            
378 0           $self->_network_nwfilter_instance( $nwfilter );
379             }
380              
381 0     0     method _translate_remote_nonnull_nwfilter_binding($binding, @) {
  0            
  0            
  0            
382 0           $self->_network_nwfilter_binding_instance( $binding );
383             }
384              
385 0     0     method _translate_remote_nonnull_interface($interface, @) {
  0            
  0            
  0            
386 0           $self->_network_interface_instance( $interface );
387             }
388              
389 0     0     method _translate_remote_nonnull_storage_pool($pool, @) {
  0            
  0            
  0            
390 0           $self->_storage_pool_instance( $pool );
391             }
392              
393 0     0     method _translate_remote_nonnull_storage_vol($vol, @) {
  0            
  0            
  0            
394 0           $self->_storage_vol_instance( $vol );
395             }
396              
397 0     0     method _translate_remote_nonnull_node_device($device, @) {
  0            
  0            
  0            
398 0           $self->_node_device_instance( $device );
399             }
400              
401 0     0     method _translate_remote_nonnull_secret($secret, @) {
  0            
  0            
  0            
402 0           $self->_secret_instance( $secret );
403             }
404              
405             my @reply_translators = (
406             undef,
407             \&_no_translation,
408             \&_no_translation,
409             sub { 3; my $client = shift; _translated_reply($client, undef, { }, @_) },
410             sub { 4; my $client = shift; _translated_reply($client, undef, { }, @_) },
411             sub { 5; my $client = shift; _translated_reply($client, undef, { }, @_) },
412             \&_no_translation,
413             sub { 7; my $client = shift; _translated_reply($client, undef, { }, @_) },
414             \&_no_translation,
415             \&_no_translation,
416             sub { 10; my $client = shift; _translated_reply($client, undef, { dom => \&_translate_remote_nonnull_domain }, @_) },
417             sub { 11; my $client = shift; _translated_reply($client, undef, { dom => \&_translate_remote_nonnull_domain }, @_) },
418             \&_no_translation,
419             \&_no_translation,
420             sub { 14; my $client = shift; _translated_reply($client, undef, { }, @_) },
421             sub { 15; my $client = shift; _translated_reply($client, undef, { }, @_) },
422             \&_no_translation,
423             sub { 17; my $client = shift; _translated_reply($client, undef, { }, @_) },
424             sub { 18; my $client = shift; _translated_reply($client, undef, { }, @_) },
425             sub { 19; my $client = shift; _translated_reply($client, undef, { }, @_) },
426             \&_no_translation,
427             sub { 21; my $client = shift; _translated_reply($client, undef, { }, @_) },
428             sub { 22; my $client = shift; _translated_reply($client, undef, { dom => \&_translate_remote_nonnull_domain }, @_) },
429             sub { 23; my $client = shift; _translated_reply($client, undef, { dom => \&_translate_remote_nonnull_domain }, @_) },
430             sub { 24; my $client = shift; _translated_reply($client, undef, { dom => \&_translate_remote_nonnull_domain }, @_) },
431             sub { 25; my $client = shift; _translated_reply($client, undef, { }, @_) },
432             \&_no_translation,
433             \&_no_translation,
434             \&_no_translation,
435             \&_no_translation,
436             \&_no_translation,
437             \&_no_translation,
438             \&_no_translation,
439             \&_no_translation,
440             \&_no_translation,
441             \&_no_translation,
442             sub { 36; my $client = shift; _translated_reply($client, undef, { }, @_) },
443             sub { 37; my $client = shift; _translated_reply($client, undef, { }, @_) },
444             sub { 38; my $client = shift; _translated_reply($client, undef, { }, @_) },
445             \&_no_translation,
446             sub { 40; my $client = shift; _translated_reply($client, undef, { net => \&_translate_remote_nonnull_network }, @_) },
447             sub { 41; my $client = shift; _translated_reply($client, undef, { net => \&_translate_remote_nonnull_network }, @_) },
448             \&_no_translation,
449             sub { 43; my $client = shift; _translated_reply($client, undef, { }, @_) },
450             sub { 44; my $client = shift; _translated_reply($client, undef, { }, @_) },
451             sub { 45; my $client = shift; _translated_reply($client, undef, { }, @_) },
452             sub { 46; my $client = shift; _translated_reply($client, undef, { net => \&_translate_remote_nonnull_network }, @_) },
453             sub { 47; my $client = shift; _translated_reply($client, undef, { net => \&_translate_remote_nonnull_network }, @_) },
454             \&_no_translation,
455             \&_no_translation,
456             sub { 50; my $client = shift; _translated_reply($client, undef, { }, @_) },
457             sub { 51; my $client = shift; _translated_reply($client, undef, { }, @_) },
458             sub { 52; my $client = shift; _translated_reply($client, undef, { }, @_) },
459             \&_no_translation,
460             \&_no_translation,
461             \&_no_translation,
462             sub { 56; my $client = shift; _translated_reply($client, undef, { }, @_) },
463             sub { 57; my $client = shift; _translated_reply($client, undef, { }, @_) },
464             \&_no_translation,
465             sub { 59; my $client = shift; _translated_reply($client, undef, { }, @_) },
466             sub { 60; my $client = shift; _translated_reply($client, undef, { }, @_) },
467             \&_no_translation,
468             \&_no_translation,
469             sub { 63; my $client = shift; _translated_reply($client, undef, { ddom => \&_translate_remote_nonnull_domain }, @_) },
470             \&_no_translation,
471             \&_no_translation,
472             \&_no_translation,
473             \&_no_translation,
474             \&_no_translation,
475             \&_no_translation,
476             \&_no_translation,
477             sub { 71; my $client = shift; _translated_reply($client, undef, { }, @_) },
478             sub { 72; my $client = shift; _translated_reply($client, undef, { }, @_) },
479             sub { 73; my $client = shift; _translated_reply($client, undef, { }, @_) },
480             sub { 74; my $client = shift; _translated_reply($client, undef, { }, @_) },
481             sub { 75; my $client = shift; _translated_reply($client, undef, { }, @_) },
482             sub { 76; my $client = shift; _translated_reply($client, undef, { pool => \&_translate_remote_nonnull_storage_pool }, @_) },
483             sub { 77; my $client = shift; _translated_reply($client, undef, { pool => \&_translate_remote_nonnull_storage_pool }, @_) },
484             \&_no_translation,
485             \&_no_translation,
486             \&_no_translation,
487             \&_no_translation,
488             \&_no_translation,
489             \&_no_translation,
490             sub { 84; my $client = shift; _translated_reply($client, undef, { pool => \&_translate_remote_nonnull_storage_pool }, @_) },
491             sub { 85; my $client = shift; _translated_reply($client, undef, { pool => \&_translate_remote_nonnull_storage_pool }, @_) },
492             sub { 86; my $client = shift; _translated_reply($client, undef, { pool => \&_translate_remote_nonnull_storage_pool }, @_) },
493             \&_no_translation,
494             sub { 88; my $client = shift; _translated_reply($client, undef, { }, @_) },
495             sub { 89; my $client = shift; _translated_reply($client, undef, { }, @_) },
496             \&_no_translation,
497             sub { 91; my $client = shift; _translated_reply($client, undef, { }, @_) },
498             sub { 92; my $client = shift; _translated_reply($client, undef, { }, @_) },
499             sub { 93; my $client = shift; _translated_reply($client, undef, { vol => \&_translate_remote_nonnull_storage_vol }, @_) },
500             \&_no_translation,
501             sub { 95; my $client = shift; _translated_reply($client, undef, { vol => \&_translate_remote_nonnull_storage_vol }, @_) },
502             sub { 96; my $client = shift; _translated_reply($client, undef, { vol => \&_translate_remote_nonnull_storage_vol }, @_) },
503             sub { 97; my $client = shift; _translated_reply($client, undef, { vol => \&_translate_remote_nonnull_storage_vol }, @_) },
504             \&_no_translation,
505             sub { 99; my $client = shift; _translated_reply($client, undef, { }, @_) },
506             sub { 100; my $client = shift; _translated_reply($client, undef, { }, @_) },
507             \&_no_translation,
508             sub { 102; my $client = shift; _translated_reply($client, undef, { }, @_) },
509             sub { 103; my $client = shift; _translated_reply($client, undef, { }, @_) },
510             sub { 104; my $client = shift; _translated_reply($client, undef, { }, @_) },
511             \&_no_translation,
512             \&_no_translation,
513             sub { 107; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
514             \&_no_translation,
515             sub { 109; my $client = shift; _translated_reply($client, undef, { ddom => \&_translate_remote_nonnull_domain }, @_) },
516             sub { 110; my $client = shift; _translated_reply($client, undef, { }, @_) },
517             sub { 111; my $client = shift; _translated_reply($client, undef, { }, @_) },
518             sub { 112; my $client = shift; _translated_reply($client, undef, { }, @_) },
519             sub { 113; my $client = shift; _translated_reply($client, undef, { dev => \&_translate_remote_nonnull_node_device }, @_) },
520             sub { 114; my $client = shift; _translated_reply($client, undef, { }, @_) },
521             sub { 115; my $client = shift; _translated_reply($client, undef, { }, @_) },
522             sub { 116; my $client = shift; _translated_reply($client, undef, { }, @_) },
523             sub { 117; my $client = shift; _translated_reply($client, undef, { }, @_) },
524             \&_no_translation,
525             \&_no_translation,
526             \&_no_translation,
527             \&_no_translation,
528             \&_no_translation,
529             sub { 123; my $client = shift; _translated_reply($client, undef, { dev => \&_translate_remote_nonnull_node_device }, @_) },
530             \&_no_translation,
531             sub { 125; my $client = shift; _translated_reply($client, undef, { vol => \&_translate_remote_nonnull_storage_vol }, @_) },
532             sub { 126; my $client = shift; _translated_reply($client, undef, { }, @_) },
533             sub { 127; my $client = shift; _translated_reply($client, undef, { }, @_) },
534             sub { 128; my $client = shift; _translated_reply($client, undef, { iface => \&_translate_remote_nonnull_interface }, @_) },
535             sub { 129; my $client = shift; _translated_reply($client, undef, { iface => \&_translate_remote_nonnull_interface }, @_) },
536             sub { 130; my $client = shift; _translated_reply($client, undef, { }, @_) },
537             sub { 131; my $client = shift; _translated_reply($client, undef, { iface => \&_translate_remote_nonnull_interface }, @_) },
538             \&_no_translation,
539             \&_no_translation,
540             \&_no_translation,
541             sub { 135; my $client = shift; _translated_reply($client, undef, { }, @_) },
542             sub { 136; my $client = shift; _translated_reply($client, undef, { }, @_) },
543             sub { 137; my $client = shift; _translated_reply($client, undef, { }, @_) },
544             sub { 138; my $client = shift; _translated_reply($client, undef, { }, @_) },
545             sub { 139; my $client = shift; _translated_reply($client, undef, { }, @_) },
546             sub { 140; my $client = shift; _translated_reply($client, undef, { }, @_) },
547             sub { 141; my $client = shift; _translated_reply($client, undef, { secret => \&_translate_remote_nonnull_secret }, @_) },
548             sub { 142; my $client = shift; _translated_reply($client, undef, { secret => \&_translate_remote_nonnull_secret }, @_) },
549             sub { 143; my $client = shift; _translated_reply($client, undef, { }, @_) },
550             \&_no_translation,
551             sub { 145; my $client = shift; _translated_reply($client, undef, { }, @_) },
552             \&_no_translation,
553             sub { 147; my $client = shift; _translated_reply($client, undef, { secret => \&_translate_remote_nonnull_secret }, @_) },
554             \&_no_translation,
555             \&_no_translation,
556             sub { 150; my $client = shift; _translated_reply($client, undef, { }, @_) },
557             sub { 151; my $client = shift; _translated_reply($client, undef, { }, @_) },
558             sub { 152; my $client = shift; _translated_reply($client, undef, { }, @_) },
559             sub { 153; my $client = shift; _translated_reply($client, undef, { }, @_) },
560             sub { 154; my $client = shift; _translated_reply($client, undef, { }, @_) },
561             sub { 155; my $client = shift; _translated_reply($client, undef, { }, @_) },
562             sub { 156; my $client = shift; _translated_reply($client, undef, { }, @_) },
563             sub { 157; my $client = shift; _translated_reply($client, undef, { }, @_) },
564             sub { 158; my $client = shift; _translated_reply($client, undef, { }, @_) },
565             sub { 159; my $client = shift; _translated_reply($client, undef, { }, @_) },
566             \&_no_translation,
567             \&_no_translation,
568             sub { 162; my $client = shift; _translated_reply($client, undef, { }, @_) },
569             \&_no_translation,
570             \&_no_translation,
571             \&_no_translation,
572             \&_no_translation,
573             \&_no_translation,
574             \&_no_translation,
575             sub { 169; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
576             sub { 170; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
577             sub { 171; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
578             sub { 172; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
579             sub { 173; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
580             \&_no_translation,
581             sub { 175; my $client = shift; _translated_reply($client, undef, { nwfilter => \&_translate_remote_nonnull_nwfilter }, @_) },
582             sub { 176; my $client = shift; _translated_reply($client, undef, { nwfilter => \&_translate_remote_nonnull_nwfilter }, @_) },
583             sub { 177; my $client = shift; _translated_reply($client, undef, { }, @_) },
584             sub { 178; my $client = shift; _translated_reply($client, undef, { }, @_) },
585             sub { 179; my $client = shift; _translated_reply($client, undef, { }, @_) },
586             sub { 180; my $client = shift; _translated_reply($client, undef, { nwfilter => \&_translate_remote_nonnull_nwfilter }, @_) },
587             \&_no_translation,
588             \&_no_translation,
589             sub { 183; my $client = shift; _translated_reply($client, undef, { }, @_) },
590             \&_no_translation,
591             sub { 185; my $client = shift; _translated_reply($client, undef, { snap => \&_translate_remote_nonnull_domain_snapshot }, @_) },
592             sub { 186; my $client = shift; _translated_reply($client, undef, { }, @_) },
593             sub { 187; my $client = shift; _translated_reply($client, undef, { }, @_) },
594             sub { 188; my $client = shift; _translated_reply($client, undef, { }, @_) },
595             sub { 189; my $client = shift; _translated_reply($client, undef, { snap => \&_translate_remote_nonnull_domain_snapshot }, @_) },
596             sub { 190; my $client = shift; _translated_reply($client, undef, { }, @_) },
597             sub { 191; my $client = shift; _translated_reply($client, undef, { snap => \&_translate_remote_nonnull_domain_snapshot }, @_) },
598             \&_no_translation,
599             \&_no_translation,
600             \&_no_translation,
601             sub { 195; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
602             sub { 196; my $client = shift; _translated_reply($client, undef, { dom => \&_translate_remote_nonnull_domain }, @_) },
603             \&_no_translation,
604             sub { 198; my $client = shift; _translated_reply($client, undef, { }, @_) },
605             \&_no_translation,
606             sub { 200; my $client = shift; _translated_reply($client, undef, { }, @_) },
607             \&_no_translation,
608             sub { 202; my $client = shift; _translated_reply($client, undef, { }, @_) },
609             sub { 203; my $client = shift; _translated_reply($client, undef, { }, @_) },
610             \&_no_translation,
611             \&_no_translation,
612             sub { 206; my $client = shift; _translated_reply($client, undef, { }, @_) },
613             \&_no_translation,
614             \&_no_translation,
615             \&_no_translation,
616             \&_no_translation,
617             sub { 211; my $client = shift; _translated_reply($client, undef, { }, @_) },
618             \&_no_translation,
619             \&_no_translation,
620             \&_no_translation,
621             \&_no_translation,
622             \&_no_translation,
623             \&_no_translation,
624             \&_no_translation,
625             \&_no_translation,
626             \&_no_translation,
627             \&_no_translation,
628             \&_no_translation,
629             sub { 223; my $client = shift; _translated_reply($client, undef, { }, @_) },
630             undef,
631             \&_no_translation,
632             \&_no_translation,
633             sub { 227; my $client = shift; _translated_reply($client, undef, { }, @_) },
634             sub { 228; my $client = shift; _translated_reply($client, undef, { }, @_) },
635             \&_no_translation,
636             \&_no_translation,
637             \&_no_translation,
638             \&_no_translation,
639             \&_no_translation,
640             \&_no_translation,
641             sub { 235; my $client = shift; _translated_reply($client, undef, { }, @_) },
642             \&_no_translation,
643             \&_no_translation,
644             \&_no_translation,
645             \&_no_translation,
646             \&_no_translation,
647             undef,
648             sub { 242; my $client = shift; _translated_reply($client, undef, { }, @_) },
649             sub { 243; my $client = shift; _translated_reply($client, undef, { }, @_) },
650             sub { 244; my $client = shift; _translated_reply($client, undef, { snap => \&_translate_remote_nonnull_domain_snapshot }, @_) },
651             \&_no_translation,
652             sub { 246; my $client = shift; _translated_reply($client, undef, { }, @_) },
653             sub { 247; my $client = shift; _translated_reply($client, undef, { }, @_) },
654             undef,
655             \&_no_translation,
656             \&_no_translation,
657             \&_no_translation,
658             \&_no_translation,
659             sub { 253; my $client = shift; _translated_reply($client, undef, { }, @_) },
660             \&_no_translation,
661             sub { 255; my $client = shift; _translated_reply($client, undef, { }, @_) },
662             \&_no_translation,
663             sub { 257; my $client = shift; _translated_reply($client, undef, { }, @_) },
664             \&_no_translation,
665             \&_no_translation,
666             \&_no_translation,
667             \&_no_translation,
668             sub { 262; my $client = shift; _translated_reply($client, undef, { }, @_) },
669             sub { 263; my $client = shift; _translated_reply($client, undef, { }, @_) },
670             \&_no_translation,
671             sub { 265; my $client = shift; _translated_reply($client, undef, { }, @_) },
672             \&_no_translation,
673             \&_no_translation,
674             sub { 268; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
675             sub { 269; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
676             sub { 270; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
677             sub { 271; my $client = shift; _translated_reply($client, undef, { }, @_) },
678             sub { 272; my $client = shift; _translated_reply($client, undef, { }, @_) },
679             sub { 273; my $client = shift; _translated_reply($client, undef, { domains => \&_translate_remote_nonnull_domain }, @_) },
680             sub { 274; my $client = shift; _translated_reply($client, undef, { snapshots => \&_translate_remote_nonnull_domain_snapshot }, @_) },
681             sub { 275; my $client = shift; _translated_reply($client, undef, { snapshots => \&_translate_remote_nonnull_domain_snapshot }, @_) },
682             sub { 276; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
683             sub { 277; my $client = shift; _translated_reply($client, undef, { }, @_) },
684             \&_no_translation,
685             \&_no_translation,
686             \&_no_translation,
687             sub { 281; my $client = shift; _translated_reply($client, undef, { pools => \&_translate_remote_nonnull_storage_pool }, @_) },
688             sub { 282; my $client = shift; _translated_reply($client, undef, { vols => \&_translate_remote_nonnull_storage_vol }, @_) },
689             sub { 283; my $client = shift; _translated_reply($client, undef, { nets => \&_translate_remote_nonnull_network }, @_) },
690             sub { 284; my $client = shift; _translated_reply($client, undef, { ifaces => \&_translate_remote_nonnull_interface }, @_) },
691             sub { 285; my $client = shift; _translated_reply($client, undef, { devices => \&_translate_remote_nonnull_node_device }, @_) },
692             sub { 286; my $client = shift; _translated_reply($client, undef, { filters => \&_translate_remote_nonnull_nwfilter }, @_) },
693             sub { 287; my $client = shift; _translated_reply($client, undef, { secrets => \&_translate_remote_nonnull_secret }, @_) },
694             \&_no_translation,
695             sub { 289; my $client = shift; _translated_reply($client, undef, { }, @_) },
696             \&_no_translation,
697             \&_no_translation,
698             sub { 292; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
699             \&_no_translation,
700             \&_no_translation,
701             \&_no_translation,
702             \&_no_translation,
703             sub { 297; my $client = shift; _translated_reply($client, undef, { dev => \&_translate_remote_nonnull_node_device }, @_) },
704             \&_no_translation,
705             sub { 299; my $client = shift; _translated_reply($client, undef, { }, @_) },
706             \&_no_translation,
707             \&_no_translation,
708             \&_no_translation,
709             \&_no_translation,
710             \&_no_translation,
711             \&_no_translation,
712             \&_no_translation,
713             \&_no_translation,
714             \&_no_translation,
715             \&_no_translation,
716             \&_no_translation,
717             sub { 311; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
718             sub { 312; my $client = shift; _translated_reply($client, undef, { }, @_) },
719             \&_no_translation,
720             \&_no_translation,
721             sub { 315; my $client = shift; _translated_msg($client, { net => \&_translate_remote_nonnull_network }, @_) },
722             \&_no_translation,
723             \&_no_translation,
724             sub { 318; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
725             sub { 319; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
726             sub { 320; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
727             sub { 321; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
728             sub { 322; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
729             sub { 323; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
730             sub { 324; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
731             sub { 325; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
732             sub { 326; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
733             sub { 327; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
734             sub { 328; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
735             sub { 329; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
736             sub { 330; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
737             sub { 331; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
738             sub { 332; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
739             sub { 333; my $client = shift; _translated_msg($client, { msg => { dom => \&_translate_remote_nonnull_domain } }, @_) },
740             \&_no_translation,
741             sub { 335; my $client = shift; _translated_reply($client, undef, { }, @_) },
742             sub { 336; my $client = shift; _translated_reply($client, undef, { }, @_) },
743             \&_no_translation,
744             \&_no_translation,
745             undef,
746             \&_no_translation,
747             sub { 341; my $client = shift; _translated_reply($client, undef, { }, @_) },
748             sub { 342; my $client = shift; _translated_reply($client, undef, { }, @_) },
749             \&_no_translation,
750             sub { 344; my $client = shift; _translated_reply($client, undef, { }, @_) },
751             \&_no_translation,
752             sub { 346; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
753             \&_no_translation,
754             sub { 348; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
755             sub { 349; my $client = shift; _translated_reply($client, undef, { }, @_) },
756             sub { 350; my $client = shift; _translated_reply($client, undef, { dom => \&_translate_remote_nonnull_domain }, @_) },
757             \&_no_translation,
758             \&_no_translation,
759             sub { 353; my $client = shift; _translated_reply($client, undef, { }, @_) },
760             sub { 354; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
761             \&_no_translation,
762             \&_no_translation,
763             \&_no_translation,
764             sub { 358; my $client = shift; _translated_reply($client, undef, { }, @_) },
765             sub { 359; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
766             \&_no_translation,
767             \&_no_translation,
768             undef,
769             sub { 363; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
770             \&_no_translation,
771             sub { 365; my $client = shift; _translated_reply($client, undef, { }, @_) },
772             \&_no_translation,
773             sub { 367; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
774             \&_no_translation,
775             \&_no_translation,
776             sub { 370; my $client = shift; _translated_msg($client, { pool => \&_translate_remote_nonnull_storage_pool }, @_) },
777             sub { 371; my $client = shift; _translated_reply($client, undef, { }, @_) },
778             \&_no_translation,
779             sub { 373; my $client = shift; _translated_msg($client, { pool => \&_translate_remote_nonnull_storage_pool }, @_) },
780             \&_no_translation,
781             \&_no_translation,
782             sub { 376; my $client = shift; _translated_msg($client, { dev => \&_translate_remote_nonnull_node_device }, @_) },
783             sub { 377; my $client = shift; _translated_msg($client, { dev => \&_translate_remote_nonnull_node_device }, @_) },
784             \&_no_translation,
785             sub { 379; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
786             \&_no_translation,
787             \&_no_translation,
788             sub { 382; my $client = shift; _translated_msg($client, { secret => \&_translate_remote_nonnull_secret }, @_) },
789             sub { 383; my $client = shift; _translated_msg($client, { secret => \&_translate_remote_nonnull_secret }, @_) },
790             \&_no_translation,
791             sub { 385; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
792             \&_no_translation,
793             sub { 387; my $client = shift; _translated_reply($client, undef, { }, @_) },
794             sub { 388; my $client = shift; _translated_reply($client, undef, { }, @_) },
795             \&_no_translation,
796             \&_no_translation,
797             sub { 391; my $client = shift; _translated_reply($client, undef, { pool => \&_translate_remote_nonnull_storage_pool }, @_) },
798             \&_no_translation,
799             sub { 393; my $client = shift; _translated_reply($client, undef, { }, @_) },
800             sub { 394; my $client = shift; _translated_reply($client, undef, { }, @_) },
801             sub { 395; my $client = shift; _translated_reply($client, undef, { }, @_) },
802             sub { 396; my $client = shift; _translated_reply($client, undef, { }, @_) },
803             sub { 397; my $client = shift; _translated_reply($client, undef, { nwfilter => \&_translate_remote_nonnull_nwfilter_binding }, @_) },
804             sub { 398; my $client = shift; _translated_reply($client, undef, { }, @_) },
805             sub { 399; my $client = shift; _translated_reply($client, undef, { nwfilter => \&_translate_remote_nonnull_nwfilter_binding }, @_) },
806             \&_no_translation,
807             sub { 401; my $client = shift; _translated_reply($client, undef, { bindings => \&_translate_remote_nonnull_nwfilter_binding }, @_) },
808             \&_no_translation,
809             sub { 403; my $client = shift; _translated_reply($client, undef, { }, @_) },
810             sub { 404; my $client = shift; _translated_reply($client, undef, { ports => \&_translate_remote_nonnull_network_port }, @_) },
811             sub { 405; my $client = shift; _translated_reply($client, undef, { port => \&_translate_remote_nonnull_network_port }, @_) },
812             sub { 406; my $client = shift; _translated_reply($client, undef, { port => \&_translate_remote_nonnull_network_port }, @_) },
813             sub { 407; my $client = shift; _translated_reply($client, undef, { }, @_) },
814             \&_no_translation,
815             sub { 409; my $client = shift; _translated_reply($client, undef, { }, @_) },
816             \&_no_translation,
817             sub { 411; my $client = shift; _translated_reply($client, undef, { checkpoint => \&_translate_remote_nonnull_domain_checkpoint }, @_) },
818             sub { 412; my $client = shift; _translated_reply($client, undef, { }, @_) },
819             sub { 413; my $client = shift; _translated_reply($client, undef, { checkpoints => \&_translate_remote_nonnull_domain_checkpoint }, @_) },
820             sub { 414; my $client = shift; _translated_reply($client, undef, { checkpoints => \&_translate_remote_nonnull_domain_checkpoint }, @_) },
821             sub { 415; my $client = shift; _translated_reply($client, undef, { checkpoint => \&_translate_remote_nonnull_domain_checkpoint }, @_) },
822             sub { 416; my $client = shift; _translated_reply($client, undef, { parent => \&_translate_remote_nonnull_domain_checkpoint }, @_) },
823             \&_no_translation,
824             sub { 418; my $client = shift; _translated_reply($client, undef, { }, @_) },
825             \&_no_translation,
826             sub { 420; my $client = shift; _translated_reply($client, undef, { }, @_) },
827             \&_no_translation,
828             sub { 422; my $client = shift; _translated_reply($client, undef, { }, @_) },
829             sub { 423; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
830             sub { 424; my $client = shift; _translated_reply($client, undef, { }, @_) },
831             \&_no_translation,
832             sub { 426; my $client = shift; _translated_reply($client, undef, { }, @_) },
833             \&_no_translation,
834             sub { 428; my $client = shift; _translated_reply($client, undef, { dev => \&_translate_remote_nonnull_node_device }, @_) },
835             \&_no_translation,
836             \&_no_translation,
837             sub { 431; my $client = shift; _translated_reply($client, undef, { nwfilter => \&_translate_remote_nonnull_nwfilter }, @_) },
838             sub { 432; my $client = shift; _translated_reply($client, undef, { net => \&_translate_remote_nonnull_network }, @_) },
839             sub { 433; my $client = shift; _translated_reply($client, undef, { }, @_) },
840             \&_no_translation,
841             sub { 435; my $client = shift; _translated_reply($client, undef, { }, @_) },
842             sub { 436; my $client = shift; _translated_reply($client, undef, { }, @_) },
843             sub { 437; my $client = shift; _translated_reply($client, undef, { net => \&_translate_remote_nonnull_network }, @_) },
844             sub { 438; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) },
845             \&_no_translation,
846             \&_no_translation,
847             \&_no_translation,
848             \&_no_translation,
849             \&_no_translation,
850             \&_no_translation,
851             sub { 445; my $client = shift; _translated_reply($client, undef, { }, @_) },
852             sub { 446; my $client = shift; _translated_msg($client, { net => \&_translate_remote_nonnull_network }, @_) },
853             \&_no_translation,
854             \&_no_translation,
855             sub { 449; my $client = shift; _translated_reply($client, undef, { }, @_) },
856             \&_no_translation,
857             \&_no_translation,
858             \&_no_translation,
859             sub { 453; my $client = shift; _translated_msg($client, { dom => \&_translate_remote_nonnull_domain }, @_) }
860             );
861              
862 0     0     sub _map( $client, $unwrap, $argmap, $data) {
  0            
  0            
  0            
  0            
  0            
863 0           for my $key (keys $argmap->%*) {
864 0           my $val = $data->{$key};
865              
866 0 0 0       if (ref $argmap->{$key} and reftype $argmap->{$key} eq 'HASH') {
    0 0        
867 0           $data->{$key} = _map( $client, undef, $argmap->{$key}, $val );
868             }
869             elsif (ref $val and reftype $val eq 'ARRAY') {
870             $data->{$key} = [
871 0           map { $argmap->{$key}->( $client, $_ ) } $val->@* ];
  0            
872             }
873             else {
874 0           $data->{$key} = $argmap->{$key}->( $client, $val );
875             }
876             }
877              
878 0           return $data;
879             }
880              
881 0     0     sub _translated_msg($client, $argsmap, %args) {
  0            
  0            
  0            
  0            
882 0 0         return (%args, ) unless $args{data};
883 0           my $data = _map($client, undef, $argsmap, $args{data});
884 0           my $msg = delete $data->{msg};
885 0           delete $data->{callbackID};
886 0 0         if ($msg) {
887             $args{data} = {
888 0           $data->%*, $msg->%*
889             };
890             }
891 0           return (%args, );
892             }
893              
894 0     0     sub _translated_reply($client, $unwrap, $argmap, %args) {
  0            
  0            
  0            
  0            
  0            
895 0 0         return (%args, ) unless $args{data};
896 0           my $data = $args{data};
897 0           $args{data} = _map($client, $unwrap, $argmap, $data);
898 0 0         if ($unwrap) {
899 0           $args{data} = $args{data}->{$unwrap};
900             }
901 0           return (%args, );
902             }
903              
904             sub _domain_factory {
905 0     0     return Sys::Async::Virt::Domain->new( @_ );
906             }
907              
908             sub _domain_checkpoint_factory {
909 0     0     return Sys::Async::Virt::DomainCheckpoint->new( @_ );
910             }
911              
912             sub _domain_snapshot_factory {
913 0     0     return Sys::Async::Virt::DomainSnapshot->new( @_ );
914             }
915              
916             sub _network_factory {
917 0     0     return Sys::Async::Virt::Network->new( @_ );
918             }
919              
920             sub _network_port_factory {
921 0     0     return Sys::Async::Virt::NetworkPort->new( @_ );
922             }
923              
924             sub _nwfilter_factory {
925 0     0     return Sys::Async::Virt::NwFilter->new( @_ );
926             }
927              
928             sub _nwfilter_binding_factory {
929 0     0     return Sys::Async::Virt::NwFilterBinding->new( @_ );
930             }
931              
932             sub _interface_factory {
933 0     0     return Sys::Async::Virt::Interface->new( @_ );
934             }
935              
936             sub _storage_pool_factory {
937 0     0     return Sys::Async::Virt::StoragePool->new( @_ );
938             }
939              
940             sub _storage_vol_factory {
941 0     0     return Sys::Async::Virt::StorageVol->new( @_ );
942             }
943              
944             sub _node_device_factory {
945 0     0     return Sys::Async::Virt::NodeDevice->new( @_ );
946             }
947              
948             sub _secret_factory {
949 0     0     return Sys::Async::Virt::Secret->new( @_ );
950             }
951              
952 0     0     method _domain_instance($id) {
  0            
  0            
  0            
953             # Use $id->{id} as part of the cache key so we return a different domain
954             # instance between the cases where the server includes an 'id' and where
955             # it does not, such as:
956             # my ($off_dom) = $virt->list_all_domains->@*;
957             # my $on_dom = $off_dom->create;
958             #
959             # Here, $off_dom does not have an 'id' value. $on_dom has been assigned
960             # an 'id' because it's running.
961 0   0       my $dom_id = $id->{id} // '';
962 0           my $key = "$dom_id/$id->{uuid}";
963 0           my $c = $_domains->{$key};
964 0 0         unless ($c) {
965 0           $c = $_domains->{$key} = _domain_factory(
966             client => $self,
967             remote => $_remote,
968             rpc_id => $id );
969 0           weaken $_domains->{$key};
970             }
971 0           return $c;
972             }
973              
974 0     0     method _domain_checkpoint_instance($id) {
  0            
  0            
  0            
975 0           my $key = "$id->{dom}->{uuid}/$id->{name}";
976 0           my $c = $_domain_checkpoints->{$key};
977 0 0         unless ($c) {
978 0           $c = $_domain_checkpoints->{$key} =
979             _domain_checkpoint_factory(
980             client => $self,
981             remote => $_remote,
982             rpc_id => $id );
983 0           weaken $_domain_checkpoints->{$key};
984             }
985 0           return $c;
986             }
987              
988 0     0     method _domain_snapshot_instance($id) {
  0            
  0            
  0            
989 0           my $key = "$id->{dom}->{uuid}/$id->{name}";
990 0           my $c = $_domain_snapshots->{$id->{uuid}};
991 0 0         unless ($c) {
992             $c = $_domain_snapshots->{$id->{uuid}} =
993 0           _domain_snapshot_factory(
994             client => $self,
995             remote => $_remote,
996             rpc_id => $id );
997 0           weaken $_domain_snapshots->{$id->{uuid}};
998             }
999 0           return $c;
1000             }
1001              
1002 0     0     method _network_instance($id) {
  0            
  0            
  0            
1003 0           my $c = $_networks->{$id->{uuid}};
1004 0 0         unless ($c) {
1005             $c = $_networks->{$id->{uuid}} =
1006 0           _network_factory(
1007             client => $self,
1008             remote => $_remote,
1009             rpc_id => $id );
1010 0           weaken $_networks->{$id->{uuid}};
1011             }
1012 0           return $c;
1013             }
1014              
1015 0     0     method _network_port_instance($id) {
  0            
  0            
  0            
1016 0           my $c = $_network_ports->{$id->{uuid}};
1017 0 0         unless ($c) {
1018             $c = $_network_ports->{$id->{uuid}} =
1019 0           _network_port_factory(
1020             client => $self,
1021             remote => $_remote,
1022             rpc_id => $id );
1023 0           weaken $_network_ports->{$id->{uuid}};
1024             }
1025 0           return $c;
1026             }
1027              
1028 0     0     method _nwfilter_instance($id) {
  0            
  0            
  0            
1029 0           my $c = $_nwfilters->{$id->{uuid}};
1030 0 0         unless ($c) {
1031             $c = $_nwfilters->{$id->{uuid}} =
1032 0           _nwfilter_factory(
1033             client => $self,
1034             remote => $_remote,
1035             rpc_id => $id );
1036 0           weaken $_nwfilters->{$id->{uuid}};
1037             }
1038 0           return $c;
1039             }
1040              
1041 0     0     method _nwfilter_binding_instance($id) {
  0            
  0            
  0            
1042 0           my $key = "$id->{portdev}/$id->{filtername}";
1043 0           my $c = $_nwfilter_bindings->{$key};
1044 0 0         unless ($c) {
1045 0           $c = $_nwfilter_bindings->{$key} =
1046             _nwfilter_binding_factory(
1047             client => $self,
1048             remote => $_remote,
1049             rpc_id => $id );
1050 0           weaken $_nwfilter_bindings->{$key};
1051             }
1052 0           return $c;
1053             }
1054              
1055 0     0     method _interface_instance($id) {
  0            
  0            
  0            
1056 0           my $key = "$id->{mac}/$id->{name}";
1057 0           my $c = $_interfaces->{$key};
1058 0 0         unless ($c) {
1059 0           $c = $_interfaces->{$key} =
1060             _interface_factory(
1061             client => $self,
1062             remote => $_remote,
1063             rpc_id => $id );
1064 0           weaken $_interfaces->{$key};
1065             }
1066 0           return $c;
1067             }
1068              
1069 0     0     method _storage_pool_instance($id) {
  0            
  0            
  0            
1070 0           my $c = $_storage_pools->{$id->{uuid}};
1071 0 0         unless ($c) {
1072             $c = $_storage_pools->{$id->{uuid}} =
1073 0           _storage_pool_factory(
1074             client => $self,
1075             remote => $_remote,
1076             rpc_id => $id );
1077 0           weaken $_storage_pools->{$id->{uuid}};
1078             }
1079 0           return $c;
1080             }
1081              
1082 0     0     method _storage_vol_instance($id) {
  0            
  0            
  0            
1083 0           my $c = $_storage_vols->{$id->{key}};
1084 0 0         unless ($c) {
1085             $c = $_storage_vols->{$id->{key}} =
1086 0           _storage_vol_factory(
1087             client => $self,
1088             remote => $_remote,
1089             rpc_id => $id );
1090 0           weaken $_storage_vols->{$id->{key}};
1091             }
1092 0           return $c;
1093             }
1094              
1095 0     0     method _node_device_instance($id) {
  0            
  0            
  0            
1096 0           my $c = $_node_devices->{$id->{name}};
1097 0 0         unless ($c) {
1098             $c = $_node_devices->{$id->{name}} =
1099 0           _node_device_factory(
1100             client => $self,
1101             remote => $_remote,
1102             rpc_id => $id );
1103 0           weaken $_node_devices->{$id->{name}};
1104             }
1105 0           return $c;
1106             }
1107              
1108 0     0     method _secret_instance($id) {
  0            
  0            
  0            
1109 0           my $c = $_secrets->{$id->{uuid}};
1110 0 0         unless ($c) {
1111             $c = $_secrets->{$id->{uuid}} =
1112 0           _secret_factory(
1113             client => $self,
1114             remote => $_remote,
1115             rpc_id => $id );
1116 0           weaken $_secrets->{$id->{uuid}};
1117             }
1118 0           return $c;
1119             }
1120              
1121 0     0     async method _call($proc, $args = {}, :$unwrap = '', :$stream = '', :$empty = '') {
  0            
  0            
  0            
  0            
  0            
  0            
1122 0 0         die $log->fatal( "RPC call without remote connection (proc: $proc)" )
1123             unless $self->is_connected;
1124 0           my $serial = await $_remote->call( $proc, $args );
1125 0           my $f = Future->new;
1126 0           $log->trace( "Setting serial $serial future (proc: $proc)" );
1127 0           $_replies->{$serial} = $f;
1128 0           $_selector->add(
1129             data => 'reply',
1130             f => $f
1131             );
1132             ### Return a stream somehow...
1133 0           my @rv = await $f;
1134 0 0         $rv[0] = $rv[0]->{$unwrap} if $unwrap;
1135 0 0         shift @rv if $empty;
1136 0 0         if ($stream) {
1137 0 0         my $s = Sys::Async::Virt::Stream->new(
1138             rpc_id => $serial,
1139             proc => $proc,
1140             client => $self,
1141             direction => ($stream eq 'write' ? 'send' : 'receive'),
1142             );
1143 0           $_streams->{$serial} = $s;
1144 0           weaken $_streams->{$serial};
1145              
1146 0           push @rv, $s;
1147             }
1148              
1149 0           return @rv;
1150             }
1151              
1152 0     0     async method _from_cpumap($cpumap, $offset = 0) {
  0            
  0            
  0            
  0            
  0            
1153 0           my $cpus = await $self->_cpus;
1154 0           return [ map { vec( $cpumap, $offset+$_, 1 ) } 0 .. ($cpus - 1) ];
  0            
1155             }
1156              
1157 0     0     async method _to_cpumap($cpuarray) {
  0            
  0            
  0            
  0            
1158 0           my $maplen = await $self->_maplen;
1159 0           my $map = "\0" x $maplen;
1160             vec( $map, $cpuarray->[$_] ? 1 : 0, 1 )
1161 0 0         for ( 0 .. scalar($cpuarray->@*) );
1162              
1163 0           return $map
1164             }
1165              
1166 0     0     async method _cpus() {
  0            
  0            
  0            
1167 0 0         return $_cpus if $_cpus;
1168              
1169 0           await $self->get_cpu_map;
1170 0           return $_cpus;
1171             }
1172              
1173 0     0     async method _maplen() {
  0            
  0            
  0            
1174 0 0         return $_maplen if $_maplen;
1175              
1176 0           await $self->get_cpu_map;
1177 0           return $_maplen;
1178             }
1179              
1180 0     0     async method _send($proc, $serial, :$data = undef, :$hole = undef, %rest) {
  0            
  0            
  0            
  0            
  0            
  0            
1181 0           await $_remote->stream(
1182             $proc, $serial,
1183             data => $data,
1184             hole => $hole);
1185             }
1186              
1187 0     0     async method _typed_param_string_okay() {
  0            
  0            
  0            
1188 0 0 0       return $_typed_param_string_okay //=
1189             ((await $self->_supports_feature(
1190             $_remote->DRV_FEATURE_TYPED_PARAM_STRING ))
1191             ? $self->TYPED_PARAM_STRING_OKAY : 0);
1192             }
1193              
1194 0     0     async method _filter_typed_param_string($params) {
  0            
  0            
  0            
  0            
1195             return await $self->_typed_param_string_okay
1196             ? $params
1197             : [ grep {
1198 0           $params->{value}->{type} != $remote->VIR_TYPED_PARAM_STRING
1199             } @$params ];
1200             }
1201              
1202 0     0     method _dispatch_closed(@args) {
  0            
  0            
  0            
1203 0           $_on_close->( $self, @args );
1204              
1205             # dispatch only once, on first-come-first-serve basis:
1206 0     0     $_on_close = sub { };
1207             }
1208              
1209 0     0     method _dispatch_message(:$data = undef, :$header = undef, %args) {
  0            
  0            
  0            
1210 0 0         if ($_keepalive) {
1211 0           $_keepalive->mark_active;
1212             }
1213 0 0 0       if ($data
      0        
1214             and defined $data->{callbackID}
1215             and my $cb = $_callbacks->{$data->{callbackID}}) {
1216              
1217 0           my %cbargs = $reply_translators[$header->{proc}]->(
1218             $self, data => $data, header => $header, %args
1219             );
1220 0           return $cb->_dispatch_event($cbargs{data});
1221             }
1222             else {
1223 0           my %cbargs = $reply_translators[$header->{proc}]->( $self, %args );
1224 0           return $_on_message->( $cbargs{data} );
1225             }
1226             }
1227              
1228 0     0     method _dispatch_reply(:$header, %args) {
  0            
  0            
  0            
1229 0           $log->trace( "Dispatching serial $header->{serial} / $header->{proc}" );
1230 0 0         if ($_keepalive) {
1231 0           $_keepalive->mark_active;
1232             }
1233 0           my $f = delete $_replies->{$header->{serial}};
1234              
1235 0 0         if (exists $args{data}) {
    0          
1236 0           my %cbargs = $reply_translators[$header->{proc}]->( $self, header => $header, %args );
1237 0           $f->done( $cbargs{data} );
1238             }
1239             elsif (exists $args{error}) {
1240 0           $f->fail( $args{error}->{message}, undef, $args{error} );
1241             }
1242             else {
1243 0           die 'Unhandled reply';
1244             }
1245              
1246 0           $log->trace( "Dispatching serial $header->{serial} done" );
1247 0           return $f;
1248             }
1249              
1250 0     0     method _dispatch_stream(:$header, %args) {
  0            
  0            
  0            
1251 0 0         if ($_keepalive) {
1252 0           $_keepalive->mark_active;
1253             }
1254              
1255 0 0         if (my $stream = $_streams->{$header->{serial}}) {
1256 0 0         if ($args{error}) {
1257 0           return $stream->_dispatch_error($args{error});
1258             }
1259             else {
1260 0           return $stream->_dispatch_receive($args{data}, $args{hole}, $args{eof}, $args{final});
1261             }
1262             }
1263             else {
1264 0           return $_on_stream->( $self, header => $header, %args );
1265             }
1266             }
1267              
1268 0     0 1   method configure(%args) {
  0            
  0            
  0            
1269 0           for my $key (keys %args) {
1270 0   0 0     $self->{$key} = $args{$key} // sub {};
1271             }
1272             }
1273              
1274 0     0 1   method register($r) {
  0            
  0            
  0            
1275             $r->configure(
1276 0     0     on_closed => sub { $self->_dispatch_closed( @_ ) },
1277 0     0     on_message => sub { $self->_dispatch_message( @_ ) },
1278 0     0     on_reply => sub { $self->_dispatch_reply( @_ ) },
1279 0     0     on_stream => sub { $self->_dispatch_stream( @_ ) }
  0            
1280             );
1281 0           $_remote = $r;
1282             }
1283              
1284 0     0 1   async method run_once() {
  0            
  0            
  0            
1285 0 0         return if $_eof;
1286 0           my ($len, $type) = $_transport->need;
1287 0           $log->trace( 'Reading data from connection' );
1288              
1289             ###BUG: what if $type == 'fd' and we have sasl encodng??
1290 0           my ($data, $eof);
1291 0 0         if ($_sasl_session) {
1292 0           my $buf;
1293 0           ($buf, $eof) = await $_connection->read( 'data', 4 );
1294              
1295 0 0         return (undef, $eof) if $eof;
1296              
1297 0           my $sasl_len = unpack( 'L>', $buf );
1298 0           ($buf, $eof) = await $_connection->read( 'data', $sasl_len );
1299              
1300 0 0         return (undef, $eof) if $eof;
1301              
1302 0           return ( $_sasl_session->decode( $buf, $sasl_len ), $eof );
1303             }
1304              
1305             # closing the connection will kill the 'read' action
1306 0           ($data, $eof) = await $_connection->read( $type, $len );
1307 0           $log->trace( 'Reading data from connection: completed' );
1308              
1309 0           return ($data, $eof);
1310             }
1311              
1312 0     0     method _deregister_callback($f, $proc, $id) {
  0            
  0            
  0            
  0            
  0            
1313 0           delete $_callbacks->{$id};
1314 0           my $r = $self->_call( $proc, { callbackID => $id } );
1315 0 0         $r->on_ready( $f ) if $f;
1316              
1317 0           $_selector->add(
1318             data => 'callback',
1319             f => $r
1320             );
1321 0           return;
1322             }
1323              
1324 0     0     method _send_finish($proc, $serial, $abort) {
  0            
  0            
  0            
  0            
  0            
1325 0           my $r = $_remote->stream_end($proc, $serial, $abort);
1326             # streams send a final "OK" message; we should be awaiting that
1327             # instead of declaring the future $f done here
1328              
1329 0           $_selector->add(
1330             data => 'stream',
1331             f => $r
1332             );
1333 0           return;
1334             }
1335              
1336 0     0 1   async method initialize() {
  0            
  0            
  0            
1337 0 0         return unless $_state == _STATE_NONE;
1338 0           $_state = _STATE_INITIALIZING;
1339              
1340 0 0         unless ($_connection) {
1341 0   0       $_factory //= Sys::Async::Virt::Connection::Factory->new;
1342 0           $_connection = $_factory->create_connection( $_url,
1343             readonly => $_readonly );
1344             }
1345              
1346 0 0         unless ($_transport) {
1347 0           $_transport = Protocol::Sys::Virt::Transport->new(
1348             role => 'client',
1349 0     0     on_send => async sub($opaque, @data) {
  0            
  0            
  0            
1350 0 0         if ($_sasl_session) {
1351 0           my $bufsize = $_sasl_session->property('maxbuf');
1352 0           my $buf = join( '', @data );
1353 0           my $idx = 0;
1354 0           my $len = length $buf;
1355 0           while ($len > 0) {
1356 0           my $enc =
1357             $_sasl_session->encode( substr( $buf, $idx, $bufsize ) );
1358 0           await $_connection->write( pack('L>', length($enc)), $enc );
1359 0           $len -= $bufsize;
1360 0           $idx += $bufsize;
1361             }
1362             }
1363             else {
1364 0           await $_connection->write( @data );
1365             }
1366 0           return $opaque;
1367 0           });
1368             }
1369              
1370 0   0       $_remote //= Protocol::Sys::Virt::Remote->new( role => 'client' );
1371 0           $_remote->register( $_transport );
1372 0           $self->register( $_remote );
1373              
1374 0 0         unless ($_connection->connected) {
1375             await Future->wait_any(
1376             $_connection->connect,
1377             Future::IO->sleep( 60 )
1378 0     0     ->then(sub { Future->fail('timeout') })
  0            
1379             );
1380             }
1381 0           $log->trace( "Connected" );
1382 0           $_selector->add( data => undef, f => $self->_dispatch_loop );
1383 0           $_state = _STATE_INITIALIZED;
1384             }
1385              
1386 0     0     async method _dispatch_loop() {
  0            
  0            
  0            
1387 0           while (not $_completed_f->is_ready) {
1388 0           my ($data, $eof) = do {
1389 0           try {
1390 0           await $self->run_once;
1391             }
1392             catch ($e) {
1393             # closing the server stream here doesn't make sense:
1394             # throwing this exception will kill the loop, which
1395             # means we can't process further server frames
1396 0           die $e;
1397             }
1398             };
1399              
1400              
1401             # submit $data to $_transport, allowing $transport to raise an error
1402             # if the stream is terminated early.
1403             #
1404             # $_transport->receive() may return a list of futures to be awaited.
1405 0 0         if (my @dispatch_values = $_transport->receive($data)) {
1406 0           await Future->wait_all( @dispatch_values );
1407 0           $log->trace( 'Processed input data from connection' );
1408             }
1409 0 0         if ($eof) {
1410 0           $_eof = 1;
1411 0           $log->info( 'EOF' );
1412 0           $_selector->add(
1413             data => 'closing',
1414             f => $self->_close( $self->CLOSE_REASON_EOF )
1415             );
1416             }
1417             }
1418             }
1419              
1420 0     0 1   async method run() {
  0            
  0            
  0            
1421 0 0         return if $_completed_f;
1422              
1423 0           $_completed_f = Future->new;
1424 0           await $_selector->run_until_ready( $_completed_f );
1425             }
1426              
1427 0     0 1   method stop() {
  0            
  0            
1428 0 0         croak 'Not running' unless $_completed_f;
1429 0 0         $_completed_f->done unless $_completed_f->is_ready;
1430             }
1431              
1432 0     0 1   method is_connected() {
  0            
  0            
1433 0   0       return not ($_state == _STATE_NONE
1434             or $_state == _STATE_INITIALIZING
1435             or $_state == _STATE_CLOSED);
1436             }
1437              
1438 0     0 1   method is_opened() {
  0            
  0            
1439 0           return ($_state == _STATE_OPENED);
1440             }
1441              
1442 0     0     method _remove_stream($id) {
  0            
  0            
  0            
1443 0           delete $_streams->{$id};
1444 0           return;
1445             }
1446              
1447             # ENTRYPOINT: REMOTE_PROC_CONNECT_IS_SECURE
1448 0     0 1   async method is_secure() {
  0            
  0            
  0            
1449 0   0       return ($self->is_opened
1450             and $_connection->is_secure
1451             and await $self->_call( $remote->PROC_CONNECT_IS_SECURE,
1452             {}, unwrap => 'secure' ));
1453             }
1454              
1455 0     0 1   async method connect() {
  0            
  0            
  0            
1456 0           await $self->initialize;
1457 0           await $self->auth;
1458 0           await $self->open;
1459             }
1460              
1461             # ENTRYPOINT: REMOTE_PROC_CONNECT_DOMAIN_EVENT_CALLBACK_REGISTER_ANY
1462             # ENTRYPOINT: REMOTE_PROC_CONNECT_DOMAIN_EVENT_CALLBACK_DEREGISTER_ANY
1463 0     0 1   async method domain_event_register_any($eventID, $domain = undef) {
  0            
  0            
  0            
  0            
  0            
1464 0 0         my $dom = $domain ? $domain->rpc_id : undef;
1465 0           my $rv = await $self->_call(
1466             $remote->PROC_CONNECT_DOMAIN_EVENT_CALLBACK_REGISTER_ANY,
1467             { eventID => $eventID, dom => $dom });
1468 0           my $dereg = $remote->PROC_CONNECT_DOMAIN_EVENT_CALLBACK_DEREGISTER_ANY;
1469             my $cb = Sys::Async::Virt::Callback->new(
1470             id => $rv->{callbackID},
1471             client => $self,
1472             deregister_call => $dereg,
1473 0     0     factory => sub { Future->new }
  0            
1474             );
1475 0           $_callbacks->{$rv->{callbackID}} = $cb;
1476 0           weaken $_callbacks->{$rv->{callbackID}};
1477              
1478 0           return $cb;
1479             }
1480              
1481             # ENTRYPOINT: REMOTE_PROC_CONNECT_NETWORK_EVENT_REGISTER_ANY
1482             # ENTRYPOINT: REMOTE_PROC_CONNECT_NETWORK_EVENT_DEREGISTER_ANY
1483 0     0 1   async method network_event_register_any($eventID, $network = undef) {
  0            
  0            
  0            
  0            
  0            
1484 0 0         my $net = $network ? $network->rpc_id : undef;
1485 0           my $rv = await $self->_call(
1486             $remote->PROC_CONNECT_NETWORK_EVENT_REGISTER_ANY,
1487             { eventID => $eventID, net => $net });
1488 0           my $dereg = $remote->PROC_CONNECT_NETWORK_EVENT_DEREGISTER_ANY;
1489             my $cb = Sys::Async::Virt::Callback->new(
1490             id => $rv->{callbackID},
1491             client => $self,
1492             deregister_call => $dereg,
1493 0     0     factory => sub { Future->new }
  0            
1494             );
1495 0           $_callbacks->{$rv->{callbackID}} = $cb;
1496              
1497 0           return $cb;
1498             }
1499              
1500             # ENTRYPOINT: REMOTE_PROC_CONNECT_STORAGE_POOL_EVENT_REGISTER_ANY
1501             # ENTRYPOINT: REMOTE_PROC_CONNECT_STORAGE_POOL_EVENT_DEREGISTER_ANY
1502 0     0 1   async method storage_pool_event_register_any($eventID, $pool = undef) {
  0            
  0            
  0            
  0            
  0            
1503 0 0         my $p = $pool ? $pool->rpc_id : undef;
1504 0           my $rv = await $self->_call(
1505             $remote->PROC_CONNECT_STORAGE_POOL_EVENT_REGISTER_ANY,
1506             { eventID => $eventID, pool => $p });
1507 0           my $dereg = $remote->PROC_CONNECT_STORAGE_POOL_EVENT_DEREGISTER_ANY;
1508             my $cb = Sys::Async::Virt::Callback->new(
1509             id => $rv->{callbackID},
1510             client => $self,
1511             deregister_call => $dereg,
1512 0     0     factory => sub { Future->new }
  0            
1513             );
1514 0           $_callbacks->{$rv->{callbackID}} = $cb;
1515              
1516 0           return $cb;
1517             }
1518              
1519             # ENTRYPOINT: REMOTE_PROC_CONNECT_NODE_DEVICE_EVENT_REGISTER_ANY
1520             # ENTRYPOINT: REMOTE_PROC_CONNECT_NODE_DEVICE_EVENT_DEREGISTER_ANY
1521 0     0 1   async method node_device_event_register_any($eventID, $dev = undef) {
  0            
  0            
  0            
  0            
  0            
1522 0 0         my $d = $dev ? $dev->rpc_id : undef;
1523 0           my $rv = await $self->_call(
1524             $remote->PROC_CONNECT_NODE_DEVICE_EVENT_REGISTER_ANY,
1525             { eventID => $eventID, dev => $d });
1526 0           my $dereg = $remote->PROC_CONNECT_NODE_DEVICE_EVENT_DEREGISTER_ANY;
1527             my $cb = Sys::Async::Virt::Callback->new(
1528             id => $rv->{callbackID},
1529             client => $self,
1530             deregister_call => $dereg,
1531 0     0     factory => sub { Future->new }
  0            
1532             );
1533 0           $_callbacks->{$rv->{callbackID}} = $cb;
1534              
1535 0           return $cb;
1536             }
1537              
1538             # ENTRYPOINT: REMOTE_PROC_CONNECT_SECRET_EVENT_REGISTER_ANY
1539             # ENTRYPOINT: REMOTE_PROC_CONNECT_SECRET_EVENT_DEREGISTER_ANY
1540 0     0 1   async method secret_event_register_any($eventID, $secret = undef) {
  0            
  0            
  0            
  0            
  0            
1541 0 0         my $s = $secret ? $secret->rpc_id : undef;
1542 0           my $rv = await $self->_call(
1543             $remote->PROC_CONNECT_SECRET_EVENT_REGISTER_ANY,
1544             { eventID => $eventID, secret => $s });
1545 0           my $dereg = $remote->PROC_CONNECT_SECRET_EVENT_DEREGISTER_ANY;
1546             my $cb = Sys::Async::Virt::Callback->new(
1547             id => $rv->{callbackID},
1548             client => $self,
1549             deregister_call => $dereg,
1550 0     0     factory => sub { Future->new }
  0            
1551             );
1552 0           $_callbacks->{$rv->{callbackID}} = $cb;
1553              
1554 0           return $cb;
1555             }
1556              
1557             # ENTRYPOINT: REMOTE_PROC_AUTH_LIST
1558             # ENTRYPOINT: REMOTE_PROC_AUTH_POLKIT
1559             # ENTRYPOINT: REMOTE_PROC_AUTH_SASL_INIT
1560             # ENTRYPOINT: REMOTE_PROC_AUTH_SASL_START
1561             # ENTRYPOINT: REMOTE_PROC_AUTH_SASL_STEP
1562              
1563             # auth( $auth_type )
1564             # --> clients take the selected auth mechanism from the
1565             # connection URL: auth='sasl[.]" / auth='none' / auth='polkit'
1566             # in order to be able to handle SASL AUTH, we'll need an Authen::SASL
1567             # authentication parameter to be passed in though...
1568              
1569 0     0 1   async method auth($auth_type = undef) {
  0            
  0            
  0            
  0            
1570 0 0         return unless $_state == _STATE_INITIALIZED;
1571 0           $_state = _STATE_AUTHENTICATING;
1572              
1573 0           my $auth_types = await $self->_call( $remote->PROC_AUTH_LIST, {},
1574             unwrap => 'types' );
1575 0           my $selected;
1576 0 0         if (defined $auth_type) {
1577 0           my $want;
1578 0 0         if ($auth_type eq 'sasl') {
    0          
    0          
1579 0           $want = $remote->AUTH_SASL;
1580             }
1581             elsif ($auth_type eq 'polkit') {
1582 0           $want = $remote->AUTH_POLKIT;
1583             }
1584             elsif ($auth_type eq 'none') {
1585 0           $want = $remote->AUTH_NONE;
1586             }
1587             else {
1588 0           die "Unknown authentication method $auth_type requested";
1589             }
1590              
1591 0           for my $type ( $auth_types->@* ) {
1592 0 0         if ($want == $type) {
1593 0           $selected = $type;
1594 0           last;
1595             }
1596             }
1597 0 0         die "Requested authentication method $auth_type not supported by the server"
1598             if not defined $selected;
1599             }
1600             else {
1601 0           $selected = shift $auth_types->@*;
1602             }
1603              
1604 0           $log->trace( "Selected auth method: $selected" );
1605 0 0         if ($selected == $remote->AUTH_POLKIT) {
    0          
1606 0           await $self->_call( $remote->PROC_AUTH_POLKIT );
1607             }
1608             elsif ($selected == $remote->AUTH_SASL) {
1609 0           my $mechs = await $self->_call( $remote->PROC_AUTH_SASL_INIT, {},
1610             unwrap => 'mechlist' );
1611 0           $_sasl->mechanism( $mechs );
1612              
1613 0           my %uri = parse_url( $_url );
1614             my $auth = $_sasl->client_new(
1615             'libvirt', $uri{host},
1616 0 0         $_connection->is_secure ? '' : 'noplaintext noanonymous' );
1617 0           $auth->property('maxbuf', 65536);
1618              
1619 0           my $initial = $auth->client_start;
1620 0           my $rv = await $self->_call( $remote->PROC_AUTH_SASL_START,
1621             {
1622             mech => $auth->mechanism,
1623             nil => (defined $initial ? 0 : 1),
1624             data => ($initial // '')
1625             } );
1626 0           my ($complete, $data) = $rv->@{ qw( complete data ) };
1627              
1628 0   0       while (not $complete or $auth->need_step) {
1629 0           my $next_data = $auth->client_step( $data );
1630 0 0 0       last if ($complete and not $auth->need_step);
1631 0 0         last if $auth->error;
1632              
1633 0           $rv = await $self->_call( $remote->PROC_AUTH_SASL_STEP,
1634             {
1635             nil => (defined $next_data ? 0 : 1),
1636             data => ($next_data // '')
1637             } );
1638 0           ( $complete, $data ) = $rv->@{ qw( complete data ) };
1639             }
1640 0 0         if (my $err = $auth->error) {
    0          
1641 0           die $err;
1642             }
1643             elsif (not $auth->is_success) {
1644 0           die 'Unknown SASL error';
1645             }
1646              
1647 0 0 0       if (defined $auth->property( 'ssf' )
1648             and $auth->property( 'ssf' ) > 0) {
1649 0           $log->trace( '"ssf" set; setting codec' );
1650 0           $log->trace( '"maxbuf" set: ' . $auth->property('maxbuf') );
1651              
1652 0           $_sasl_session = $auth;
1653             }
1654             }
1655              
1656 0           $_state = _STATE_AUTHENTICATED;
1657 0           return;
1658             }
1659              
1660 0     0     async method _register_keepalive() {
  0            
  0            
  0            
1661 0 0         if (await $self->_supports_feature(
1662             $_remote->DRV_FEATURE_PROGRAM_KEEPALIVE )) {
1663             $_keepalive //= Protocol::Sys::Virt::KeepAlive->new(
1664             max_inactive => 5,
1665 0     0     on_ack => sub { $log->trace('KeepAlive PING ACK'); return; },
  0            
1666             on_ping => sub {
1667 0     0     $log->trace('KeepAlive ACK-ing PING');
1668 0 0         return $_[0]->pong unless $_eof;
1669             },
1670             on_fail => sub {
1671 0     0     $log->fatal('KeepAlive time out - closing connection');
1672 0           return $self->_close( $self->CLOSE_REASON_KEEPALIVE );
1673 0   0       });
1674              
1675 0           $_keepalive->register( $_transport );
1676             $_selector->add( data => 'PING',
1677             gen => sub {
1678             Future::IO
1679             ->sleep( $_ping_interval )
1680             ->on_done(sub {
1681 0           $log->trace('Sending PING');
1682             })
1683             ->then(sub {
1684 0 0         $_keepalive->ping unless $_eof;
1685 0     0     })
1686 0           });
1687             }
1688             }
1689              
1690             # ENTRYPOINT: REMOTE_PROC_CONNECT_OPEN
1691             # ENTRYPOINT: REMOTE_PROC_CONNECT_REGISTER_CLOSE_CALLBACK
1692 0     0 1   async method open() {
  0            
  0            
  0            
1693 0 0         return unless $_state == _STATE_AUTHENTICATED;
1694 0           $_state = _STATE_OPENING;
1695              
1696 0           await $self->_register_keepalive();
1697 0           my %parsed_url = parse_url( $_url );
1698 0 0         my $flags = $_readonly ? RO : 0;
1699             await $self->_call( $remote->PROC_CONNECT_OPEN,
1700 0           { name => $parsed_url{name}, flags => $flags } );
1701 0 0         if (await $self->_supports_feature(
1702             $_remote->DRV_FEATURE_REMOTE_CLOSE_CALLBACK )) {
1703 0           await $self->_call( $remote->PROC_CONNECT_REGISTER_CLOSE_CALLBACK );
1704             }
1705 0 0         if (not await $self->_supports_feature(
1706             $_remote->DRV_FEATURE_REMOTE_EVENT_CALLBACK )) {
1707 0           die "Remote does not support REMOTE_EVENT_CALLBACK feature";
1708             }
1709              
1710 0           $_state = _STATE_OPENED;
1711             }
1712              
1713             # ENTRYPOINT: REMOTE_PROC_CONNECT_CLOSE
1714             # ENTRYPOINT: REMOTE_PROC_CONNECT_UNREGISTER_CLOSE_CALLBACK
1715 0     0     async method _close($reason) {
  0            
  0            
  0            
  0            
1716 0 0 0       unless (_STATE_INITIALIZED <= $_state and $_state <= _STATE_OPENED) {
1717 0 0         $_completed_f->done unless $_completed_f->is_ready;
1718 0           return;
1719             }
1720 0           $_state = _STATE_CLEANING_UP;
1721              
1722 0 0 0       unless ($_connection->is_read_eof
1723             or $_connection->is_write_eof) {
1724             # when orderly connected both for reading and writing,
1725             # clean up all resources the server allocated for us
1726 0           try {
1727             await Future->wait_all(
1728             (map { $_->cancel }
1729             grep { $_ } values $_callbacks->%*),
1730             (map { $_->abort }
1731 0           grep { $_ } values $_streams->%*)
1732             );
1733 0           $log->debug( 'Unregistering CLOSE CALLBACK' );
1734 0           await $self->_call(
1735             $remote->PROC_CONNECT_UNREGISTER_CLOSE_CALLBACK );
1736              
1737 0           $log->debug( 'Closing session' );
1738 0           await $self->_call( $remote->PROC_CONNECT_CLOSE );
1739              
1740 0           $_completed_f->done;
1741 0           await $_connection->close;
1742             # @@@TODO: wait for server to close the connection?
1743             }
1744             catch ($e) {
1745 0           $log->error( "Error during release of server resources: $e" );
1746             }
1747             }
1748             else {
1749             # stop loops reading from and writing to the connection
1750 0           await $_connection->close;
1751             # @@@TODO: wait for server to close the connection?
1752             }
1753              
1754             # These *should* have been de-allocated above; however,
1755             # when the connection to the server doesn't work properly
1756             # anymore, we want to simply discard the client side resources
1757             # ... the server is on its own
1758              
1759 0           $_state = _STATE_CLOSING;
1760 0 0         if (my @callbacks = values $_callbacks->%*) {
1761 0           $log->debug( 'Cleaning up callbacks not deregistered from the server' );
1762 0           for my $cb (@callbacks) {
1763 0 0         next unless $cb;
1764              
1765             # 'cleanup' cleans the items from the array
1766 0           $cb->cleanup;
1767             }
1768             }
1769 0 0         if (my @streams = values $_streams->%*) {
1770 0           $log->debug( 'Cleaning up streams not deregistered from the server' );
1771 0           for my $stream (@streams) {
1772 0 0         next unless $stream;
1773              
1774             # 'cleanup' cleans the items from the array
1775 0           $stream->cleanup;
1776             }
1777             }
1778 0 0         if (my @replies = keys $_replies->%*) {
1779 0           $log->debug( 'Cleaning up (failing) on-going RPC calls' );
1780 0           for my $serial (@replies) {
1781 0           my $reply = delete $_replies->{$serial};
1782 0 0         next unless $reply;
1783              
1784 0           $reply->fail( 'Closed before reply received' );
1785             }
1786             }
1787              
1788 0           $_state = _STATE_CLOSED;
1789 0           $self->_dispatch_closed( $reason );
1790 0 0         $_completed_f->done unless $_completed_f->is_ready;
1791 0           return;
1792             }
1793              
1794 0     0 1   async method close() {
  0            
  0            
  0            
1795 0 0 0       return if ($_state == _STATE_NONE or _STATE_CLEANING_UP <= $_state);
1796 0           await $self->_close( $self->CLOSE_REASON_CLIENT );
1797             }
1798              
1799             # ENTRYPOINT: REMOTE_PROC_NODE_ALLOC_PAGES
1800 0     0 1   async method alloc_pages($page_counts, $start_cell, $cell_count, $flags ) {
  0            
  0            
  0            
  0            
  0            
  0            
  0            
1801             my $rv = await $self->_call(
1802             $remote->PROC_NODE_ALLOC_PAGES,
1803             { pageSizes => [ map { $_->{size} } $page_counts->@* ],
1804 0           pageCounts => [ map { $_->{count} } $page_counts->@* ],
1805             startCell => $start_cell,
1806             cellCount => $cell_count,
1807             flags => $flags } );
1808              
1809 0           return $rv->{ret};
1810             }
1811              
1812             # ENTRYPOINT: REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY
1813 0     0 1   async method get_cells_free_memory($start_cell, $max_cells) {
  0            
  0            
  0            
  0            
  0            
1814 0           my $rv = await $self->_call(
1815             $remote->PROC_NODE_GET_CELLS_FREE_MEMORY,
1816             { startCell => $start_cell, maxcells => $max_cells } );
1817              
1818 0           return $rv->{cells};
1819             }
1820              
1821             # ENTRYPOINT: REMOTE_PROC_NODE_GET_CPU_MAP
1822 0     0 1   async method get_cpu_map() {
  0            
  0            
  0            
1823 0           my $rv = await $self->_call(
1824             $remote->PROC_NODE_GET_CPU_MAP,
1825             { need_map => 1, need_online => 1, flags => 0 } );
1826              
1827 0           $_cpus = $rv->{ret};
1828 0           $_maplen = length($rv->{cpumap});
1829              
1830             return {
1831             totcpus => $rv->{ret},
1832             totonline => $rv->{online},
1833             maplen => length($rv->{cpumap}),
1834             onlinemap => await $self->_from_cpumap( $rv->{cpumap} )
1835 0           };
1836             }
1837              
1838             # ENTRYPOINT: REMOTE_PROC_NODE_GET_FREE_PAGES
1839 0     0 1   async method get_free_pages($pages, $start_cell, $cell_count, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
  0            
  0            
1840 0           my $rv = await $self->_call(
1841             $remote->PROC_NODE_GET_FREE_PAGES,
1842             { pages => $pages, startCell => $start_cell,
1843             cellCount => $cell_count, flags => $flags // 0 } );
1844              
1845 0           my @rv;
1846 0           my $cell_counts = [];
1847 0           while (1) {
1848 0           my $count = shift $rv->{counts}->@*;
1849 0           push $cell_counts->@*, $count;
1850              
1851 0 0         if (scalar($cell_counts->@*) == scalar($pages->@*)) {
1852 0           push @rv, $cell_counts;
1853 0           $cell_counts = [];
1854             }
1855 0 0         if (scalar($rv->{counts}->@*) == 0) {
1856 0           last;
1857             }
1858             }
1859              
1860 0           return \@rv;
1861             }
1862              
1863 0     0     async method _domain_migrate_finish($dname, $cookie, $uri, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
  0            
  0            
1864 0           return await $self->_call(
1865             $remote->PROC_DOMAIN_MIGRATE_FINISH,
1866             { dname => $dname, cookie => $cookie, uri => $uri, flags => $flags // 0 }, unwrap => 'ddom' );
1867             }
1868              
1869 0     0     async method _domain_migrate_finish2($dname, $cookie, $uri, $flags, $retcode) {
  0            
  0            
  0            
  0            
  0            
  0            
  0            
  0            
1870 0           return await $self->_call(
1871             $remote->PROC_DOMAIN_MIGRATE_FINISH2,
1872             { dname => $dname, cookie => $cookie, uri => $uri, flags => $flags // 0, retcode => $retcode }, unwrap => 'ddom' );
1873             }
1874              
1875 0     0     method _domain_migrate_prepare_tunnel($flags, $dname, $bandwidth, $dom_xml) {
  0            
  0            
  0            
  0            
  0            
  0            
1876 0   0       return $self->_call(
1877             $remote->PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL,
1878             { flags => $flags // 0, dname => $dname, bandwidth => $bandwidth, dom_xml => $dom_xml }, stream => 'write', empty => 1 );
1879             }
1880              
1881 0     0     async method _supports_feature($feature) {
  0            
  0            
  0            
  0            
1882 0           return await $self->_call(
1883             $remote->PROC_CONNECT_SUPPORTS_FEATURE,
1884             { feature => $feature }, unwrap => 'supported' );
1885             }
1886              
1887 0     0 1   async method baseline_cpu($xmlCPUs, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
1888 0           return await $self->_call(
1889             $remote->PROC_CONNECT_BASELINE_CPU,
1890             { xmlCPUs => $xmlCPUs, flags => $flags // 0 }, unwrap => 'cpu' );
1891             }
1892              
1893 0     0 1   async method baseline_hypervisor_cpu($emulator, $arch, $machine, $virttype, $xmlCPUs, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
  0            
  0            
  0            
  0            
1894 0           return await $self->_call(
1895             $remote->PROC_CONNECT_BASELINE_HYPERVISOR_CPU,
1896             { emulator => $emulator, arch => $arch, machine => $machine, virttype => $virttype, xmlCPUs => $xmlCPUs, flags => $flags // 0 }, unwrap => 'cpu' );
1897             }
1898              
1899 0     0 1   async method compare_cpu($xml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
1900 0           return await $self->_call(
1901             $remote->PROC_CONNECT_COMPARE_CPU,
1902             { xml => $xml, flags => $flags // 0 }, unwrap => 'result' );
1903             }
1904              
1905 0     0 1   async method compare_hypervisor_cpu($emulator, $arch, $machine, $virttype, $xmlCPU, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
  0            
  0            
  0            
  0            
1906 0           return await $self->_call(
1907             $remote->PROC_CONNECT_COMPARE_HYPERVISOR_CPU,
1908             { emulator => $emulator, arch => $arch, machine => $machine, virttype => $virttype, xmlCPU => $xmlCPU, flags => $flags // 0 }, unwrap => 'result' );
1909             }
1910              
1911 0     0 1   async method domain_create_xml($xml_desc, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
1912 0           return await $self->_call(
1913             $remote->PROC_DOMAIN_CREATE_XML,
1914             { xml_desc => $xml_desc, flags => $flags // 0 }, unwrap => 'dom' );
1915             }
1916              
1917 0     0 1   async method domain_define_xml($xml) {
  0            
  0            
  0            
  0            
1918 0           return await $self->_call(
1919             $remote->PROC_DOMAIN_DEFINE_XML,
1920             { xml => $xml }, unwrap => 'dom' );
1921             }
1922              
1923 0     0 1   async method domain_define_xml_flags($xml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
1924 0           return await $self->_call(
1925             $remote->PROC_DOMAIN_DEFINE_XML_FLAGS,
1926             { xml => $xml, flags => $flags // 0 }, unwrap => 'dom' );
1927             }
1928              
1929 0     0 1   async method domain_lookup_by_id($id) {
  0            
  0            
  0            
  0            
1930 0           return await $self->_call(
1931             $remote->PROC_DOMAIN_LOOKUP_BY_ID,
1932             { id => $id }, unwrap => 'dom' );
1933             }
1934              
1935 0     0 1   async method domain_lookup_by_name($name) {
  0            
  0            
  0            
  0            
1936 0           return await $self->_call(
1937             $remote->PROC_DOMAIN_LOOKUP_BY_NAME,
1938             { name => $name }, unwrap => 'dom' );
1939             }
1940              
1941 0     0 1   async method domain_lookup_by_uuid($uuid) {
  0            
  0            
  0            
  0            
1942 0           return await $self->_call(
1943             $remote->PROC_DOMAIN_LOOKUP_BY_UUID,
1944             { uuid => $uuid }, unwrap => 'dom' );
1945             }
1946              
1947 0     0 1   method domain_restore($from) {
  0            
  0            
  0            
1948 0           return $self->_call(
1949             $remote->PROC_DOMAIN_RESTORE,
1950             { from => $from }, empty => 1 );
1951             }
1952              
1953 0     0 1   method domain_restore_flags($from, $dxml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
1954 0   0       return $self->_call(
1955             $remote->PROC_DOMAIN_RESTORE_FLAGS,
1956             { from => $from, dxml => $dxml, flags => $flags // 0 }, empty => 1 );
1957             }
1958              
1959 0     0 1   async method domain_restore_params($params, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
1960 0           $params = await $self->_filter_typed_param_string( $params );
1961 0           return await $self->_call(
1962             $remote->PROC_DOMAIN_RESTORE_PARAMS,
1963             { params => $params, flags => $flags // 0 }, empty => 1 );
1964             }
1965              
1966 0     0 1   method domain_save_image_define_xml($file, $dxml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
1967 0   0       return $self->_call(
1968             $remote->PROC_DOMAIN_SAVE_IMAGE_DEFINE_XML,
1969             { file => $file, dxml => $dxml, flags => $flags // 0 }, empty => 1 );
1970             }
1971              
1972 0     0 1   async method domain_save_image_get_xml_desc($file, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
1973 0           return await $self->_call(
1974             $remote->PROC_DOMAIN_SAVE_IMAGE_GET_XML_DESC,
1975             { file => $file, flags => $flags // 0 }, unwrap => 'xml' );
1976             }
1977              
1978 0     0 1   async method domain_xml_from_native($nativeFormat, $nativeConfig, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
  0            
1979 0           return await $self->_call(
1980             $remote->PROC_CONNECT_DOMAIN_XML_FROM_NATIVE,
1981             { nativeFormat => $nativeFormat, nativeConfig => $nativeConfig, flags => $flags // 0 }, unwrap => 'domainXml' );
1982             }
1983              
1984 0     0 1   async method domain_xml_to_native($nativeFormat, $domainXml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
  0            
1985 0           return await $self->_call(
1986             $remote->PROC_CONNECT_DOMAIN_XML_TO_NATIVE,
1987             { nativeFormat => $nativeFormat, domainXml => $domainXml, flags => $flags // 0 }, unwrap => 'nativeConfig' );
1988             }
1989              
1990 0     0 1   async method find_storage_pool_sources($type, $srcSpec, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
  0            
1991 0           return await $self->_call(
1992             $remote->PROC_CONNECT_FIND_STORAGE_POOL_SOURCES,
1993             { type => $type, srcSpec => $srcSpec, flags => $flags // 0 }, unwrap => 'xml' );
1994             }
1995              
1996 0     0 1   async method get_all_domain_stats($doms, $stats, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
  0            
1997 0           return await $self->_call(
1998             $remote->PROC_CONNECT_GET_ALL_DOMAIN_STATS,
1999             { doms => $doms, stats => $stats, flags => $flags // 0 }, unwrap => 'retStats' );
2000             }
2001              
2002 0     0 1   async method get_capabilities() {
  0            
  0            
  0            
2003 0           return await $self->_call(
2004             $remote->PROC_CONNECT_GET_CAPABILITIES,
2005             { }, unwrap => 'capabilities' );
2006             }
2007              
2008 0     0 1   async method get_cpu_model_names($arch, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2009 0           return await $self->_call(
2010             $remote->PROC_CONNECT_GET_CPU_MODEL_NAMES,
2011             { arch => $arch, need_results => $remote->CPU_MODELS_MAX, flags => $flags // 0 }, unwrap => 'models' );
2012             }
2013              
2014 0     0 1   async method get_domain_capabilities($emulatorbin, $arch, $machine, $virttype, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
  0            
  0            
  0            
2015 0           return await $self->_call(
2016             $remote->PROC_CONNECT_GET_DOMAIN_CAPABILITIES,
2017             { emulatorbin => $emulatorbin, arch => $arch, machine => $machine, virttype => $virttype, flags => $flags // 0 }, unwrap => 'capabilities' );
2018             }
2019              
2020 0     0 1   async method get_hostname() {
  0            
  0            
  0            
2021 0           return await $self->_call(
2022             $remote->PROC_CONNECT_GET_HOSTNAME,
2023             { }, unwrap => 'hostname' );
2024             }
2025              
2026 0     0 1   async method get_lib_version() {
  0            
  0            
  0            
2027 0           return await $self->_call(
2028             $remote->PROC_CONNECT_GET_LIB_VERSION,
2029             { }, unwrap => 'lib_ver' );
2030             }
2031              
2032 0     0 1   async method get_max_vcpus($type) {
  0            
  0            
  0            
  0            
2033 0           return await $self->_call(
2034             $remote->PROC_CONNECT_GET_MAX_VCPUS,
2035             { type => $type }, unwrap => 'max_vcpus' );
2036             }
2037              
2038 0     0 1   async method get_storage_pool_capabilities($flags = 0) {
  0            
  0            
  0            
  0            
2039 0           return await $self->_call(
2040             $remote->PROC_CONNECT_GET_STORAGE_POOL_CAPABILITIES,
2041             { flags => $flags // 0 }, unwrap => 'capabilities' );
2042             }
2043              
2044 0     0 1   async method get_sysinfo($flags = 0) {
  0            
  0            
  0            
  0            
2045 0           return await $self->_call(
2046             $remote->PROC_CONNECT_GET_SYSINFO,
2047             { flags => $flags // 0 }, unwrap => 'sysinfo' );
2048             }
2049              
2050 0     0 1   async method get_type() {
  0            
  0            
  0            
2051 0           return await $self->_call(
2052             $remote->PROC_CONNECT_GET_TYPE,
2053             { }, unwrap => 'type' );
2054             }
2055              
2056 0     0 1   async method get_uri() {
  0            
  0            
  0            
2057 0           return await $self->_call(
2058             $remote->PROC_CONNECT_GET_URI,
2059             { }, unwrap => 'uri' );
2060             }
2061              
2062 0     0 1   async method get_version() {
  0            
  0            
  0            
2063 0           return await $self->_call(
2064             $remote->PROC_CONNECT_GET_VERSION,
2065             { }, unwrap => 'hv_ver' );
2066             }
2067              
2068 0     0 1   method interface_change_begin($flags = 0) {
  0            
  0            
  0            
2069 0   0       return $self->_call(
2070             $remote->PROC_INTERFACE_CHANGE_BEGIN,
2071             { flags => $flags // 0 }, empty => 1 );
2072             }
2073              
2074 0     0 1   method interface_change_commit($flags = 0) {
  0            
  0            
  0            
2075 0   0       return $self->_call(
2076             $remote->PROC_INTERFACE_CHANGE_COMMIT,
2077             { flags => $flags // 0 }, empty => 1 );
2078             }
2079              
2080 0     0 1   method interface_change_rollback($flags = 0) {
  0            
  0            
  0            
2081 0   0       return $self->_call(
2082             $remote->PROC_INTERFACE_CHANGE_ROLLBACK,
2083             { flags => $flags // 0 }, empty => 1 );
2084             }
2085              
2086 0     0 1   async method interface_define_xml($xml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2087 0           return await $self->_call(
2088             $remote->PROC_INTERFACE_DEFINE_XML,
2089             { xml => $xml, flags => $flags // 0 }, unwrap => 'iface' );
2090             }
2091              
2092 0     0 1   async method interface_lookup_by_mac_string($mac) {
  0            
  0            
  0            
  0            
2093 0           return await $self->_call(
2094             $remote->PROC_INTERFACE_LOOKUP_BY_MAC_STRING,
2095             { mac => $mac }, unwrap => 'iface' );
2096             }
2097              
2098 0     0 1   async method interface_lookup_by_name($name) {
  0            
  0            
  0            
  0            
2099 0           return await $self->_call(
2100             $remote->PROC_INTERFACE_LOOKUP_BY_NAME,
2101             { name => $name }, unwrap => 'iface' );
2102             }
2103              
2104 0     0 1   async method list_all_domains($flags = 0) {
  0            
  0            
  0            
  0            
2105 0           return await $self->_call(
2106             $remote->PROC_CONNECT_LIST_ALL_DOMAINS,
2107             { need_results => $remote->DOMAIN_LIST_MAX, flags => $flags // 0 }, unwrap => 'domains' );
2108             }
2109              
2110 0     0 1   async method list_all_interfaces($flags = 0) {
  0            
  0            
  0            
  0            
2111 0           return await $self->_call(
2112             $remote->PROC_CONNECT_LIST_ALL_INTERFACES,
2113             { need_results => $remote->INTERFACE_LIST_MAX, flags => $flags // 0 }, unwrap => 'ifaces' );
2114             }
2115              
2116 0     0 1   async method list_all_networks($flags = 0) {
  0            
  0            
  0            
  0            
2117 0           return await $self->_call(
2118             $remote->PROC_CONNECT_LIST_ALL_NETWORKS,
2119             { need_results => $remote->NETWORK_LIST_MAX, flags => $flags // 0 }, unwrap => 'nets' );
2120             }
2121              
2122 0     0 1   async method list_all_node_devices($flags = 0) {
  0            
  0            
  0            
  0            
2123 0           return await $self->_call(
2124             $remote->PROC_CONNECT_LIST_ALL_NODE_DEVICES,
2125             { need_results => $remote->NODE_DEVICE_LIST_MAX, flags => $flags // 0 }, unwrap => 'devices' );
2126             }
2127              
2128 0     0 1   async method list_all_nwfilter_bindings($flags = 0) {
  0            
  0            
  0            
  0            
2129 0           return await $self->_call(
2130             $remote->PROC_CONNECT_LIST_ALL_NWFILTER_BINDINGS,
2131             { need_results => $remote->NWFILTER_BINGING_LIST_MAX, flags => $flags // 0 }, unwrap => 'bindings' );
2132             }
2133              
2134 0     0 1   async method list_all_nwfilters($flags = 0) {
  0            
  0            
  0            
  0            
2135 0           return await $self->_call(
2136             $remote->PROC_CONNECT_LIST_ALL_NWFILTERS,
2137             { need_results => $remote->NWFILTER_LIST_MAX, flags => $flags // 0 }, unwrap => 'filters' );
2138             }
2139              
2140 0     0 1   async method list_all_secrets($flags = 0) {
  0            
  0            
  0            
  0            
2141 0           return await $self->_call(
2142             $remote->PROC_CONNECT_LIST_ALL_SECRETS,
2143             { need_results => $remote->SECRET_LIST_MAX, flags => $flags // 0 }, unwrap => 'secrets' );
2144             }
2145              
2146 0     0 1   async method list_all_storage_pools($flags = 0) {
  0            
  0            
  0            
  0            
2147 0           return await $self->_call(
2148             $remote->PROC_CONNECT_LIST_ALL_STORAGE_POOLS,
2149             { need_results => $remote->STORAGE_POOL_LIST_MAX, flags => $flags // 0 }, unwrap => 'pools' );
2150             }
2151              
2152 0     0 1   async method list_defined_domains() {
  0            
  0            
  0            
2153 0           return await $self->_call(
2154             $remote->PROC_CONNECT_LIST_DEFINED_DOMAINS,
2155             { maxnames => $remote->DOMAIN_LIST_MAX }, unwrap => 'names' );
2156             }
2157              
2158 0     0 1   async method list_defined_interfaces() {
  0            
  0            
  0            
2159 0           return await $self->_call(
2160             $remote->PROC_CONNECT_LIST_DEFINED_INTERFACES,
2161             { maxnames => $remote->INTERFACE_LIST_MAX }, unwrap => 'names' );
2162             }
2163              
2164 0     0 1   async method list_defined_networks() {
  0            
  0            
  0            
2165 0           return await $self->_call(
2166             $remote->PROC_CONNECT_LIST_DEFINED_NETWORKS,
2167             { maxnames => $remote->NETWORK_LIST_MAX }, unwrap => 'names' );
2168             }
2169              
2170 0     0 1   async method list_defined_storage_pools() {
  0            
  0            
  0            
2171 0           return await $self->_call(
2172             $remote->PROC_CONNECT_LIST_DEFINED_STORAGE_POOLS,
2173             { maxnames => $remote->STORAGE_POOL_LIST_MAX }, unwrap => 'names' );
2174             }
2175              
2176 0     0 1   async method list_domains() {
  0            
  0            
  0            
2177 0           return await $self->_call(
2178             $remote->PROC_CONNECT_LIST_DOMAINS,
2179             { maxids => $remote->DOMAIN_LIST_MAX }, unwrap => 'ids' );
2180             }
2181              
2182 0     0 1   async method list_interfaces() {
  0            
  0            
  0            
2183 0           return await $self->_call(
2184             $remote->PROC_CONNECT_LIST_INTERFACES,
2185             { maxnames => $remote->INTERFACE_LIST_MAX }, unwrap => 'names' );
2186             }
2187              
2188 0     0 1   async method list_networks() {
  0            
  0            
  0            
2189 0           return await $self->_call(
2190             $remote->PROC_CONNECT_LIST_NETWORKS,
2191             { maxnames => $remote->NETWORK_LIST_MAX }, unwrap => 'names' );
2192             }
2193              
2194 0     0 1   async method list_nwfilters() {
  0            
  0            
  0            
2195 0           return await $self->_call(
2196             $remote->PROC_CONNECT_LIST_NWFILTERS,
2197             { maxnames => $remote->NWFILTER_LIST_MAX }, unwrap => 'names' );
2198             }
2199              
2200 0     0 1   async method list_secrets() {
  0            
  0            
  0            
2201 0           return await $self->_call(
2202             $remote->PROC_CONNECT_LIST_SECRETS,
2203             { maxuuids => $remote->SECRET_LIST_MAX }, unwrap => 'uuids' );
2204             }
2205              
2206 0     0 1   async method list_storage_pools() {
  0            
  0            
  0            
2207 0           return await $self->_call(
2208             $remote->PROC_CONNECT_LIST_STORAGE_POOLS,
2209             { maxnames => $remote->STORAGE_POOL_LIST_MAX }, unwrap => 'names' );
2210             }
2211              
2212 0     0 1   async method network_create_xml($xml) {
  0            
  0            
  0            
  0            
2213 0           return await $self->_call(
2214             $remote->PROC_NETWORK_CREATE_XML,
2215             { xml => $xml }, unwrap => 'net' );
2216             }
2217              
2218 0     0 1   async method network_create_xml_flags($xml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2219 0           return await $self->_call(
2220             $remote->PROC_NETWORK_CREATE_XML_FLAGS,
2221             { xml => $xml, flags => $flags // 0 }, unwrap => 'net' );
2222             }
2223              
2224 0     0 1   async method network_define_xml($xml) {
  0            
  0            
  0            
  0            
2225 0           return await $self->_call(
2226             $remote->PROC_NETWORK_DEFINE_XML,
2227             { xml => $xml }, unwrap => 'net' );
2228             }
2229              
2230 0     0 1   async method network_define_xml_flags($xml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2231 0           return await $self->_call(
2232             $remote->PROC_NETWORK_DEFINE_XML_FLAGS,
2233             { xml => $xml, flags => $flags // 0 }, unwrap => 'net' );
2234             }
2235              
2236 0     0 1   async method network_lookup_by_name($name) {
  0            
  0            
  0            
  0            
2237 0           return await $self->_call(
2238             $remote->PROC_NETWORK_LOOKUP_BY_NAME,
2239             { name => $name }, unwrap => 'net' );
2240             }
2241              
2242 0     0 1   async method network_lookup_by_uuid($uuid) {
  0            
  0            
  0            
  0            
2243 0           return await $self->_call(
2244             $remote->PROC_NETWORK_LOOKUP_BY_UUID,
2245             { uuid => $uuid }, unwrap => 'net' );
2246             }
2247              
2248 0     0 1   async method node_get_cpu_stats($cpuNum, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2249 0           my $nparams = await $self->_call(
2250             $remote->PROC_NODE_GET_CPU_STATS,
2251             { cpuNum => $cpuNum, nparams => 0, flags => $flags // 0 }, unwrap => 'nparams' );
2252 0           return await $self->_call(
2253             $remote->PROC_NODE_GET_CPU_STATS,
2254             { cpuNum => $cpuNum, nparams => $nparams, flags => $flags // 0 }, unwrap => 'params' );
2255             }
2256              
2257 0     0 1   async method node_get_free_memory() {
  0            
  0            
  0            
2258 0           return await $self->_call(
2259             $remote->PROC_NODE_GET_FREE_MEMORY,
2260             { }, unwrap => 'freeMem' );
2261             }
2262              
2263 0     0 1   method node_get_info() {
  0            
  0            
2264 0           return $self->_call(
2265             $remote->PROC_NODE_GET_INFO,
2266             { } );
2267             }
2268              
2269 0     0 1   async method node_get_memory_parameters($flags = 0) {
  0            
  0            
  0            
  0            
2270 0           $flags |= await $self->_typed_param_string_okay();
2271 0           my $nparams = await $self->_call(
2272             $remote->PROC_NODE_GET_MEMORY_PARAMETERS,
2273             { nparams => 0, flags => $flags // 0 }, unwrap => 'nparams' );
2274 0           return await $self->_call(
2275             $remote->PROC_NODE_GET_MEMORY_PARAMETERS,
2276             { nparams => $nparams, flags => $flags // 0 }, unwrap => 'params' );
2277             }
2278              
2279 0     0 1   async method node_get_memory_stats($cellNum, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2280 0           my $nparams = await $self->_call(
2281             $remote->PROC_NODE_GET_MEMORY_STATS,
2282             { nparams => 0, cellNum => $cellNum, flags => $flags // 0 }, unwrap => 'nparams' );
2283 0           return await $self->_call(
2284             $remote->PROC_NODE_GET_MEMORY_STATS,
2285             { nparams => $nparams, cellNum => $cellNum, flags => $flags // 0 }, unwrap => 'params' );
2286             }
2287              
2288 0     0 1   method node_get_security_model() {
  0            
  0            
2289 0           return $self->_call(
2290             $remote->PROC_NODE_GET_SECURITY_MODEL,
2291             { } );
2292             }
2293              
2294 0     0 1   async method node_get_sev_info($flags = 0) {
  0            
  0            
  0            
  0            
2295 0           $flags |= await $self->_typed_param_string_okay();
2296 0           my $nparams = await $self->_call(
2297             $remote->PROC_NODE_GET_SEV_INFO,
2298             { nparams => 0, flags => $flags // 0 }, unwrap => 'nparams' );
2299 0           return await $self->_call(
2300             $remote->PROC_NODE_GET_SEV_INFO,
2301             { nparams => $nparams, flags => $flags // 0 }, unwrap => 'params' );
2302             }
2303              
2304 0     0 1   async method node_list_devices($cap, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2305 0           return await $self->_call(
2306             $remote->PROC_NODE_LIST_DEVICES,
2307             { cap => $cap, maxnames => $remote->NODE_DEVICE_LIST_MAX, flags => $flags // 0 }, unwrap => 'names' );
2308             }
2309              
2310 0     0 1   async method node_num_of_devices($cap, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2311 0           return await $self->_call(
2312             $remote->PROC_NODE_NUM_OF_DEVICES,
2313             { cap => $cap, flags => $flags // 0 }, unwrap => 'num' );
2314             }
2315              
2316 0     0 1   async method node_set_memory_parameters($params, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2317 0           $params = await $self->_filter_typed_param_string( $params );
2318 0           return await $self->_call(
2319             $remote->PROC_NODE_SET_MEMORY_PARAMETERS,
2320             { params => $params, flags => $flags // 0 }, empty => 1 );
2321             }
2322              
2323 0     0 1   method node_suspend_for_duration($target, $duration, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2324 0   0       return $self->_call(
2325             $remote->PROC_NODE_SUSPEND_FOR_DURATION,
2326             { target => $target, duration => $duration, flags => $flags // 0 }, empty => 1 );
2327             }
2328              
2329 0     0 1   async method num_of_defined_domains() {
  0            
  0            
  0            
2330 0           return await $self->_call(
2331             $remote->PROC_CONNECT_NUM_OF_DEFINED_DOMAINS,
2332             { }, unwrap => 'num' );
2333             }
2334              
2335 0     0 1   async method num_of_defined_interfaces() {
  0            
  0            
  0            
2336 0           return await $self->_call(
2337             $remote->PROC_CONNECT_NUM_OF_DEFINED_INTERFACES,
2338             { }, unwrap => 'num' );
2339             }
2340              
2341 0     0 1   async method num_of_defined_networks() {
  0            
  0            
  0            
2342 0           return await $self->_call(
2343             $remote->PROC_CONNECT_NUM_OF_DEFINED_NETWORKS,
2344             { }, unwrap => 'num' );
2345             }
2346              
2347 0     0 1   async method num_of_defined_storage_pools() {
  0            
  0            
  0            
2348 0           return await $self->_call(
2349             $remote->PROC_CONNECT_NUM_OF_DEFINED_STORAGE_POOLS,
2350             { }, unwrap => 'num' );
2351             }
2352              
2353 0     0 1   async method num_of_domains() {
  0            
  0            
  0            
2354 0           return await $self->_call(
2355             $remote->PROC_CONNECT_NUM_OF_DOMAINS,
2356             { }, unwrap => 'num' );
2357             }
2358              
2359 0     0 1   async method num_of_interfaces() {
  0            
  0            
  0            
2360 0           return await $self->_call(
2361             $remote->PROC_CONNECT_NUM_OF_INTERFACES,
2362             { }, unwrap => 'num' );
2363             }
2364              
2365 0     0 1   async method num_of_networks() {
  0            
  0            
  0            
2366 0           return await $self->_call(
2367             $remote->PROC_CONNECT_NUM_OF_NETWORKS,
2368             { }, unwrap => 'num' );
2369             }
2370              
2371 0     0 1   async method num_of_nwfilters() {
  0            
  0            
  0            
2372 0           return await $self->_call(
2373             $remote->PROC_CONNECT_NUM_OF_NWFILTERS,
2374             { }, unwrap => 'num' );
2375             }
2376              
2377 0     0 1   async method num_of_secrets() {
  0            
  0            
  0            
2378 0           return await $self->_call(
2379             $remote->PROC_CONNECT_NUM_OF_SECRETS,
2380             { }, unwrap => 'num' );
2381             }
2382              
2383 0     0 1   async method num_of_storage_pools() {
  0            
  0            
  0            
2384 0           return await $self->_call(
2385             $remote->PROC_CONNECT_NUM_OF_STORAGE_POOLS,
2386             { }, unwrap => 'num' );
2387             }
2388              
2389 0     0 1   async method nwfilter_binding_create_xml($xml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2390 0           return await $self->_call(
2391             $remote->PROC_NWFILTER_BINDING_CREATE_XML,
2392             { xml => $xml, flags => $flags // 0 }, unwrap => 'nwfilter' );
2393             }
2394              
2395 0     0 1   async method nwfilter_binding_lookup_by_port_dev($name) {
  0            
  0            
  0            
  0            
2396 0           return await $self->_call(
2397             $remote->PROC_NWFILTER_BINDING_LOOKUP_BY_PORT_DEV,
2398             { name => $name }, unwrap => 'nwfilter' );
2399             }
2400              
2401 0     0 1   async method nwfilter_define_xml($xml) {
  0            
  0            
  0            
  0            
2402 0           return await $self->_call(
2403             $remote->PROC_NWFILTER_DEFINE_XML,
2404             { xml => $xml }, unwrap => 'nwfilter' );
2405             }
2406              
2407 0     0 1   async method nwfilter_define_xml_flags($xml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2408 0           return await $self->_call(
2409             $remote->PROC_NWFILTER_DEFINE_XML_FLAGS,
2410             { xml => $xml, flags => $flags // 0 }, unwrap => 'nwfilter' );
2411             }
2412              
2413 0     0 1   async method nwfilter_lookup_by_name($name) {
  0            
  0            
  0            
  0            
2414 0           return await $self->_call(
2415             $remote->PROC_NWFILTER_LOOKUP_BY_NAME,
2416             { name => $name }, unwrap => 'nwfilter' );
2417             }
2418              
2419 0     0 1   async method nwfilter_lookup_by_uuid($uuid) {
  0            
  0            
  0            
  0            
2420 0           return await $self->_call(
2421             $remote->PROC_NWFILTER_LOOKUP_BY_UUID,
2422             { uuid => $uuid }, unwrap => 'nwfilter' );
2423             }
2424              
2425 0     0 1   async method secret_define_xml($xml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2426 0           return await $self->_call(
2427             $remote->PROC_SECRET_DEFINE_XML,
2428             { xml => $xml, flags => $flags // 0 }, unwrap => 'secret' );
2429             }
2430              
2431 0     0 1   async method secret_lookup_by_usage($usageType, $usageID) {
  0            
  0            
  0            
  0            
  0            
2432 0           return await $self->_call(
2433             $remote->PROC_SECRET_LOOKUP_BY_USAGE,
2434             { usageType => $usageType, usageID => $usageID }, unwrap => 'secret' );
2435             }
2436              
2437 0     0 1   async method secret_lookup_by_uuid($uuid) {
  0            
  0            
  0            
  0            
2438 0           return await $self->_call(
2439             $remote->PROC_SECRET_LOOKUP_BY_UUID,
2440             { uuid => $uuid }, unwrap => 'secret' );
2441             }
2442              
2443 0     0 1   async method set_identity($params, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2444 0           $params = await $self->_filter_typed_param_string( $params );
2445 0           return await $self->_call(
2446             $remote->PROC_CONNECT_SET_IDENTITY,
2447             { params => $params, flags => $flags // 0 }, empty => 1 );
2448             }
2449              
2450 0     0 1   async method storage_pool_create_xml($xml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2451 0           return await $self->_call(
2452             $remote->PROC_STORAGE_POOL_CREATE_XML,
2453             { xml => $xml, flags => $flags // 0 }, unwrap => 'pool' );
2454             }
2455              
2456 0     0 1   async method storage_pool_define_xml($xml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
2457 0           return await $self->_call(
2458             $remote->PROC_STORAGE_POOL_DEFINE_XML,
2459             { xml => $xml, flags => $flags // 0 }, unwrap => 'pool' );
2460             }
2461              
2462 0     0 1   async method storage_pool_lookup_by_name($name) {
  0            
  0            
  0            
  0            
2463 0           return await $self->_call(
2464             $remote->PROC_STORAGE_POOL_LOOKUP_BY_NAME,
2465             { name => $name }, unwrap => 'pool' );
2466             }
2467              
2468 0     0 1   async method storage_pool_lookup_by_target_path($path) {
  0            
  0            
  0            
  0            
2469 0           return await $self->_call(
2470             $remote->PROC_STORAGE_POOL_LOOKUP_BY_TARGET_PATH,
2471             { path => $path }, unwrap => 'pool' );
2472             }
2473              
2474 0     0 1   async method storage_pool_lookup_by_uuid($uuid) {
  0            
  0            
  0            
  0            
2475 0           return await $self->_call(
2476             $remote->PROC_STORAGE_POOL_LOOKUP_BY_UUID,
2477             { uuid => $uuid }, unwrap => 'pool' );
2478             }
2479              
2480 0     0 1   async method storage_vol_lookup_by_key($key) {
  0            
  0            
  0            
  0            
2481 0           return await $self->_call(
2482             $remote->PROC_STORAGE_VOL_LOOKUP_BY_KEY,
2483             { key => $key }, unwrap => 'vol' );
2484             }
2485              
2486 0     0 1   async method storage_vol_lookup_by_path($path) {
  0            
  0            
  0            
  0            
2487 0           return await $self->_call(
2488             $remote->PROC_STORAGE_VOL_LOOKUP_BY_PATH,
2489             { path => $path }, unwrap => 'vol' );
2490             }
2491              
2492              
2493             1;
2494              
2495             __END__