ia64/xen-unstable

changeset 19832:f1fec38c8228

blktap2: Further netbsd build fixes.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jun 24 14:03:20 2009 +0100 (2009-06-24)
parents b51f9542ab14
children f3a909c8e8e6
files tools/blktap2/drivers/block-vhd.c tools/blktap2/include/blk_uuid.h tools/blktap2/include/libvhd-journal.h tools/blktap2/include/libvhd.h tools/blktap2/include/uuid.h tools/blktap2/include/vhd.h tools/blktap2/vhd/lib/libvhd-journal.c tools/blktap2/vhd/lib/libvhd.c tools/blktap2/vhd/lib/vhd-util-check.c tools/blktap2/vhd/lib/vhd-util-read.c
line diff
     1.1 --- a/tools/blktap2/drivers/block-vhd.c	Wed Jun 24 11:17:11 2009 +0100
     1.2 +++ b/tools/blktap2/drivers/block-vhd.c	Wed Jun 24 14:03:20 2009 +0100
     1.3 @@ -806,7 +806,7 @@ vhd_validate_parent(td_driver_t *child_d
     1.4  	}
     1.5  	*/
     1.6  
     1.7 -	if (uuid_compare(child->vhd.header.prt_uuid, parent->vhd.footer.uuid)) {
     1.8 +	if (blk_uuid_compare(&child->vhd.header.prt_uuid, &parent->vhd.footer.uuid)) {
     1.9  		DPRINTF("ERROR: %s: %s, %s: parent uuid has changed since "
    1.10  			"snapshot.  Child image no longer valid.\n",
    1.11  			__func__, child->vhd.file, parent->vhd.file);
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tools/blktap2/include/blk_uuid.h	Wed Jun 24 14:03:20 2009 +0100
     2.3 @@ -0,0 +1,126 @@
     2.4 +/* Copyright (c) 2008, XenSource Inc.
     2.5 + * All rights reserved.
     2.6 + *
     2.7 + * Redistribution and use in source and binary forms, with or without
     2.8 + * modification, are permitted provided that the following conditions are met:
     2.9 + *     * Redistributions of source code must retain the above copyright
    2.10 + *       notice, this list of conditions and the following disclaimer.
    2.11 + *     * Redistributions in binary form must reproduce the above copyright
    2.12 + *       notice, this list of conditions and the following disclaimer in the
    2.13 + *       documentation and/or other materials provided with the distribution.
    2.14 + *     * Neither the name of XenSource Inc. nor the names of its contributors
    2.15 + *       may be used to endorse or promote products derived from this software
    2.16 + *       without specific prior written permission.
    2.17 + *
    2.18 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    2.19 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    2.20 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    2.21 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
    2.22 + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    2.23 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    2.24 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    2.25 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    2.26 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    2.27 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    2.28 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2.29 +*/
    2.30 +#ifndef __BLKTAP2_UUID_H__
    2.31 +#define __BLKTAP2_UUID_H__
    2.32 +
    2.33 +#if defined(__linux__) || defined(__Linux__)
    2.34 +
    2.35 +#include <uuid/uuid.h>
    2.36 +
    2.37 +typedef struct {
    2.38 +    uuid_t uuid;
    2.39 +} blk_uuid_t;
    2.40 +
    2.41 +static inline int blk_uuid_is_nil(blk_uuid_t *uuid)
    2.42 +{
    2.43 +	return uuid_is_null(uuid->uuid);
    2.44 +}
    2.45 +
    2.46 +static inline void blk_uuid_generate(blk_uuid_t *uuid)
    2.47 +{
    2.48 +	uuid_generate(uuid->uuid);
    2.49 +}
    2.50 +
    2.51 +static inline void blk_uuid_to_string(blk_uuid_t *uuid, char *out)
    2.52 +{
    2.53 +	uuid_unparse(uuid->uuid, out);
    2.54 +}
    2.55 +
    2.56 +static inline void blk_uuid_from_string(blk_uuid_t *uuid, const char *in)
    2.57 +{
    2.58 +	uuid_parse(in, uuid->uuid);
    2.59 +}
    2.60 +
    2.61 +static inline void blk_uuid_copy(blk_uuid_t *dst, blk_uuid_t *src)
    2.62 +{
    2.63 +	uuid_copy(dst->uuid, src->uuid);
    2.64 +}
    2.65 +
    2.66 +static inline void blk_uuid_clear(blk_uuid_t *uuid)
    2.67 +{
    2.68 +	uuid_clear(uuid->uuid);
    2.69 +}
    2.70 +
    2.71 +static inline int blk_uuid_compare(blk_uuid_t *uuid1, blk_uuid_t *uuid2)
    2.72 +{
    2.73 +	return uuid_compare(uuid1->uuid, uuid2->uuid);
    2.74 +}
    2.75 +
    2.76 +#elif defined(__NetBSD__)
    2.77 +
    2.78 +#include <uuid.h>
    2.79 +#include <string.h>
    2.80 +
    2.81 +typedef uuid_t blk_uuid_t;
    2.82 +
    2.83 +static inline int blk_uuid_is_nil(blk_uuid_t *uuid)
    2.84 +{
    2.85 +	uint32_t status;
    2.86 +	return uuid_is_nil((uuid_t *)uuid, &status);
    2.87 +}
    2.88 +
    2.89 +static inline void blk_uuid_generate(blk_uuid_t *uuid)
    2.90 +{
    2.91 +	uint32_t status;
    2.92 +	uuid_create((uuid_t *)uuid, &status);
    2.93 +}
    2.94 +
    2.95 +static inline void blk_uuid_to_string(blk_uuid_t *uuid, char *out)
    2.96 +{
    2.97 +	uint32_t status;
    2.98 +	uuid_to_string((uuid_t *)uuid, &out, &status);
    2.99 +}
   2.100 +
   2.101 +static inline void blk_uuid_from_string(blk_uuid_t *uuid, const char *in)
   2.102 +{
   2.103 +	uint32_t status;
   2.104 +	uuid_from_string(in, (uuid_t *)uuid, &status);
   2.105 +}
   2.106 +
   2.107 +static inline void blk_uuid_copy(blk_uuid_t *dst, blk_uuid_t *src)
   2.108 +{
   2.109 +	memcpy((uuid_t *)dst, (uuid_t *)src, sizeof(uuid_t));
   2.110 +}
   2.111 +
   2.112 +static inline void blk_uuid_clear(blk_uuid_t *uuid)
   2.113 +{
   2.114 +	memset((uuid_t *)uuid, 0, sizeof(uuid_t));
   2.115 +}
   2.116 +
   2.117 +static inline int blk_uuid_compare(blk_uuid_t *uuid1, blk_uuid_t *uuid2)
   2.118 +{
   2.119 +	uint32_t status;
   2.120 +	return uuid_compare((uuid_t *)uuid1, (uuid_t *)uuid2, &status);
   2.121 +}
   2.122 +
   2.123 +#else
   2.124 +
   2.125 +#error "Please update blk_uuid.h for your OS"
   2.126 +
   2.127 +#endif
   2.128 +
   2.129 +#endif /* __BLKTAP2_UUID_H__ */
     3.1 --- a/tools/blktap2/include/libvhd-journal.h	Wed Jun 24 11:17:11 2009 +0100
     3.2 +++ b/tools/blktap2/include/libvhd-journal.h	Wed Jun 24 14:03:20 2009 +0100
     3.3 @@ -39,7 +39,7 @@
     3.4  
     3.5  typedef struct vhd_journal_header {
     3.6  	char                       cookie[8];
     3.7 -	uuid_t                     uuid;
     3.8 +	blk_uuid_t                 uuid;
     3.9  	uint64_t                   vhd_footer_offset;
    3.10  	uint32_t                   journal_data_entries;
    3.11  	uint32_t                   journal_metadata_entries;
     4.1 --- a/tools/blktap2/include/libvhd.h	Wed Jun 24 11:17:11 2009 +0100
     4.2 +++ b/tools/blktap2/include/libvhd.h	Wed Jun 24 14:03:20 2009 +0100
     4.3 @@ -36,7 +36,7 @@
     4.4  #include <sys/bswap.h>
     4.5  #endif
     4.6  
     4.7 -#include "uuid.h"
     4.8 +#include "blk_uuid.h"
     4.9  #include "vhd.h"
    4.10  
    4.11  #ifndef O_LARGEFILE
    4.12 @@ -216,7 +216,7 @@ vhd_parent_locator_size(vhd_parent_locat
    4.13  static inline int
    4.14  vhd_parent_raw(vhd_context_t *ctx)
    4.15  {
    4.16 -	return uuid_is_null(ctx->header.prt_uuid);
    4.17 +	return blk_uuid_is_nil(&ctx->header.prt_uuid);
    4.18  }
    4.19  
    4.20  void libvhd_set_log_level(int);
     5.1 --- a/tools/blktap2/include/uuid.h	Wed Jun 24 11:17:11 2009 +0100
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,73 +0,0 @@
     5.4 -/* Copyright (c) 2008, XenSource Inc.
     5.5 - * All rights reserved.
     5.6 - *
     5.7 - * Redistribution and use in source and binary forms, with or without
     5.8 - * modification, are permitted provided that the following conditions are met:
     5.9 - *     * Redistributions of source code must retain the above copyright
    5.10 - *       notice, this list of conditions and the following disclaimer.
    5.11 - *     * Redistributions in binary form must reproduce the above copyright
    5.12 - *       notice, this list of conditions and the following disclaimer in the
    5.13 - *       documentation and/or other materials provided with the distribution.
    5.14 - *     * Neither the name of XenSource Inc. nor the names of its contributors
    5.15 - *       may be used to endorse or promote products derived from this software
    5.16 - *       without specific prior written permission.
    5.17 - *
    5.18 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    5.19 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    5.20 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    5.21 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
    5.22 - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    5.23 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    5.24 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    5.25 - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    5.26 - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    5.27 - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    5.28 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    5.29 -*/
    5.30 -#ifndef __BLKTAP2_UUID_H__
    5.31 -#define __BLKTAP2_UUID_H__
    5.32 -
    5.33 -#if defined(__linux__) || defined(__Linux__)
    5.34 -
    5.35 -#include <uuid/uuid.h>
    5.36 -
    5.37 -#else
    5.38 -
    5.39 -#include <inttypes.h>
    5.40 -#include <string.h>
    5.41 -#include <uuid.h>
    5.42 -
    5.43 -static inline int uuid_is_null(uuid_t uuid)
    5.44 -{
    5.45 -    uint32_t status;
    5.46 -    return uuid_is_nil(&uuid, &status);
    5.47 -}
    5.48 -
    5.49 -static inline void uuid_generate(uuid_t uuid)
    5.50 -{
    5.51 -    uint32_t status;
    5.52 -    uuid_create(&uuid, &status);
    5.53 -}
    5.54 -
    5.55 -static inline void uuid_unparse(uuid_t uuid, char *out)
    5.56 -{
    5.57 -    uint32_t status;
    5.58 -    uuid_to_string(&uuid, (char **)&out, &status);
    5.59 -}
    5.60 -
    5.61 -static inline void uuid_copy(uuid_t dst, uuid_t src)
    5.62 -{
    5.63 -    memcpy(dst, src, sizeof(dst));
    5.64 -}
    5.65 -
    5.66 -static inline void uuid_clear(uuid_t uu)
    5.67 -{
    5.68 -    memset(uu, 0, sizeof(uu));
    5.69 -}
    5.70 -
    5.71 -#define uuid_compare(x,y) \
    5.72 -    ({ uint32_t status; uuid_compare(&(x),&(y),&status); })
    5.73 -
    5.74 -#endif
    5.75 -
    5.76 -#endif /* __BLKTAP2_UUID_H__ */
     6.1 --- a/tools/blktap2/include/vhd.h	Wed Jun 24 11:17:11 2009 +0100
     6.2 +++ b/tools/blktap2/include/vhd.h	Wed Jun 24 14:03:20 2009 +0100
     6.3 @@ -28,7 +28,6 @@
     6.4  #define __VHD_H__
     6.5  
     6.6  #include <inttypes.h>
     6.7 -#include "uuid.h"
     6.8  
     6.9  typedef uint32_t u32;
    6.10  typedef uint64_t u64;
    6.11 @@ -60,7 +59,7 @@ struct hd_ftr {
    6.12    u32    geometry;        /* Disk geometry                                */
    6.13    u32    type;            /* Disk type                                    */
    6.14    u32    checksum;        /* 1's comp sum of this struct.                 */
    6.15 -  uuid_t uuid;            /* Unique disk ID, used for naming parents      */
    6.16 +  blk_uuid_t uuid;        /* Unique disk ID, used for naming parents      */
    6.17    char   saved;           /* one-bit -- is this disk/VM in a saved state? */
    6.18    char   hidden;          /* tapdisk-specific field: is this vdi hidden?  */
    6.19    char   reserved[426];   /* padding                                      */
    6.20 @@ -148,7 +147,7 @@ struct dd_hdr {
    6.21    u32    max_bat_size;    /* Maximum number of entries in the BAT         */
    6.22    u32    block_size;      /* Block size in bytes. Must be power of 2.     */
    6.23    u32    checksum;        /* Header checksum.  1's comp of all fields.    */
    6.24 -  uuid_t prt_uuid;        /* ID of the parent disk.                       */
    6.25 +  blk_uuid_t prt_uuid;    /* ID of the parent disk.                       */
    6.26    u32    prt_ts;          /* Modification time of the parent disk         */
    6.27    u32    res1;            /* Reserved.                                    */
    6.28    char   prt_name[512];   /* Parent unicode name.                         */
     7.1 --- a/tools/blktap2/vhd/lib/libvhd-journal.c	Wed Jun 24 11:17:11 2009 +0100
     7.2 +++ b/tools/blktap2/vhd/lib/libvhd-journal.c	Wed Jun 24 14:03:20 2009 +0100
     7.3 @@ -237,7 +237,7 @@ vhd_journal_add_journal_header(vhd_journ
     7.4  	if (err)
     7.5  		return err;
     7.6  
     7.7 -	uuid_copy(j->header.uuid, vhd->footer.uuid);
     7.8 +	blk_uuid_copy(&j->header.uuid, &vhd->footer.uuid);
     7.9  	memcpy(j->header.cookie,
    7.10  	       VHD_JOURNAL_HEADER_COOKIE, sizeof(j->header.cookie));
    7.11  	j->header.vhd_footer_offset = off - sizeof(vhd_footer_t);
     8.1 --- a/tools/blktap2/vhd/lib/libvhd.c	Wed Jun 24 11:17:11 2009 +0100
     8.2 +++ b/tools/blktap2/vhd/lib/libvhd.c	Wed Jun 24 14:03:20 2009 +0100
     8.3 @@ -1308,7 +1308,8 @@ vhd_macx_encode_location(char *name, cha
     8.4  	iconv_t cd;
     8.5  	int len, err;
     8.6  	size_t ibl, obl;
     8.7 -	char *uri, *urip, *uri_utf8, *uri_utf8p, *ret;
     8.8 +	char *uri, *uri_utf8, *uri_utf8p, *ret;
     8.9 +	const char *urip;
    8.10  
    8.11  	err     = 0;
    8.12  	ret     = NULL;
    8.13 @@ -1319,7 +1320,7 @@ vhd_macx_encode_location(char *name, cha
    8.14  	ibl     = len;
    8.15  	obl     = len;
    8.16  
    8.17 -	uri = urip = malloc(ibl + 1);
    8.18 +	urip = uri = malloc(ibl + 1);
    8.19  	uri_utf8 = uri_utf8p = malloc(obl);
    8.20  
    8.21  	if (!uri || !uri_utf8)
    8.22 @@ -1333,7 +1334,11 @@ vhd_macx_encode_location(char *name, cha
    8.23  
    8.24  	snprintf(uri, ibl+1, "file://%s", name);
    8.25  
    8.26 -	if (iconv(cd, &urip, &ibl, &uri_utf8p, &obl) == (size_t)-1 ||
    8.27 +	if (iconv(cd,
    8.28 +#if defined(__linux__) || (__Linux__)
    8.29 +	    (char **)
    8.30 +#endif
    8.31 +	    &urip, &ibl, &uri_utf8p, &obl) == (size_t)-1 ||
    8.32  	    ibl || obl) {
    8.33  		err = (errno ? -errno : -EIO);
    8.34  		goto out;
    8.35 @@ -1364,7 +1369,8 @@ vhd_w2u_encode_location(char *name, char
    8.36  	iconv_t cd;
    8.37  	int len, err;
    8.38  	size_t ibl, obl;
    8.39 -	char *uri, *urip, *uri_utf16, *uri_utf16p, *tmp, *ret;
    8.40 +	char *uri, *uri_utf16, *uri_utf16p, *tmp, *ret;
    8.41 +	const char *urip;
    8.42  
    8.43  	err     = 0;
    8.44  	ret     = NULL;
    8.45 @@ -1418,7 +1424,11 @@ vhd_w2u_encode_location(char *name, char
    8.46  		goto out;
    8.47  	}
    8.48  
    8.49 -	if (iconv(cd, &urip, &ibl, &uri_utf16p, &obl) == (size_t)-1 ||
    8.50 +	if (iconv(cd,
    8.51 +#if defined(__linux__) || (__Linux__)
    8.52 +	    (char **)
    8.53 +#endif
    8.54 +	    &urip, &ibl, &uri_utf16p, &obl) == (size_t)-1 ||
    8.55  	    ibl || obl) {
    8.56  		err = (errno ? -errno : -EIO);
    8.57  		goto out;
    8.58 @@ -1459,7 +1469,11 @@ vhd_macx_decode_location(const char *in,
    8.59  	if (cd == (iconv_t)-1) 
    8.60  		return NULL;
    8.61  
    8.62 -	if (iconv(cd, (char **)&in, &ibl, &out, &obl) == (size_t)-1 || ibl)
    8.63 +	if (iconv(cd,
    8.64 +#if defined(__linux__) || defined(__Linux__)
    8.65 +		(char **)
    8.66 +#endif
    8.67 +		&in, &ibl, &out, &obl) == (size_t)-1 || ibl)
    8.68  		return NULL;
    8.69  
    8.70  	iconv_close(cd);
    8.71 @@ -1487,7 +1501,11 @@ vhd_w2u_decode_location(const char *in, 
    8.72  	if (cd == (iconv_t)-1) 
    8.73  		return NULL;
    8.74  
    8.75 -	if (iconv(cd, (char **)&in, &ibl, &out, &obl) == (size_t)-1 || ibl)
    8.76 +	if (iconv(cd,
    8.77 +#if defined(__linux__) || defined(__Linux__)
    8.78 +		(char **)
    8.79 +#endif
    8.80 +		&in, &ibl, &out, &obl) == (size_t)-1 || ibl)
    8.81  		return NULL;
    8.82  
    8.83  	iconv_close(cd);
    8.84 @@ -2435,7 +2453,7 @@ vhd_initialize_footer(vhd_context_t *ctx
    8.85  	ctx->footer.saved        = 0;
    8.86  	ctx->footer.data_offset  = 0xFFFFFFFFFFFFFFFF;
    8.87  	strcpy(ctx->footer.crtr_app, "tap");
    8.88 -	uuid_generate(ctx->footer.uuid);
    8.89 +	blk_uuid_generate(&ctx->footer.uuid);
    8.90  }
    8.91  
    8.92  static int
    8.93 @@ -2479,7 +2497,11 @@ vhd_initialize_header_parent_name(vhd_co
    8.94  
    8.95  	memset(dst, 0, obl);
    8.96  
    8.97 -	if (iconv(cd, (char **)&pname, &ibl, &dst, &obl) == (size_t)-1 || ibl)
    8.98 +	if (iconv(cd,
    8.99 +#if defined(__linux__) || defined(__Linux__)
   8.100 +		(char **)
   8.101 +#endif
   8.102 +		&pname, &ibl, &dst, &obl) == (size_t)-1 || ibl)
   8.103  		err = (errno ? -errno : -EINVAL);
   8.104  
   8.105  out:
   8.106 @@ -2546,7 +2568,7 @@ vhd_initialize_header(vhd_context_t *ctx
   8.107  			return err;
   8.108  
   8.109  		ctx->header.prt_ts = vhd_time(stats.st_mtime);
   8.110 -		uuid_copy(ctx->header.prt_uuid, parent.footer.uuid);
   8.111 +		blk_uuid_copy(&ctx->header.prt_uuid, &parent.footer.uuid);
   8.112  		if (!size)
   8.113  			size = parent.footer.curr_size;
   8.114  		vhd_close(&parent);
   8.115 @@ -2628,7 +2650,7 @@ vhd_change_parent(vhd_context_t *child, 
   8.116  	}
   8.117  
   8.118  	if (raw) {
   8.119 -		uuid_clear(child->header.prt_uuid);
   8.120 +		blk_uuid_clear(&child->header.prt_uuid);
   8.121  	} else {
   8.122  		err = vhd_open(&parent, ppath, VHD_OPEN_RDONLY);
   8.123  		if (err) {
   8.124 @@ -2636,7 +2658,7 @@ vhd_change_parent(vhd_context_t *child, 
   8.125  			       ppath, child->file, err);
   8.126  			goto out;
   8.127  		}
   8.128 -		uuid_copy(child->header.prt_uuid, parent.footer.uuid);
   8.129 +		blk_uuid_copy(&child->header.prt_uuid, &parent.footer.uuid);
   8.130  		vhd_close(&parent);
   8.131  	}
   8.132  
   8.133 @@ -2695,7 +2717,7 @@ vhd_create_batmap(vhd_context_t *ctx)
   8.134  	header    = &ctx->batmap.header;
   8.135  
   8.136  	memset(header, 0, sizeof(vhd_batmap_header_t));
   8.137 -	memcpy(header->cookie, VHD_BATMAP_COOKIE, sizeof(*header->cookie));
   8.138 +	memcpy(header->cookie, VHD_BATMAP_COOKIE, sizeof(header->cookie));
   8.139  
   8.140  	err = vhd_batmap_header_offset(ctx, &off);
   8.141  	if (err)
     9.1 --- a/tools/blktap2/vhd/lib/vhd-util-check.c	Wed Jun 24 11:17:11 2009 +0100
     9.2 +++ b/tools/blktap2/vhd/lib/vhd-util-check.c	Wed Jun 24 14:03:20 2009 +0100
     9.3 @@ -218,7 +218,7 @@ vhd_util_check_validate_differencing_hea
     9.4  		if (vhd_util_check_zeros(header->loc, sizeof(header->loc)))
     9.5  			return "invalid non-null parent locators";
     9.6  
     9.7 -		if (!uuid_is_null(header->prt_uuid))
     9.8 +		if (!blk_uuid_is_nil(&header->prt_uuid))
     9.9  			return "invalid non-null parent uuid";
    9.10  
    9.11  		if (header->prt_ts)
    9.12 @@ -320,7 +320,7 @@ vhd_util_check_validate_parent(vhd_conte
    9.13  				VHD_OPEN_RDONLY | VHD_OPEN_IGNORE_DISABLED))
    9.14  		return "error opening parent";
    9.15  
    9.16 -	if (uuid_compare(vhd->header.prt_uuid, parent.footer.uuid)) {
    9.17 +	if (blk_uuid_compare(&vhd->header.prt_uuid, &parent.footer.uuid)) {
    9.18  		msg = "invalid parent uuid";
    9.19  		goto out;
    9.20  	}
    10.1 --- a/tools/blktap2/vhd/lib/vhd-util-read.c	Wed Jun 24 11:17:11 2009 +0100
    10.2 +++ b/tools/blktap2/vhd/lib/vhd-util-read.c	Wed Jun 24 14:03:20 2009 +0100
    10.3 @@ -78,7 +78,7 @@ vhd_print_header(vhd_context_t *vhd, vhd
    10.4  	       (err ? "failed to read name" : name));
    10.5  	free(name);
    10.6  
    10.7 -	uuid_unparse(h->prt_uuid, uuid);
    10.8 +	blk_uuid_to_string(&h->prt_uuid, uuid);
    10.9  	printf("Parent UUID         : %s\n", uuid);
   10.10      
   10.11  	vhd_time_to_string(h->prt_ts, time_str);
   10.12 @@ -153,7 +153,7 @@ vhd_print_footer(vhd_footer_t *f, int he
   10.13  	printf("Checksum            : 0x%x|0x%x (%s)\n", f->checksum, cksm,
   10.14  		f->checksum == cksm ? "Good!" : "Bad!");
   10.15  
   10.16 -	uuid_unparse(f->uuid, uuid);
   10.17 +	blk_uuid_to_string(&f->uuid, uuid);
   10.18  	printf("UUID                : %s\n", uuid);
   10.19  
   10.20  	printf("Saved state         : %s\n", f->saved == 0 ? "No" : "Yes");