Commit 2066677a authored by Daniel P. Berrange's avatar Daniel P. Berrange

Add bindings for storage vol upload & download and default event loop

parent cfc75e62
......@@ -3393,6 +3393,45 @@ get_info(vol)
OUTPUT:
RETVAL
void
download(vol, st, offsetsv, lengthsv, flags=0)
virStorageVolPtr vol;
virStreamPtr st;
SV *offsetsv;
SV *lengthsv;
unsigned int flags;
PREINIT:
unsigned long long offset;
unsigned long long length;
PPCODE:
offset = virt_SvIVull(offsetsv);
length = virt_SvIVull(lengthsv);
if (virStorageVolDownload(vol, st, offset, length, flags) < 0) {
_croak_error(virGetLastError());
}
void
upload(vol, st, offsetsv, lengthsv, flags=0)
virStorageVolPtr vol;
virStreamPtr st;
SV *offsetsv;
SV *lengthsv;
unsigned int flags;
PREINIT:
unsigned long long offset;
unsigned long long length;
PPCODE:
offset = virt_SvIVull(offsetsv);
length = virt_SvIVull(lengthsv);
if (virStorageVolUpload(vol, st, offset, length, flags) < 0) {
_croak_error(virGetLastError());
}
void
DESTROY(vol_rv)
SV *vol_rv;
......@@ -4042,6 +4081,16 @@ _register_impl()
_event_update_timeout,
_event_remove_timeout);
void
register_default()
PPCODE:
virEventRegisterDefaultImpl();
void
run_default()
PPCODE:
virEventRunDefaultImpl();
void
_run_handle_callback_helper(watch, fd, event, cbref, opaqueref)
int watch;
......
......@@ -43,6 +43,13 @@ use warnings;
our $eventimpl = undef;
=item register_default()
Register the default libvirt event loop implementation
=item run_default()
Run a single iteration of the default event loop implementation
=item register($impl)
......
......@@ -114,6 +114,18 @@ capacity for sparse, or grow-on-demand volumes. The allocation
may also be larger than the capacity, if there is a metadata overhead
for the volume format.
=item $vol->download($st, $offset, $length);
Download data from C<$vol> using the stream C<$st>. If C<$offset>
and C<$length> are non-zero, then restrict data to the specified
volume byte range.
=item $vol->upload($st, $offset, $length);
Upload data to C<$vol> using the stream C<$st>. If C<$offset>
and C<$length> are non-zero, then restrict data to the specified
volume byte range.
=back
=head1 CONSTANTS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment