[virt-tools-list] [virt-manager PATCH] Fix UUID generation according to RFC 4122

Cole Robinson crobinso at redhat.com
Fri Aug 16 16:21:54 UTC 2013


On 08/16/2013 12:09 PM, Giuseppe Scrivano wrote:
> Martin Kletzander <mkletzan at redhat.com> writes:
> 
>> In commit 74aa8c8a, I somehow made an off-by-one error even though
>> that code was almost copy-paste from libvirt's commit 396c4d34.
>> ---
>>  virtinst/util.py | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/virtinst/util.py b/virtinst/util.py
>> index f1bc5c3..0ddf051 100644
>> --- a/virtinst/util.py
>> +++ b/virtinst/util.py
>> @@ -378,8 +378,8 @@ def randomUUID(conn):
>>          return "00000000-1111-2222-3333-444444444444"
> 
> 
> The change seems fine.
> 
> Do you think it would make sense to replace
> "00000000-1111-2222-3333-444444444444" with
> "00000000-1111-4222-b333-444444444444" all over the tree?  It shouldn't
> make any difference as it is used only by tests but still it is an
> incorrect UUID.
> 

Doesn't hurt, maybe one day libvirt will tighten it's validation and our test
suite will start to error.

> Not in the scope of this patch: should util.validate_uuid be changed as
> well?
> 

Let's let libvirt or the hypervisor handle the nitty gritty validation if it
cares, validate_uuid can just be about the format of the data that a user
passes in. Unlikely, but someone out there might be using an 'invalid' UUID
that for all intents works correctly, no need to start erroring on them.

- Cole




More information about the virt-tools-list mailing list