lib/libvirt/domain.rb in libvirt_ffi-0.4.0 vs lib/libvirt/domain.rb in libvirt_ffi-0.4.1
- old
+ new
@@ -66,18 +66,26 @@
def xml_desc(flags = 0)
FFI::Domain.virDomainGetXMLDesc(@dom_ptr, flags)
end
def screenshot(stream, display = 0)
+ dbg { "#screenshot stream=#{stream}, display=#{display}," }
+
mime_type, pointer = FFI::Domain.virDomainScreenshot(@dom_ptr, stream.to_ptr, display, 0)
raise Error, "Couldn't attach domain screenshot" if pointer.null?
# free pointer required
mime_type
end
def free_domain
result = FFI::Domain.virDomainFree(@dom_ptr)
raise Error, "Couldn't free domain" if result < 0
@dom_ptr = nil
+ end
+
+ private
+
+ def dbg(&block)
+ Util.log(:debug, 'Libvirt::Domain', &block)
end
end
end