On Mon, Nov 23, 2009 at 01:29:11PM +0100, Juan Quintela wrote: > Gleb Natapov <g...@redhat.com> wrote: > > On Mon, Nov 23, 2009 at 10:29:12AM +0100, Paolo Bonzini wrote: > >> On 11/23/2009 09:26 AM, Gleb Natapov wrote: > >> >>>> >I'd go with chunk instead of feature bits, specifying them like in > >> >>>> >the PNG specification: > >> >>> > >> >>> You mean, each device would have multiple sections? We already use > >> >>> chunks for each device state. > >> >>> > >> >Each device can send device info in multiple formats (each format with > >> >its own ID) and destination will choose the one it supports. > >> > >> First of all, we'd need a mechanism to send _lengths_ of chunks. > > And we need the mechanism to match incoming chunks to a consumer. > > Not relay on order of incoming data. > > We already do that: > see savevm.c:qemu_loadvm_state() > Cool. Didn't know that.
> After reading a section, we call find_se(), with searchs for a > matching section, we can do the same for any subsection/chunk/<name it> > > static SaveStateEntry *find_se(const char *idstr, int instance_id) > { > SaveStateEntry *se; > > QTAILQ_FOREACH(se, &savevm_handlers, entry) { > if (!strcmp(se->idstr, idstr) && > instance_id == se->instance_id) > return se; > } > return NULL; > } > > Later, Juan. -- Gleb.