diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2008-01-20 12:08:15 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2008-01-20 12:08:15 +0000 |
commit | cb83441a2e80b7e57ea0010ca010ea939b416506 (patch) | |
tree | e1ac8f3cd3823022a21e2c7593880ee207cf56e8 /libvirt/generator.pl | |
parent | 77448a532e21983b65664e33525d18e76f41e348 (diff) | |
download | virt-top-cb83441a2e80b7e57ea0010ca010ea939b416506.tar.gz virt-top-cb83441a2e80b7e57ea0010ca010ea939b416506.tar.xz virt-top-cb83441a2e80b7e57ea0010ca010ea939b416506.zip |
Return UUID (packed byte array) correctly.
Diffstat (limited to 'libvirt/generator.pl')
-rwxr-xr-x | libvirt/generator.pl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libvirt/generator.pl b/libvirt/generator.pl index ad2069f..0a73264 100755 --- a/libvirt/generator.pl +++ b/libvirt/generator.pl @@ -562,7 +562,9 @@ sub gen_c_code NONBLOCKING (r = $c_name ($1, uuid)); CHECK_ERROR (r == -1, conn, \"$c_name\"); - rv = caml_copy_string ((char *) uuid); + /* UUIDs are byte arrays with a fixed length. */ + rv = caml_alloc_string (VIR_UUID_BUFLEN); + memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN); CAMLreturn (rv); " } elsif ($sig =~ /^(\w+) : uuid string$/) { @@ -886,7 +888,7 @@ foreach my $function (@functions) { print F <<END; /* Automatically generated binding for $c_name. - * Function signature in generator.pl is "$sig" + * In generator.pl this function has signature "$sig". */ END |