diff options
| author | Paul Durrant | 2019-01-31 16:33:16 +0100 |
|---|---|---|
| committer | Anthony PERARD | 2019-02-04 12:04:49 +0100 |
| commit | 3149f183d7ca448b1dc30fe3d4acb9e367de01bf (patch) | |
| tree | c4e73f03d718d1f3fdaa97a67fa1f7aa7f201019 /hw/block/dataplane | |
| parent | xen: fix xen-bus state model to allow frontend re-connection (diff) | |
| download | qemu-3149f183d7ca448b1dc30fe3d4acb9e367de01bf.tar.gz qemu-3149f183d7ca448b1dc30fe3d4acb9e367de01bf.tar.xz qemu-3149f183d7ca448b1dc30fe3d4acb9e367de01bf.zip | |
xen-block: handle resize callback
Some frontend drivers will handle dynamic resizing of PV disks, so set up
the BlockDevOps resize_cb() method during xen_block_realize() to allow
this to be done.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Diffstat (limited to 'hw/block/dataplane')
| -rw-r--r-- | hw/block/dataplane/xen-block.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/block/dataplane/xen-block.c b/hw/block/dataplane/xen-block.c index d0d8905a33..c6a15da024 100644 --- a/hw/block/dataplane/xen-block.c +++ b/hw/block/dataplane/xen-block.c @@ -50,7 +50,6 @@ struct XenBlockDataPlane { unsigned int nr_ring_ref; void *sring; int64_t file_blk; - int64_t file_size; int protocol; blkif_back_rings_t rings; int more_work; @@ -189,7 +188,7 @@ static int xen_block_parse_request(XenBlockRequest *request) request->req.seg[i].first_sect + 1) * dataplane->file_blk; request->size += len; } - if (request->start + request->size > dataplane->file_size) { + if (request->start + request->size > blk_getlength(dataplane->blk)) { error_report("error: access beyond end of file"); goto err; } @@ -638,7 +637,6 @@ XenBlockDataPlane *xen_block_dataplane_create(XenDevice *xendev, dataplane->xendev = xendev; dataplane->file_blk = conf->logical_block_size; dataplane->blk = conf->blk; - dataplane->file_size = blk_getlength(dataplane->blk); QLIST_INIT(&dataplane->inflight); QLIST_INIT(&dataplane->freelist); |
