qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Orit Wasserman <owasserm@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v6 02/11] Add uleb encoding/decoding functions
Date: Wed, 25 Jan 2012 14:22:23 +0200	[thread overview]
Message-ID: <4F1FF3FF.2010602@redhat.com> (raw)
In-Reply-To: <4F1FEC18.5040804@redhat.com>

On 01/25/2012 01:48 PM, Avi Kivity wrote:
> On 01/25/2012 01:26 PM, Orit Wasserman wrote:
>> Implement Unsigned Little Endian Base 128.
>>
>>  
>> +/* ULEB128 */
>> +int uleb128_encode_small(uint8_t *out, uint32_t n);
>> +int uleb128_decode_small(const uint8 *in, uint32_t *n);
>> +
>>  #endif
>> diff --git a/savevm.c b/savevm.c
>> index 80be1ff..304db31 100644
>> --- a/savevm.c
>> +++ b/savevm.c
>> @@ -2297,3 +2297,29 @@ void vmstate_register_ram_global(MemoryRegion *mr)
>>  {
>>      vmstate_register_ram(mr, NULL);
>>  }
>> +
>> +/* ULEB128 */
>> +int uleb128_encode_small(uint8_t *out, uint32_t n)
>> +{
> 
> assert(n <= 0x3fff);
> 
>> +    if (n < 0x80) {
>> +        *out++ = n;
>> +        return 1;
>> +    } else {
>> +        *out++ = (n & 0x7f) | 0x80;
>> +        *out++ = n >> 7;
> 
> return 2?
oops , where did it go ...
I will fix it asp.
> 
>> +    }
>> +    return 0;
>> +}
>> +
>> +int uleb128_decode_small(const uint8 *in, uint32_t *n)
>> +{
>> +    if (!(*in & 0x80)) {
>> +        *n = *in++;
>> +        return 1;
>> +    } else {
>> +        *n = *in++ & 0x7f;
> 
> assert(!(*in & 0x80));
> 
>> +        *n |= *in++ << 7;
>> +        return 0;
> 
> return 2?
> 
>> +    }
>> +}
>> +
> 
> 

  reply	other threads:[~2012-01-25 12:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-25 11:26 [Qemu-devel] [PATCH v6 00/11] XBRLE delta for live migration of large memory app Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 01/11] Add cache handling functions Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 02/11] Add uleb encoding/decoding functions Orit Wasserman
2012-01-25 11:48   ` Avi Kivity
2012-01-25 12:22     ` Orit Wasserman [this message]
2012-01-25 12:27       ` Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 03/11] Add save_block_hdr function Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 04/11] Add host_from_stream_offset_versioned function Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 05/11] Add XBZRLE to ram_save_block and ram_save_live Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 06/11] Add MigrationParams structure Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 07/11] Add XBZRLE parameters to MigrationState Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 08/11] Add migration capabilties Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 09/11] Add set_cachesize command Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 10/11] Add XBZRLE option to migrate command Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 11/11] Add XBZRLE statstics information Orit Wasserman
2012-01-25 11:53 ` [Qemu-devel] [PATCH v6 00/11] XBRLE delta for live migration of large memory app Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F1FF3FF.2010602@redhat.com \
    --to=owasserm@redhat.com \
    --cc=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).