qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC 2/3] memory: implement checkpoint handling


From: Bohdan Trach
Subject: Re: [Qemu-devel] [PATCH RFC 2/3] memory: implement checkpoint handling
Date: Tue, 17 Nov 2015 16:38:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/16/2015 05:56 PM, Dr. David Alan Gilbert wrote:
> Is anything in qemu/int128.h  useful here?
> However, as mentioned in my previous follow up,
> I think you need something stronger than MD5 to stop collisions;
> sha256 seems appropriate and CPUs have acceleration instructions
> for it these days.

Ok, we will switch to the SHA256 hash from GnuTLS.

> You seem to do this trick of declaring and then defining a lot;
> if you need it only within a file then make it static and then you
> don't need the declaration unless you use it before it's definition.
> If you want to use it outside of this file then the declaration should
> be in a header.

Will fix this.

> I guess this stuff should be in migration/ram.c these days?

Yes, this code was written for 2.3 branch, and definitely needs
updating.

> Nice name; but if you're using a cute name make sure that you put
> a big comment to let people know what they're looking at!

Will fix this.

> This also makes it PC specific; what about everything else?

I believe if we switch to existing memory dump formats this restriction
will be removed.

>> +    /* Ignore checkpoint file if size is different from VM's current memory 
>> size. */
>> +    assert(sb.st_size == ram_size);
> 
> Why does this matter? Can't you reuse the hash of pages that are at different
> locations in the stored file? e.g. a hash from an old/future boot of the same
> VM or one where the page got moved but unchanged?

Here we check if the size of the main memory block matches the
checkpoint. As we didn't use any format, we wanted to detect at least
some cases where a checkpoint from a different VM is passed to Qemu by
accident.

> --
> Dr. David Alan Gilbert / address@hidden / Manchester, UK
> 

-- 
With best regards,
Bohdan Trach



reply via email to

[Prev in Thread] Current Thread [Next in Thread]