summaryrefslogtreecommitdiffstats
path: root/libvirt/generator.pl
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2008-01-20 12:08:15 +0000
committerRichard W.M. Jones <rjones@redhat.com>2008-01-20 12:08:15 +0000
commitcb83441a2e80b7e57ea0010ca010ea939b416506 (patch)
treee1ac8f3cd3823022a21e2c7593880ee207cf56e8 /libvirt/generator.pl
parent77448a532e21983b65664e33525d18e76f41e348 (diff)
downloadvirt-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-xlibvirt/generator.pl6
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