aboutsummaryrefslogtreecommitdiff
path: root/nbd.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-10-07 14:35:58 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2011-12-22 11:53:58 +0100
commit3777b09fd75ba746cf65d0ba30d73a5dd7a02d65 (patch)
tree2fa84bced9dbc18af94dc340255f0fe9e1bf1858 /nbd.c
parent94607e7a775ae7b57219e2078b00ed2930ab98de (diff)
downloadqemu-arm-3777b09fd75ba746cf65d0ba30d73a5dd7a02d65.tar.gz
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 <pbonzini@redhat.com>
Diffstat (limited to 'nbd.c')
-rw-r--r--nbd.c6
1 files changed, 3 insertions, 3 deletions
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;
}