Lines Matching refs:p
47 static int zlib_send_setup(MultiFDSendParams *p, Error **errp) in zlib_send_setup() argument
72 p->compress_data = z; in zlib_send_setup()
75 p->iov = g_new0(struct iovec, 2); in zlib_send_setup()
85 error_setg(errp, "multifd %u: %s", p->id, err_msg); in zlib_send_setup()
97 static void zlib_send_cleanup(MultiFDSendParams *p, Error **errp) in zlib_send_cleanup() argument
99 struct zlib_data *z = p->compress_data; in zlib_send_cleanup()
106 g_free(p->compress_data); in zlib_send_cleanup()
107 p->compress_data = NULL; in zlib_send_cleanup()
109 g_free(p->iov); in zlib_send_cleanup()
110 p->iov = NULL; in zlib_send_cleanup()
124 static int zlib_send_prepare(MultiFDSendParams *p, Error **errp) in zlib_send_prepare() argument
126 MultiFDPages_t *pages = p->pages; in zlib_send_prepare()
127 struct zlib_data *z = p->compress_data; in zlib_send_prepare()
133 if (!multifd_send_prepare_common(p)) { in zlib_send_prepare()
150 memcpy(z->buf, p->pages->block->host + pages->offset[i], p->page_size); in zlib_send_prepare()
151 zs->avail_in = p->page_size; in zlib_send_prepare()
170 p->id); in zlib_send_prepare()
175 p->id, ret); in zlib_send_prepare()
180 p->iov[p->iovs_num].iov_base = z->zbuff; in zlib_send_prepare()
181 p->iov[p->iovs_num].iov_len = out_size; in zlib_send_prepare()
182 p->iovs_num++; in zlib_send_prepare()
183 p->next_packet_size = out_size; in zlib_send_prepare()
186 p->flags |= MULTIFD_FLAG_ZLIB; in zlib_send_prepare()
187 multifd_send_fill_packet(p); in zlib_send_prepare()
201 static int zlib_recv_setup(MultiFDRecvParams *p, Error **errp) in zlib_recv_setup() argument
206 p->compress_data = z; in zlib_recv_setup()
213 error_setg(errp, "multifd %u: inflate init failed", p->id); in zlib_recv_setup()
221 error_setg(errp, "multifd %u: out of memory for zbuff", p->id); in zlib_recv_setup()
234 static void zlib_recv_cleanup(MultiFDRecvParams *p) in zlib_recv_cleanup() argument
236 struct zlib_data *z = p->compress_data; in zlib_recv_cleanup()
241 g_free(p->compress_data); in zlib_recv_cleanup()
242 p->compress_data = NULL; in zlib_recv_cleanup()
256 static int zlib_recv(MultiFDRecvParams *p, Error **errp) in zlib_recv() argument
258 struct zlib_data *z = p->compress_data; in zlib_recv()
260 uint32_t in_size = p->next_packet_size; in zlib_recv()
263 uint32_t expected_size = p->normal_num * p->page_size; in zlib_recv()
264 uint32_t flags = p->flags & MULTIFD_FLAG_COMPRESSION_MASK; in zlib_recv()
270 p->id, flags, MULTIFD_FLAG_ZLIB); in zlib_recv()
274 multifd_recv_zero_page_process(p); in zlib_recv()
276 if (!p->normal_num) { in zlib_recv()
281 ret = qio_channel_read_all(p->c, (void *)z->zbuff, in_size, errp); in zlib_recv()
290 for (i = 0; i < p->normal_num; i++) { in zlib_recv()
294 ramblock_recv_bitmap_set_offset(p->block, p->normal[i]); in zlib_recv()
295 if (i == p->normal_num - 1) { in zlib_recv()
299 zs->avail_out = p->page_size; in zlib_recv()
300 zs->next_out = p->host + p->normal[i]; in zlib_recv()
313 && (zs->total_out - start) < p->page_size); in zlib_recv()
314 if (ret == Z_OK && (zs->total_out - start) < p->page_size) { in zlib_recv()
316 p->id); in zlib_recv()
321 p->id, ret); in zlib_recv()
328 p->id, out_size, expected_size); in zlib_recv()