diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-01-07 14:34:13 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-01-15 18:58:02 +0100 |
commit | f1c17521e79df863a5771d96974fab0d07f02be0 (patch) | |
tree | bae9be2eab046875ad495fb59a345d8ab30d0703 /include | |
parent | eb38c3b67018ff8069e4f674a28661931a8a3e4f (diff) |
nbd-server: do not exit on failed memory allocation
The amount of memory allocated in nbd_co_receive_request is driven by the
NBD client (possibly a virtual machine). Parallel I/O can cause the
server to allocate a large amount of memory; check for failures and
return ENOMEM in that case.
Cc: qemu-block@nongnu.org
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sysemu/block-backend.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index dc244760a1..1568554e3e 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -148,6 +148,7 @@ int blk_get_flags(BlockBackend *blk); int blk_get_max_transfer_length(BlockBackend *blk); int blk_get_max_iov(BlockBackend *blk); void blk_set_guest_block_size(BlockBackend *blk, int align); +void *blk_try_blockalign(BlockBackend *blk, size_t size); void *blk_blockalign(BlockBackend *blk, size_t size); bool blk_op_is_blocked(BlockBackend *blk, BlockOpType op, Error **errp); void blk_op_unblock(BlockBackend *blk, BlockOpType op, Error *reason); |