Révision | 48a4a44c1cde382c6b8e7792d01fe7d9b0a59c69 (tree) |
---|---|
l'heure | 2022-01-28 23:38:23 |
Auteur | Juan Quintela <quintela@redh...> |
Commiter | Juan Quintela |
multifd: Make zlib use iov's
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
@@ -143,6 +143,9 @@ static int zlib_send_prepare(MultiFDSendParams *p, Error **errp) | ||
143 | 143 | } |
144 | 144 | out_size += available - zs->avail_out; |
145 | 145 | } |
146 | + p->iov[p->iovs_num].iov_base = z->zbuff; | |
147 | + p->iov[p->iovs_num].iov_len = out_size; | |
148 | + p->iovs_num++; | |
146 | 149 | p->next_packet_size = out_size; |
147 | 150 | p->flags |= MULTIFD_FLAG_ZLIB; |
148 | 151 |
@@ -162,10 +165,7 @@ static int zlib_send_prepare(MultiFDSendParams *p, Error **errp) | ||
162 | 165 | */ |
163 | 166 | static int zlib_send_write(MultiFDSendParams *p, uint32_t used, Error **errp) |
164 | 167 | { |
165 | - struct zlib_data *z = p->data; | |
166 | - | |
167 | - return qio_channel_write_all(p->c, (void *)z->zbuff, p->next_packet_size, | |
168 | - errp); | |
168 | + return qio_channel_writev_all(p->c, p->iov, p->iovs_num, errp); | |
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |