On 02/18/2011 10:03 PM, Stefan Berger wrote:
> On 02/18/2011 10:33 AM, Andreas Niederl wrote:
[...]
>> +static ISADeviceInfo tpm_info = {
>> +    .init          = tpm_init,
>> +    .qdev.name     = "tpm",
>> +    .qdev.desc     = "TPM TIS Interface",
>> +    .qdev.size     = sizeof (TPMState),
>> +    .qdev.vmsd     =&vmstate_tpm,
> ... and here you're pointing to vmstate_tpm, which was also registered
> above using
> 
> +
> +    vmstate_register(&dev->qdev, 1,&vmstate_tpm, s);
> 
> 
> Are you sure this is necessary? In my implementation I only have the
> qdev.vmsd set and need not explicitly use vmstate_register(). Aren't you
> writing the state two times if you do that?

You're right, apparently I've missed that vmstate_save_state operates
recursively on fields of type VMS_STRUCT.

Also, manual registration of vmstate_tpm is not necessary.


Andreas

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to