block/io: bdrv_co_do_copy_on_readv: lazy allocation
commit2275cc90a1c146abdd86e24d929a9682628a8c4b
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tue, 4 Jun 2019 16:15:08 +0000 (4 19:15 +0300)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 27 Aug 2019 13:58:42 +0000 (27 14:58 +0100)
treebf66781b2d8f2a034acdc631fe479e2d557568ad
parent1143ec5ebf48d6dbf61f600eb5f875aefffb8fb6
block/io: bdrv_co_do_copy_on_readv: lazy allocation

Allocate bounce_buffer only if it is really needed. Also, sub-optimize
allocation size (why not?).

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190604161514.262241-7-vsementsov@virtuozzo.com
Message-Id: <20190604161514.262241-7-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/io.c