summaryrefslogtreecommitdiffstats
path: root/hw/xen_disk.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin2011-05-05 15:39:47 +0200
committerMichael S. Tsirkin2011-05-05 15:39:47 +0200
commit5300f1a5487f67f0bde8ee1081b799108668cb1d (patch)
tree5274ff496f2665487736a4eec23bf76601e4da44 /hw/xen_disk.c
parentCPUPhysMemoryClient: Pass guest physical address not region offset (diff)
parentNBD: Avoid leaking a couple of strings when the NBD device is closed (diff)
downloadqemu-5300f1a5487f67f0bde8ee1081b799108668cb1d.tar.gz
qemu-5300f1a5487f67f0bde8ee1081b799108668cb1d.tar.xz
qemu-5300f1a5487f67f0bde8ee1081b799108668cb1d.zip
Merge remote branch 'origin/master' into pci
Conflicts: exec.c
Diffstat (limited to 'hw/xen_disk.c')
-rw-r--r--hw/xen_disk.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 445bf03aa0..558bf8ae25 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -310,7 +310,7 @@ static int ioreq_runio_qemu_sync(struct ioreq *ioreq)
off_t pos;
if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1)
- goto err;
+ goto err_no_map;
if (ioreq->presync)
bdrv_flush(blkdev->bs);
@@ -364,6 +364,9 @@ static int ioreq_runio_qemu_sync(struct ioreq *ioreq)
return 0;
err:
+ ioreq_unmap(ioreq);
+err_no_map:
+ ioreq_finish(ioreq);
ioreq->status = BLKIF_RSP_ERROR;
return -1;
}
@@ -393,7 +396,7 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
struct XenBlkDev *blkdev = ioreq->blkdev;
if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1)
- goto err;
+ goto err_no_map;
ioreq->aio_inflight++;
if (ioreq->presync)
@@ -427,6 +430,9 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
return 0;
err:
+ ioreq_unmap(ioreq);
+err_no_map:
+ ioreq_finish(ioreq);
ioreq->status = BLKIF_RSP_ERROR;
return -1;
}