Re: [PATCH] esx: Use MD5 sum of mount path as storage pool UUID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/08/2010 02:56 PM, Matthias Bolte wrote:
> With the previous storage pool UUID source not all storage pools
> had a proper UUID, especially GSX storage pools. The mount path
> is unique per host and cannot change during the lifetime of the
> datastore. Therefore, its MD5 sum can be used as UUID.
> 
> Use gnulib's crypto/md5 module to generate the MD5 sum.

It looks like others have agreed on the approach; but I didn't see an
actual ACK.  So just in case:

> @@ -197,10 +198,7 @@ esxStoragePoolLookupByName(virConnectPtr conn, const char *name)
>      esxPrivate *priv = conn->storagePrivateData;
>      esxVI_ObjectContent *datastore = NULL;
>      esxVI_DatastoreHostMount *hostMount = NULL;
> -    char *suffix = NULL;
> -    int suffixLength;
> -    char uuid_string[VIR_UUID_STRING_BUFLEN] = "00000000-00000000-0000-000000000000";
> -    unsigned char uuid[VIR_UUID_BUFLEN];
> +    unsigned char md5[MD5_DIGEST_SIZE]; /* MD5_DIGEST_SIZE = VIR_UUID_BUFLEN = 16 */

Is it worth also adding:

#include "verify.h"
...
verify(MD5_DIGEST_SIZE == VIR_UUID_BUFLEN)

to enforce this comment's correctness?

ACK with that nit addressed.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]