Virtual machine Management Terminal User Interface
Revision | 66c58f1968b2f9251738442139f8918701aa919d (tree) |
---|---|
Time | 2023-04-04 21:24:02 |
Author | Koine Yuusuke(koinec) <koinec@user...> |
Commiter | Koine Yuusuke(koinec) |
Improve HVisor line output in VM list.
@@ -192,6 +192,8 @@ int | ||
192 | 192 | VmList_Item *p_item; |
193 | 193 | char str_fmt[32]; |
194 | 194 | char str_stat[16]; |
195 | + char *pstr_con; | |
196 | + char *pstr_type; | |
195 | 197 | char str_animation[5] = "-\\|/"; |
196 | 198 | chtype ch_line; |
197 | 199 |
@@ -218,6 +220,30 @@ int | ||
218 | 220 | // HVisor --- |
219 | 221 | p_hvisor = HVisor_Ref( p_item->i_hvisor ); |
220 | 222 | |
223 | + switch( p_hvisor->b_connection ) { | |
224 | + case HVISOR_CON_LOCALHOST: | |
225 | + pstr_con = "LocalHost"; break; | |
226 | + case HVISOR_CON_REMOTE_DIRECT: | |
227 | + pstr_con = "Remote(Direct)"; break; | |
228 | + case HVISOR_CON_REMOTE_SSH: | |
229 | + pstr_con = "Remote(SSH)"; break; | |
230 | + default: | |
231 | + pstr_con = "?UNKNOWN?"; break; | |
232 | + } | |
233 | + | |
234 | + switch( p_hvisor->dw_type ) { | |
235 | + case HVISOR_TYPE_BHYVE_VMBHYVE: | |
236 | + pstr_type = "vm-bhyve"; break; | |
237 | + case HVISOR_TYPE_BHYVE_DIRECTBHYVE: | |
238 | + pstr_type = "bhyve"; break; | |
239 | + case HVISOR_TYPE_BHYVE_LIBVIRT: | |
240 | + pstr_type = "libvirt(bhyve)"; break; | |
241 | + case HVISOR_TYPE_QEMUKVM_LIBVIRT: | |
242 | + pstr_type = "libvirt(qemu)"; break; | |
243 | + default: | |
244 | + pstr_type = "?UNKNOWN?"; break; | |
245 | + } | |
246 | + | |
221 | 247 | if( HVISOR_STATUS_CONNECTED & p_hvisor->dw_status ) { |
222 | 248 | strncpy( str_stat, "* ONLINE", 15 ); |
223 | 249 | i_attr = COLOR_PAIR(2); // Green-Black |
@@ -243,9 +269,10 @@ int | ||
243 | 269 | |
244 | 270 | // Indent(2) + HyperName&fqdn(48+) + ConnectType(16) + State(10) |
245 | 271 | // ConnectType: "Local", "SSH(vmbhyve) |
246 | - snprintf( str_fmt, 32, " %%-%d.%ds %%-16s %%-14s", | |
247 | - (COLS - 2 - 16 - 14 - 2 - 2) , (COLS - 2 - 16 - 14 - 2 - 2) ); | |
248 | - mvwprintw( gp_vmlist_win, i_line, 1, str_fmt, p_hvisor->str_name, "contype", str_stat ); | |
272 | + snprintf( str_fmt, 32, " %%-%d.%ds %%-16s %%-16s %%-14s", | |
273 | + (COLS -2 -1 -16 -1 -16 -1 -14 -2) , (COLS -2 -1 -16 -1 -16 -1 -14 -2) ); | |
274 | + mvwprintw( gp_vmlist_win, i_line, 1, str_fmt, | |
275 | + p_hvisor->str_name, pstr_con, pstr_type, str_stat ); | |
249 | 276 | |
250 | 277 | HVisor_Release( p_hvisor ); |
251 | 278 |