• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Virtual machine Management Terminal User Interface


Commit MetaInfo

Revision66c58f1968b2f9251738442139f8918701aa919d (tree)
Time2023-04-04 21:24:02
AuthorKoine Yuusuke(koinec) <koinec@user...>
CommiterKoine Yuusuke(koinec)

Log Message

Improve HVisor line output in VM list.

Change Summary

Incremental Difference

--- a/src/tuivmlist.c
+++ b/src/tuivmlist.c
@@ -192,6 +192,8 @@ int
192192 VmList_Item *p_item;
193193 char str_fmt[32];
194194 char str_stat[16];
195+ char *pstr_con;
196+ char *pstr_type;
195197 char str_animation[5] = "-\\|/";
196198 chtype ch_line;
197199
@@ -218,6 +220,30 @@ int
218220 // HVisor ---
219221 p_hvisor = HVisor_Ref( p_item->i_hvisor );
220222
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+
221247 if( HVISOR_STATUS_CONNECTED & p_hvisor->dw_status ) {
222248 strncpy( str_stat, "* ONLINE", 15 );
223249 i_attr = COLOR_PAIR(2); // Green-Black
@@ -243,9 +269,10 @@ int
243269
244270 // Indent(2) + HyperName&fqdn(48+) + ConnectType(16) + State(10)
245271 // 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 );
249276
250277 HVisor_Release( p_hvisor );
251278