Lines Matching full:chunk

579                                          NBDStructuredReplyChunk *chunk,  in nbd_parse_offset_hole_payload()  argument
586 if (chunk->length != sizeof(offset) + sizeof(hole_size)) { in nbd_parse_offset_hole_payload()
597 error_setg(errp, "Protocol error: server sent chunk exceeding requested" in nbd_parse_offset_hole_payload()
617 NBDStructuredReplyChunk *chunk, in nbd_parse_blockstatus_payload() argument
628 if (chunk->length < pay_len) { in nbd_parse_blockstatus_payload()
654 error_setg(errp, "Protocol error: server sent status chunk with " in nbd_parse_blockstatus_payload()
693 if (count != wide || chunk->length > pay_len) { in nbd_parse_blockstatus_payload()
718 static int nbd_parse_error_payload(NBDStructuredReplyChunk *chunk, in nbd_parse_error_payload() argument
725 assert(chunk->type & (1 << 15)); in nbd_parse_error_payload()
727 if (chunk->length < sizeof(error) + sizeof(message_size)) { in nbd_parse_error_payload()
735 error_setg(errp, "Protocol error: server sent structured error chunk " in nbd_parse_error_payload()
743 if (message_size > chunk->length - sizeof(error) - sizeof(message_size)) { in nbd_parse_error_payload()
744 error_setg(errp, "Protocol error: server sent structured error chunk " in nbd_parse_error_payload()
764 NBDStructuredReplyChunk *chunk = &s->reply.structured; in nbd_co_receive_offset_data_payload() local
769 if (chunk->length <= sizeof(offset)) { in nbd_co_receive_offset_data_payload()
779 data_size = chunk->length - sizeof(offset); in nbd_co_receive_offset_data_payload()
783 error_setg(errp, "Protocol error: server sent chunk exceeding requested" in nbd_co_receive_offset_data_payload()
840 * for structured reply chunk:
841 * if error chunk: read payload, set @request_ret, do not set @payload
842 * else if offset_data chunk: read payload data to @qiov, do not set @payload
858 NBDStructuredReplyChunk *chunk; in nbd_co_do_receive_one_chunk() local
877 "reply chunk was expected"); in nbd_co_do_receive_one_chunk()
890 /* handle structured reply chunk */ in nbd_co_do_receive_one_chunk()
892 chunk = &s->reply.structured; in nbd_co_do_receive_one_chunk()
894 if (chunk->type == NBD_REPLY_TYPE_NONE) { in nbd_co_do_receive_one_chunk()
895 if (!(chunk->flags & NBD_REPLY_FLAG_DONE)) { in nbd_co_do_receive_one_chunk()
896 error_setg(errp, "Protocol error: NBD_REPLY_TYPE_NONE chunk without" in nbd_co_do_receive_one_chunk()
900 if (chunk->length) { in nbd_co_do_receive_one_chunk()
901 error_setg(errp, "Protocol error: NBD_REPLY_TYPE_NONE chunk with" in nbd_co_do_receive_one_chunk()
908 if (chunk->type == NBD_REPLY_TYPE_OFFSET_DATA) { in nbd_co_do_receive_one_chunk()
910 error_setg(errp, "Unexpected NBD_REPLY_TYPE_OFFSET_DATA chunk"); in nbd_co_do_receive_one_chunk()
918 if (nbd_reply_type_is_error(chunk->type)) { in nbd_co_do_receive_one_chunk()
927 if (nbd_reply_type_is_error(chunk->type)) { in nbd_co_do_receive_one_chunk()
928 ret = nbd_parse_error_payload(chunk, local_payload, request_ret, errp); in nbd_co_do_receive_one_chunk()
1017 NBDStructuredReplyChunk *chunk; in nbd_reply_chunk_iter_receive() local
1043 chunk = &reply->structured; in nbd_reply_chunk_iter_receive()
1046 if (chunk->type == NBD_REPLY_TYPE_NONE) { in nbd_reply_chunk_iter_receive()
1048 assert(chunk->flags & NBD_REPLY_FLAG_DONE); in nbd_reply_chunk_iter_receive()
1052 if (chunk->flags & NBD_REPLY_FLAG_DONE) { in nbd_reply_chunk_iter_receive()
1100 NBDStructuredReplyChunk *chunk = &reply.structured; in nbd_co_receive_cmdread_reply() local
1104 switch (chunk->type) { in nbd_co_receive_cmdread_reply()
1120 if (!nbd_reply_type_is_error(chunk->type)) { in nbd_co_receive_cmdread_reply()
1125 chunk->type, nbd_reply_type_lookup(chunk->type)); in nbd_co_receive_cmdread_reply()
1153 NBDStructuredReplyChunk *chunk = &reply.structured; in nbd_co_receive_blockstatus_reply() local
1158 switch (chunk->type) { in nbd_co_receive_blockstatus_reply()
1161 wide = chunk->type == NBD_REPLY_TYPE_BLOCK_STATUS_EXT; in nbd_co_receive_blockstatus_reply()
1181 if (!nbd_reply_type_is_error(chunk->type)) { in nbd_co_receive_blockstatus_reply()
1186 chunk->type, nbd_reply_type_lookup(chunk->type)); in nbd_co_receive_blockstatus_reply()