Patchwork [v3,3/9] Update bytes_xfer in qemu_put_byte

login
register
mail settings
Submitter Orit Wasserman
Date March 21, 2013, 4:05 p.m.
Message ID <1363881940-27505-4-git-send-email-owasserm@redhat.com>
Download mbox | patch
Permalink /patch/229751/
State New
Headers show

Comments

Orit Wasserman - March 21, 2013, 4:05 p.m.
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
---
 savevm.c | 2 ++
 1 file changed, 2 insertions(+)
Juan Quintela - March 21, 2013, 5:06 p.m.
Orit Wasserman <owasserm@redhat.com> wrote:
> Signed-off-by: Orit Wasserman <owasserm@redhat.com>

Acked-by: Juan Quintela <quintela@redhat.com>
Eric Blake - March 21, 2013, 5:38 p.m.
On 03/21/2013 10:05 AM, Orit Wasserman wrote:
> Signed-off-by: Orit Wasserman <owasserm@redhat.com>
> ---
>  savevm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/savevm.c b/savevm.c
> index baa45ae..686c8c8 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -647,6 +647,8 @@ void qemu_put_byte(QEMUFile *f, int v)
>  
>      f->buf[f->buf_index++] = v;
>      f->is_write = 1;
> +    f->bytes_xfer += 1;

Why ' += 1' instead of the shorter '++'?
Orit Wasserman - March 21, 2013, 5:41 p.m.
On 03/21/2013 07:38 PM, Eric Blake wrote:
> On 03/21/2013 10:05 AM, Orit Wasserman wrote:
>> Signed-off-by: Orit Wasserman <owasserm@redhat.com>
>> ---
>>  savevm.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/savevm.c b/savevm.c
>> index baa45ae..686c8c8 100644
>> --- a/savevm.c
>> +++ b/savevm.c
>> @@ -647,6 +647,8 @@ void qemu_put_byte(QEMUFile *f, int v)
>>  
>>      f->buf[f->buf_index++] = v;
>>      f->is_write = 1;
>> +    f->bytes_xfer += 1;
> 
> Why ' += 1' instead of the shorter '++'?
> 
It compiles to the same code but I can change it :)

Patch

diff --git a/savevm.c b/savevm.c
index baa45ae..686c8c8 100644
--- a/savevm.c
+++ b/savevm.c
@@ -647,6 +647,8 @@  void qemu_put_byte(QEMUFile *f, int v)
 
     f->buf[f->buf_index++] = v;
     f->is_write = 1;
+    f->bytes_xfer += 1;
+
     if (f->buf_index >= IO_BUF_SIZE) {
         qemu_fflush(f);
     }