On Tue, Oct 06, 2015 at 02:25:07PM +1100, David Gibson wrote: > On Mon, Oct 05, 2015 at 04:13:30PM +0200, Paolo Bonzini wrote: > > > > > > On 03/10/2015 02:25, Alexey Kardashevskiy wrote: > > >> I think this is the aim of VMSTATE_UINT64_EQUAL() ? > > > > > > We use it only for things which cannot be set via the command line > > > and ideally there should be no VMSTATE_*_EQUAL. If something can be > > > set via the command line, then the management software (read - > > > libvirt) runs QEMU with explicit parameters to guarantee that these > > > are equal. > > > > VMSTATE_*_EQUAL is used when a value is later used as e.g. the size of > > an array. It basically provides bounds checking for the subsequent > > array, avoiding that an invalid migration file or an error issuing the > > QEMU command on the destination transforms into a buffer overflow. > > > > Michael Roth did most of this work, IIRC. Documenting it in > > docs/migration.txt would be nice. > > Ah.. which means we probably should use VMSTATE_*_EQUAL here since the > window size determines the size of the array of actual TCEs to follow > shortly.
Wait.. no we don't. The vmstate for the sPAPRTCETable object which actually holds the IOMMU page table information already has a suitable VMSTATE_*_EQUAL to protect the variable sized array, so we don't need another one here. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature