@@ -48,6 +48,16 @@ impl EnclaveOpts {
48
48
Self { parsed }
49
49
}
50
50
51
+ /// Create a new `StreamPool` for connecting to the enclave.
52
+ fn enclave_pool ( & self ) -> Result < StreamPool , IOError > {
53
+ self . async_pool ( false )
54
+ }
55
+
56
+ /// Create a new `StreamPool` for connecting to the app.
57
+ fn app_pool ( & self ) -> Result < StreamPool , IOError > {
58
+ self . async_pool ( true )
59
+ }
60
+
51
61
/// Create a new `StreamPool` using the list of `SocketAddress` for the qos host.
52
62
/// The `app` parameter specifies if this is a pool meant for the enclave itself, or the enclave app.
53
63
fn async_pool ( & self , app : bool ) -> Result < StreamPool , IOError > {
@@ -64,13 +74,14 @@ impl EnclaveOpts {
64
74
c. parse ( ) . map_err ( |_| IOError :: ConnectAddressInvalid ) ?;
65
75
let p =
66
76
p. parse ( ) . map_err ( |_| IOError :: ConnectAddressInvalid ) ?;
67
- StreamPool :: new (
68
- SocketAddress :: new_vsock ( c, p, crate :: io:: VMADDR_NO_FLAGS ) ,
69
- 1 ,
70
- )
77
+ StreamPool :: single ( SocketAddress :: new_vsock (
78
+ c,
79
+ p,
80
+ crate :: io:: VMADDR_NO_FLAGS ,
81
+ ) )
71
82
}
72
83
( None , None , Some ( u) ) => {
73
- StreamPool :: new ( SocketAddress :: new_unix ( u) , 1 )
84
+ StreamPool :: single ( SocketAddress :: new_unix ( u) )
74
85
}
75
86
_ => panic ! ( "Invalid socket opts" ) ,
76
87
}
@@ -150,10 +161,9 @@ impl CLI {
150
161
opts. pivot_file ( ) ,
151
162
) ,
152
163
opts. nsm ( ) ,
153
- opts. async_pool ( false )
164
+ opts. enclave_pool ( )
154
165
. expect ( "Unable to create enclave socket pool" ) ,
155
- opts. async_pool ( true )
156
- . expect ( "Unable to create enclave app pool" ) ,
166
+ opts. app_pool ( ) . expect ( "Unable to create enclave app pool" ) ,
157
167
None ,
158
168
) ;
159
169
} ) ;
0 commit comments