- def abort(self, flag = 0):
+ def abort(self):
try:
- stream_obj = newStream(flag)
- return stream_obj.abort()
+ return self.stream_obj.abort()
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()
raise exception.LibvirtAPI(message, code)
- def connect(self, flag = 0):
+ def connect(self):
try:
- stream_obj = newStream(flag)
- return stream_obj.connect()
+ return self.stream_obj.connect()
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()
raise exception.LibvirtAPI(message, code)
- def finish(self, flag = 0):
+ def finish(self):
try:
- stream_obj = newStream(flag)
- return stream_obj.finish()
+ return self.stream_obj.finish()
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()
raise exception.LibvirtAPI(message, code)
- def recv(self, flag = 0, data, nbytes):
+ def recv(self, nbytes):
try:
- stream_obj = newStream(flag)
- return stream_obj.recv(data, nbytes)
+ return self.stream_obj.recv(nbytes)
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()
raise exception.LibvirtAPI(message, code)
- def send(self, flag = 0, data, nbytes):
+ def send(self, data):
try:
- stream_obj = newStream(flag)
- return stream_obj.send(data, nbytes)
+ return self.stream_obj.send(data)
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()
raise exception.LibvirtAPI(message, code)
- def eventAddCallback(self, flag = 0, cb, opaque):
+ def eventAddCallback(self, cb, opaque):
try:
- stream_obj = newStream(flag)
- return stream_obj.eventAddCallback(cb, opaque)
+ return self.stream_obj.eventAddCallback(cb, opaque)
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()
raise exception.LibvirtAPI(message, code)
- def eventRemoveCallback(self, flag = 0):
+ def eventRemoveCallback(self):
try:
- stream_obj = newStream(flag)
- return stream_obj.eventRemoveCallback()
+ return self.stream_obj.eventRemoveCallback()
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()
raise exception.LibvirtAPI(message, code)
- def eventUpdateCallback(self, flag = 0, events)
+ def eventUpdateCallback(self, events):
try:
- stream_obj = newStream(flag)
- return stream_obj.eventUpdateCallback(events)
+ return self.stream_obj.eventUpdateCallback(events)
+ except libvirt.libvirtError, e:
+ message = e.get_error_message()
+ code = e.get_error_code()
+ raise exception.LibvirtAPI(message, code)
+
+ def screenshot(self, domain, screen, flags = 0):
+ try:
+ return self.stream_obj.screenshot(domain, screen, flags)
+ except libvirt.libvirtError, e:
+ message = e.get_error_message()
+ code = e.get_error_code()
+ raise exception.LibvirtAPI(message, code)
+
+ def download(self, vol, offset, length, flags = 0):
+ try:
+ return self.stream_obj.download(vol, offset, length, flags)
+ except libvirt.libvirtError, e:
+ message = e.get_error_message()
+ code = e.get_error_code()
+ raise exception.LibvirtAPI(message, code)
+
+ def upload(self, vol, offset, length, flags = 0):
+ try:
+ return self.stream_obj.upload(vol, offset, length, flags)
+ except libvirt.libvirtError, e:
+ message = e.get_error_message()
+ code = e.get_error_code()
+ raise exception.LibvirtAPI(message, code)
+
+ def recvAll(self, handler, opaque):
+ try:
+ return self.stream_obj.recvAll(handler, opaque)
+ except libvirt.libvirtError, e:
+ message = e.get_error_message()
+ code = e.get_error_code()
+ raise exception.LibvirtAPI(message, code)
+
+ def sendAll(self, handler, opaque):
+ try:
+ return self.stream_obj.sendAll(handler, opaque)
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()