diff mbox series

[03/11] multifd: Fill offset and block for reception

Message ID 20211119165903.18813-4-quintela@redhat.com (mailing list archive)
State New, archived
Headers show
Series migration: Make multifd use only one write on the send path | expand

Commit Message

Juan Quintela Nov. 19, 2021, 4:58 p.m. UTC
We were using the iov directly, but we will need this info on the
following patch.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/multifd.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Richard Henderson Nov. 20, 2021, 12:26 p.m. UTC | #1
On 11/19/21 5:58 PM, Juan Quintela wrote:
> We were using the iov directly, but we will need this info on the
> following patch.
> 
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>   migration/multifd.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/migration/multifd.c b/migration/multifd.c
> index 7c9deb1921..e2adcdffa1 100644
> --- a/migration/multifd.c
> +++ b/migration/multifd.c
> @@ -364,6 +364,8 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
>                          offset, block->used_length);
>               return -1;
>           }
> +        p->pages->offset[i] = offset;
> +        p->pages->block = block;
>           p->pages->iov[i].iov_base = block->host + offset;
>           p->pages->iov[i].iov_len = qemu_target_page_size();
>       }
> 

Block should be stored one outside the loop.


r~
Juan Quintela Nov. 22, 2021, 9:26 a.m. UTC | #2
Richard Henderson <richard.henderson@linaro.org> wrote:
> On 11/19/21 5:58 PM, Juan Quintela wrote:
>> We were using the iov directly, but we will need this info on the
>> following patch.
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> ---
>>   migration/multifd.c | 2 ++
>>   1 file changed, 2 insertions(+)
>> diff --git a/migration/multifd.c b/migration/multifd.c
>> index 7c9deb1921..e2adcdffa1 100644
>> --- a/migration/multifd.c
>> +++ b/migration/multifd.c
>> @@ -364,6 +364,8 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
>>                          offset, block->used_length);
>>               return -1;
>>           }
>> +        p->pages->offset[i] = offset;
>> +        p->pages->block = block;
>>           p->pages->iov[i].iov_base = block->host + offset;
>>           p->pages->iov[i].iov_len = qemu_target_page_size();
>>       }
>> 
>
> Block should be stored one outside the loop.

Done.

Thanks, Juan.
diff mbox series

Patch

diff --git a/migration/multifd.c b/migration/multifd.c
index 7c9deb1921..e2adcdffa1 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -364,6 +364,8 @@  static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
                        offset, block->used_length);
             return -1;
         }
+        p->pages->offset[i] = offset;
+        p->pages->block = block;
         p->pages->iov[i].iov_base = block->host + offset;
         p->pages->iov[i].iov_len = qemu_target_page_size();
     }