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