Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

qemu snapshot: view more info on running process...

  • Loading branch information...
commit e746ee24d77543744731ea741eddc7142a6c122e 1 parent 274698a
Guido De Rosa authored
View
9 modules/qemu/lib/onboard/virtualization/qemu/instance.rb
@@ -207,6 +207,8 @@ def get_status
@cache['status'] = str.sub(/^VM status(: )?/, '').capitalize
end
+ # TODO: move to QEMU::Snapshot::Runtime
+
def snapshotting?
pidfile = "#{VARRUN}/qemu-#{uuid_short}.snapshot.pid"
if File.exists? pidfile
@@ -226,6 +228,13 @@ def snapshot_waiting?
)
end
+ def snapshot_cmdline
+ cmdline_file = "#{VARRUN}/qemu-#{uuid_short}.snapshot.cmdline"
+ if File.exists? cmdline_file
+ File.read(cmdline_file).split("\0")
+ end
+ end
+
def drives
drives_h = {}
if running?
View
16 modules/qemu/views/virtualization/qemu/vm.html.erb
@@ -58,11 +58,17 @@
<h4>Status</h4>
<% if vm.snapshotting? %>
- <% if vm.snapshot_waiting? %>
- Waiting for other processes to complete.
- <% else %>
- Taking / Applying a snapshot.
- <% end %>
+ Running: <code class="highlight" style="margin-left:0.2em;"> <%= vm.snapshot_cmdline.join(' ').sub(
+ %r{(^.*)bin/snapshot(.*)$}, 'snapshot\2'
+ )
+ %></code>
+ <div class="optinfo">
+ <% if vm.snapshot_waiting? %>
+ Waiting for other processes to complete.
+ <% else %>
+ Taking / Applying a snapshot.
+ <% end %>
+ </div>
<% else %>
<% if OnBoard::V12n::QEMU::Snapshot.running? %>
Other VMs are currently under snapshotting (taking and/or applying).
Please sign in to comment.
Something went wrong with that request. Please try again.