Virtual machine Management Terminal User Interface
Revision | 50b2e09d722b08e7afe48c362605b0d1e89d6780 (tree) |
---|---|
Zeit | 2023-05-06 22:05:00 |
Autor | Koine Yuusuke(koinec) <koinec@user...> |
Commiter | Koine Yuusuke(koinec) |
Fix build error on FreeBSD 13.2-RELEASE.
@@ -58,8 +58,7 @@ int | ||
58 | 58 | |
59 | 59 | |
60 | 60 | /* ===========================================================================*/ |
61 | -VMTUI_CONFFILE_EXTERN | |
62 | -int | |
61 | +void | |
63 | 62 | ConfFile_RegistValue( |
64 | 63 | KeyVal_Info *pt_info, |
65 | 64 | char *pstr_key, |
@@ -127,7 +126,7 @@ int | ||
127 | 126 | errno, 0, 0x00, str_temp ); |
128 | 127 | } |
129 | 128 | |
130 | - return 0x00; | |
129 | + return; | |
131 | 130 | } |
132 | 131 | |
133 | 132 | /* ===========================================================================*/ |
@@ -143,7 +142,6 @@ int | ||
143 | 142 | int i_max_idcounter ) |
144 | 143 | { |
145 | 144 | int i_cnt; |
146 | - int i_err; | |
147 | 145 | int i_ret; |
148 | 146 | int i_keylen; |
149 | 147 | int i_vallen; |
@@ -232,7 +230,7 @@ int | ||
232 | 230 | pt_base->pstr_keyval_base_key, |
233 | 231 | i_keyid, pt_sub->pstr_keyval_sub_key ); |
234 | 232 | |
235 | - i_err = ConfFile_RegistValue( | |
233 | + ConfFile_RegistValue( | |
236 | 234 | pt_info, str_key, pstr_value, i_vallen, |
237 | 235 | pt_sub->b_type, pt_sub->dw_keyval_priority, |
238 | 236 | pt_sub->pf_valcheck ); |
@@ -258,7 +256,7 @@ int | ||
258 | 256 | while( CONFFILE_TYPE_TERMINATER != pt_normal->b_type ) { |
259 | 257 | |
260 | 258 | if( 0x00 == strncmp( pstr_key, pt_normal->pstr_cfg_key, i_keylen ) ) { |
261 | - i_err = ConfFile_RegistValue( | |
259 | + ConfFile_RegistValue( | |
262 | 260 | pt_info, pt_normal->pstr_keyval_key, |
263 | 261 | pstr_value, i_vallen, pt_normal->b_type, |
264 | 262 | pt_normal->dw_keyval_priority, pt_normal->pf_valcheck ); |
@@ -84,13 +84,16 @@ typedef struct { | ||
84 | 84 | #endif |
85 | 85 | VMTUI_CONFFILE_EXTERN int ConfFile_ValCheck_SelectItem( |
86 | 86 | char *pstr_key, char *pstr_value, int i_vallen, ConfFile_SelectValue *pt_selval ); |
87 | -VMTUI_CONFFILE_EXTERN int ConfFile_RegistValue( | |
88 | - KeyVal_Info *pt_info, char *pstr_key, char *pstr_value, int i_vallen, | |
89 | - Byte b_type, DWord dw_priority, ConfFile_CheckValue pf_valcheck ); | |
90 | 87 | VMTUI_CONFFILE_EXTERN int ConfFile_ParseConfig( |
91 | 88 | KeyVal_Info *pt_info, int *pi_idcounter, char *pstr_buf, int i_buflen, |
92 | 89 | ConfFile_KeyTbl *pt_normal, ConfFile_BaseKeyTbl *pt_base, int i_max_idcounter ); |
93 | 90 | |
91 | +#ifdef VMTUI_SRC_CONFFILE | |
92 | +void ConfFile_RegistValue( | |
93 | + KeyVal_Info *pt_info, char *pstr_key, char *pstr_value, int i_vallen, | |
94 | + Byte b_type, DWord dw_priority, ConfFile_CheckValue pf_valcheck ); | |
95 | +#endif | |
96 | + | |
94 | 97 | #endif |
95 | 98 | |
96 | 99 | /* EOF of @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ |
@@ -364,7 +364,6 @@ int | ||
364 | 364 | |
365 | 365 | int i_cnt; |
366 | 366 | Guest *p_guest; |
367 | - Guest *p_prev; | |
368 | 367 | |
369 | 368 | // Create Index --- |
370 | 369 | gpp_guestindex = (Guest **)malloc( sizeof( Guest * ) * GUEST_ALLOC_UNITS ); |
@@ -391,7 +390,6 @@ int | ||
391 | 390 | pthread_rwlock_init( >_guest_rwlock, NULL ); |
392 | 391 | |
393 | 392 | // Clear All Guest structs. --- |
394 | - p_prev = NULL; | |
395 | 393 | for( i_cnt = (gi_alloc_guest - 1); 0 <= i_cnt ; i_cnt-- ) { |
396 | 394 | p_guest = GuestPtr(i_cnt); |
397 | 395 |
@@ -93,7 +93,9 @@ int | ||
93 | 93 | i_err = ConfFile_ParseConfig( |
94 | 94 | &(p_guest->t_info), i_idcounter, pstr_buf, i_buflen, |
95 | 95 | lt_cfg_normaltbl, lt_cfg_basetbl, GUESTCONFIG_CNTID_MAX ); |
96 | - | |
96 | + if( 0x00 != i_err ) { | |
97 | + return -0x01; | |
98 | + } | |
97 | 99 | |
98 | 100 | for( i_cnt = 0; i_cnt < GUESTCONFIG_CNTID_MAX; i_cnt++ ) { |
99 | 101 | if( -1 < i_idcounter[i_cnt] ) { |
@@ -43,7 +43,6 @@ int | ||
43 | 43 | DWord dw_status; |
44 | 44 | DWord dw_hvoption; |
45 | 45 | Byte b_connection; |
46 | - Byte b_sshtype; | |
47 | 46 | Byte b_nosshpasswd = 0x00; |
48 | 47 | Byte b_nosudopasswd = 0x00; |
49 | 48 |
@@ -51,7 +50,6 @@ int | ||
51 | 50 | p_hvisor = HVisor_Ref( i_hvisor ); |
52 | 51 | dw_status = p_hvisor->dw_status; |
53 | 52 | b_connection = p_hvisor->b_connection; |
54 | - b_sshtype = p_hvisor->ssh.b_sshtype; | |
55 | 53 | if(( HVISOR_OPTION_SSH_PASSWORD & p_hvisor->dw_option ) |
56 | 54 | && ( p_hvisor->ssh.str_password[0] == '\0' )) |
57 | 55 | { b_nosshpasswd = 0x01; } |
@@ -90,7 +90,6 @@ int | ||
90 | 90 | KeyVal_Item *p_parent; |
91 | 91 | KeyVal_Item *p_now; |
92 | 92 | KeyVal_Item *p_prev = NULL; |
93 | - KeyVal_Item *p_next = NULL; | |
94 | 93 | |
95 | 94 | p_item = p_kvinfo->p_items + i_item; |
96 | 95 | assert( NULL != p_item ); |
@@ -128,8 +127,6 @@ int | ||
128 | 127 | i_now = p_now->i_next; |
129 | 128 | } |
130 | 129 | |
131 | - if( KEYVAL_NONEID != i_now ) { p_next = p_now; } | |
132 | - | |
133 | 130 | if( KEYVAL_NONEID != i_parent ) { |
134 | 131 | if( KEYVAL_NONEID == p_parent->i_child ) |
135 | 132 | { p_parent->i_child = i_item; } |
@@ -160,15 +157,12 @@ int | ||
160 | 157 | KeyVal_Item *p_item; |
161 | 158 | KeyVal_Item *p_prev = NULL; |
162 | 159 | KeyVal_Item *p_parent = NULL; |
163 | - int i_parent; | |
164 | 160 | int i_now; |
165 | 161 | |
166 | 162 | p_item = p_kvinfo->p_items + i_item; |
167 | 163 | assert( NULL != p_item ); |
168 | 164 | assert( KEYVAL_NONEID == p_item->i_child ); |
169 | 165 | |
170 | - i_parent = p_item->i_parent; | |
171 | - | |
172 | 166 | if( KEYVAL_NONEID != p_item->i_parent ) { |
173 | 167 | p_parent = p_kvinfo->p_items + (p_item->i_parent); |
174 | 168 | assert( NULL != p_parent ); |
@@ -43,8 +43,7 @@ VMTUI_TUICMD_EXTERN int TuiCmd_Term( void ); | ||
43 | 43 | #ifdef VMTUI_SRC_TUICMD |
44 | 44 | WINDOW *gp_cmd_win = NULL; |
45 | 45 | #else |
46 | -WINDOW *gp_cmd_win; | |
47 | - | |
46 | +extern WINDOW *gp_cmd_win; | |
48 | 47 | #endif |
49 | 48 | |
50 | 49 | #endif |
@@ -478,7 +478,7 @@ int | ||
478 | 478 | int i_attr; |
479 | 479 | int i_maxlines; |
480 | 480 | int i_outlines; |
481 | - int i_endline; | |
481 | + //int i_endline; | |
482 | 482 | char *pstr_temp; |
483 | 483 | TuiGuest_LineAttr t_attr; |
484 | 484 | chtype ch_line; |
@@ -510,7 +510,7 @@ int | ||
510 | 510 | { mvwprintw( lt_guest.p_subwin, gwl_info.i_width - 2, ((COLS - 2) / 2), "v" ); } |
511 | 511 | } |
512 | 512 | |
513 | - i_endline = lt_guest.i_start_line + i_outlines; | |
513 | + //i_endline = lt_guest.i_start_line + i_outlines; | |
514 | 514 | |
515 | 515 | snprintf( str_fmt, sizeof( str_fmt ), "%%-%ds", (COLS - 2) ); |
516 | 516 | snprintf( str_valfmt, sizeof( str_valfmt ), "%%-%ds", (COLS - 2) - 25 ); |
@@ -108,6 +108,11 @@ int | ||
108 | 108 | |
109 | 109 | i_attr = 0x00; |
110 | 110 | i_err = TextBuf_AppendLine( <_help.t_textbuf, str_temp, 0, &i_attr ); |
111 | + if( 0x00 != i_err ) { | |
112 | + ErrInfo_Error( "Can't appent help line.", | |
113 | + HVISOR_ID_NONE, GUEST_ID_NONE, REQUEST_ID_NONE, | |
114 | + errno, i_err, 0x00, str_temp ); | |
115 | + } | |
111 | 116 | } |
112 | 117 | |
113 | 118 | return 0x00; |
@@ -319,7 +319,7 @@ int | ||
319 | 319 | int i_attr; |
320 | 320 | int i_maxlines; |
321 | 321 | int i_outlines; |
322 | - int i_endline; | |
322 | + //int i_endline; | |
323 | 323 | char *pstr_temp; |
324 | 324 | TuiHVisor_LineAttr t_attr; |
325 | 325 | char str_fmt[32]; |
@@ -350,7 +350,7 @@ int | ||
350 | 350 | { mvwprintw( lt_hvisor.p_subwin, gwl_info.i_width - 2, ((COLS - 2) / 2), "v" ); } |
351 | 351 | } |
352 | 352 | |
353 | - i_endline = lt_hvisor.i_start_line + i_outlines; | |
353 | + //i_endline = lt_hvisor.i_start_line + i_outlines; | |
354 | 354 | |
355 | 355 | snprintf( str_fmt, sizeof( str_fmt ), "%%-%ds", (COLS - 2) ); |
356 | 356 | snprintf( str_valfmt, sizeof( str_valfmt ), "%%-%ds", (COLS - 2) - 25 ); |
@@ -159,10 +159,13 @@ int | ||
159 | 159 | |
160 | 160 | // Exec. Cmd --- |
161 | 161 | i_err = p_hvcon->ExecCmd( p_hvcon, p_req->str_cmdline ); |
162 | + if( 0x00 != i_err ) { | |
163 | + return -0x03; | |
164 | + } | |
162 | 165 | |
163 | 166 | // Analyze Cmd Result --- |
164 | 167 | if( 0x00 != p_hvcon->i_exit ) { |
165 | - return -0x03; | |
168 | + return -0x04; | |
166 | 169 | } |
167 | 170 | |
168 | 171 | return 0x00; |
@@ -181,7 +184,6 @@ int | ||
181 | 184 | int i_item; |
182 | 185 | int i_gnow; |
183 | 186 | int i_gtype; |
184 | - int i_vnc; | |
185 | 187 | int i_newflag = 0x00; |
186 | 188 | int i_gnext; |
187 | 189 | char *pstr_line; |
@@ -200,14 +202,17 @@ int | ||
200 | 202 | |
201 | 203 | // Genereate CmdLine --- |
202 | 204 | i_len = snprintf( p_req->str_cmdline, REQUEST_MAXLEN_CMDLINE, |
203 | - "%s vm list --all", p_hvcon->sudo.str_cmdline ); | |
205 | + "%s vm list", p_hvcon->sudo.str_cmdline ); | |
204 | 206 | |
205 | 207 | // Exec. Cmd --- |
206 | 208 | i_err = p_hvcon->ExecCmd( p_hvcon, p_req->str_cmdline ); |
209 | + if( 0x00 != i_err ) { | |
210 | + return -0x01; | |
211 | + } | |
207 | 212 | |
208 | 213 | // Analyze Cmd Result --- |
209 | 214 | if( 0x00 != p_hvcon->i_exit ) { |
210 | - return -0x01; | |
215 | + return -0x02; | |
211 | 216 | } |
212 | 217 | |
213 | 218 | pstr_next = p_hvcon->str_buffer; |
@@ -266,7 +271,6 @@ int | ||
266 | 271 | strncpy( str_temp, pstr_item[5], sizeof( str_temp ) ); |
267 | 272 | if( '-' != str_temp[0] ) { |
268 | 273 | pstr_host = NULL; |
269 | - i_vnc = 0; | |
270 | 274 | pstr_now = str_temp; |
271 | 275 | pstr_host = strsep( &pstr_now, ":" ); |
272 | 276 |
@@ -115,6 +115,9 @@ int main( int argc, char *argv[] ) { | ||
115 | 115 | |
116 | 116 | SettingFile_SetSettingFilePath( NULL, NULL ); |
117 | 117 | i_err = SettingFile_ReadSetting(); |
118 | + if( 0x00 != i_err ) { | |
119 | + goto goto_main_post; | |
120 | + } | |
118 | 121 | |
119 | 122 | // Initial Auto-Connect HVisor --- |
120 | 123 | i_hvisor = HVisor_GetTopID(); |
@@ -168,7 +171,7 @@ int main( int argc, char *argv[] ) { | ||
168 | 171 | i_hvisor = i_hnext; |
169 | 172 | } |
170 | 173 | |
171 | -//goto_main_post: | |
174 | +goto_main_post: | |
172 | 175 | VmTui_Term(); |
173 | 176 | |
174 | 177 | return 0x00; |