qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [RFC] New Migration Protocol using Visitor Interface
Date: Mon, 3 Oct 2011 17:42:21 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Oct 03, 2011 at 09:56:47AM -0500, Anthony Liguori wrote:
> On 10/03/2011 09:18 AM, Michael S. Tsirkin wrote:
> >>skip_indefinite:
> >>   while tag != CANARY:
> >>     if tag == INT:
> >>       visit_type_int(v, NULL, NULL, errp);
> >>     elif tag == STRING:
> >>       visit_type_str(v, NULL, NULL, errp);
> >>     elif tag == INDEFINITE:
> >>       visit_start_struct(v, NULL, NULL, errp);
> >>       skip_indefinite(v, errp);
> >>       visit_end_struct(v, NULL, NULL, errp);
> >>
> >>end_struct:
> >>   v->skip = true;
> >>   skip_indefinite(v, errp);
> >>   v->skip = false;
> >>
> >>Regards,
> >>
> >>Anthony Liguori
> >
> >This implementation is recursive, which has the problem
> >of wasting unlimited resources to skip bad input.
> >And we really do not need to look at tag at all. Just
> >the length.
> 
> That's just one implementation.  You could certainly do a
> non-recursive implementation.
> 
> Regards,
> 
> Anthony Liguori

What I was saying exactly: we do not need to
maintain a stack to skip an indefinite length field,
just a nesting counter will do.

> >



reply via email to

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