From 3777b09fd75ba746cf65d0ba30d73a5dd7a02d65 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 7 Oct 2011 14:35:58 +0200 Subject: qemu-nbd: remove data_size argument to nbd_trip The size of the buffer is in practice part of the protocol. Signed-off-by: Paolo Bonzini --- nbd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nbd.c') diff --git a/nbd.c b/nbd.c index 1df2b91bf2..d8cc331a0b 100644 --- a/nbd.c +++ b/nbd.c @@ -585,7 +585,7 @@ static int nbd_send_reply(int csock, struct nbd_reply *reply) int nbd_trip(BlockDriverState *bs, int csock, off_t size, uint64_t dev_offset, uint32_t nbdflags, - uint8_t *data, int data_size) + uint8_t *data) { struct nbd_request request; struct nbd_reply reply; @@ -596,9 +596,9 @@ int nbd_trip(BlockDriverState *bs, int csock, off_t size, if (nbd_receive_request(csock, &request) == -1) return -1; - if (request.len + NBD_REPLY_SIZE > data_size) { + if (request.len + NBD_REPLY_SIZE > NBD_BUFFER_SIZE) { LOG("len (%u) is larger than max len (%u)", - request.len + NBD_REPLY_SIZE, data_size); + request.len + NBD_REPLY_SIZE, NBD_BUFFER_SIZE); errno = EINVAL; return -1; } -- cgit v1.2.3