@@ -70,7 +70,7 @@ struct ConsoleArgs {
70
70
/// Initial tcp port to be used with `network` backend. If socket_count is
71
71
/// `N` then the following tcp ports will be created: `tcp_port`,
72
72
/// `tcp_port + 1`, ... , `tcp_port + (N - 1)`.
73
- #[ clap( short = 'p' , long, value_name = "PORT" , default_value = "12345" ) ]
73
+ #[ clap( short = 'p' , long, value_name = "PORT" ) ]
74
74
tcp_port : String ,
75
75
76
76
/// Specify the maximum size of virtqueue, the default is 128.
@@ -86,8 +86,22 @@ impl TryFrom<ConsoleArgs> for VuConsoleConfig {
86
86
return Err ( Error :: SocketCountInvalid ( 0 ) ) ;
87
87
}
88
88
89
- if ( args. backend == BackendType :: Nested ) && ( args. socket_count != 1 ) {
90
- return Err ( Error :: WrongBackendSocket ) ;
89
+ if args. backend == BackendType :: Nested {
90
+ if args. socket_count != 1 {
91
+ return Err ( Error :: WrongBackendSocket ) ;
92
+ }
93
+
94
+ if ( !args. tcp_port . is_empty ( ) ) || ( args. uds_path . is_some ( ) ) {
95
+ return Err ( Error :: InvalidCmdlineOption ) ;
96
+ }
97
+ }
98
+
99
+ if args. backend == BackendType :: Network && args. uds_path . is_some ( ) {
100
+ return Err ( Error :: InvalidCmdlineOption ) ;
101
+ }
102
+
103
+ if args. backend == BackendType :: Uds && !args. tcp_port . is_empty ( ) {
104
+ return Err ( Error :: InvalidCmdlineOption ) ;
91
105
}
92
106
93
107
let ConsoleArgs {
0 commit comments