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 15:30:41 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Oct 03, 2011 at 08:18:31AM -0500, Anthony Liguori wrote:
> On 10/03/2011 08:10 AM, Stefan Berger wrote:
> >I am doing that. Indefinite length encoding *would* be a problem because you
> >cannot push the size onto the stack so that you could skip to the end of the
> >structure.
> 
> For an indefinite length encoding, you just have to keep reading the
> stream at end_struct until you hit the canary tag ignoring anything
> you encounter.
> 
> Regards,
> 
> Anthony Liguori

That's not exactly right: one indefinite length encoding can be nested
within the other. So what we must do is keep reading, read out,
decode and skip regular length encodings, and count the
nesting of indefinite length encodings. When we see bit 7 set,
we increase nesting. When we see end of content, we descrease nesting.
Stop when nesting reaches 0.

-- 
MST



reply via email to

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