On Thu, Feb 23, 2012 at 01:44:35AM +0200, Zeeshan Ali (Khattak) wrote:
> On Thu, Feb 23, 2012 at 1:25 AM, Daniel P. Berrange <[email protected]> 
> wrote:
> > Yep, the name is about the only difference between them - all the ISO
> > metadata is identical. The other thing I considered is to add an MD5
> > checksum of the ISO file, which would trivially distinguish them,
> > but I fear that would make it too unique.
> 
> That might be a very good idea actually (Christophe was meaning to do
> that any ways?) but calculation of md5 takes a very long time:

I wondered out loud if it would be a good idea to have that in the
database, that's it :)

> so I'll recommend to restrict it to first N bytes, where we could
> think/discuss the value of N but 1MiB should be good enough and takes
> very little time:

Yup, this is what I was thinking too before reading your email.

> $ time dd if=~/ISOs/Fedora-16-x86_64-DVD.iso bs=1M count=1 2> /dev/null 
> |md5sum
> e25ea147176f24239d38a46f501bd25e  -
> 
> real  0m0.011s
> user  0m0.004s
> sys   0m0.008s
> 
> Actually if we start using md5sum for detection, we can pretty much
> remove all other detection logic/extraction.

Depends, the other logic will be much faster if for some reason we end up
trying to identify remote medias over a slow link.

Christophe

Attachment: pgpYj5DUXsQLg.pgp
Description: PGP signature

_______________________________________________
virt-tools-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-tools-list

Reply via email to