[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/16] qemu and qemu-xen: support empty write barrie
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 05/16] qemu and qemu-xen: support empty write barriers in xen_disk |
Date: |
Tue, 30 Nov 2010 18:58:09 +0100 |
From: Stefano Stabellini <address@hidden>
This patch can be applied to both qemu-xen and qemu and adds support
for empty write barriers to xen_disk.
Signed-off-by: Stefano Stabellini <address@hidden>
Acked-by: Gerd Hoffmann <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/xen_disk.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 134ac33..85a1c85 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -181,6 +181,10 @@ static int ioreq_parse(struct ioreq *ioreq)
ioreq->prot = PROT_WRITE; /* to memory */
break;
case BLKIF_OP_WRITE_BARRIER:
+ if (!ioreq->req.nr_segments) {
+ ioreq->presync = 1;
+ return 0;
+ }
if (!syncwrite)
ioreq->presync = ioreq->postsync = 1;
/* fall through */
@@ -305,7 +309,7 @@ static int ioreq_runio_qemu_sync(struct ioreq *ioreq)
int i, rc, len = 0;
off_t pos;
- if (ioreq_map(ioreq) == -1)
+ if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1)
goto err;
if (ioreq->presync)
bdrv_flush(blkdev->bs);
@@ -329,6 +333,8 @@ static int ioreq_runio_qemu_sync(struct ioreq *ioreq)
break;
case BLKIF_OP_WRITE:
case BLKIF_OP_WRITE_BARRIER:
+ if (!ioreq->req.nr_segments)
+ break;
pos = ioreq->start;
for (i = 0; i < ioreq->v.niov; i++) {
rc = bdrv_write(blkdev->bs, pos / BLOCK_SIZE,
@@ -386,7 +392,7 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
{
struct XenBlkDev *blkdev = ioreq->blkdev;
- if (ioreq_map(ioreq) == -1)
+ if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1)
goto err;
ioreq->aio_inflight++;
@@ -403,6 +409,8 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
case BLKIF_OP_WRITE:
case BLKIF_OP_WRITE_BARRIER:
ioreq->aio_inflight++;
+ if (!ioreq->req.nr_segments)
+ break;
bdrv_aio_writev(blkdev->bs, ioreq->start / BLOCK_SIZE,
&ioreq->v, ioreq->v.size / BLOCK_SIZE,
qemu_aio_complete, ioreq);
--
1.7.2.3
- [Qemu-devel] [PATCH 06/16] block: Remove unused s->hd in various drivers, (continued)
- [Qemu-devel] [PATCH 06/16] block: Remove unused s->hd in various drivers, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 15/16] ide: Ignore double DMA transfer starts/stops, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 11/16] scsi-disk: Remove duplicate cdb parsing, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 13/16] ide: Factor ide_dma_set_inactive out, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 07/16] scsi: Increase the number of possible devices, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 04/16] ide: convert bmdma address ioport to ioport_register(), Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 14/16] ide: Set bus master inactive on error, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 12/16] raw-posix: raw_pwrite comment fixup, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 10/16] scsi: Move sense handling into the driver, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 08/16] scsi: Return SAM status codes, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 05/16] qemu and qemu-xen: support empty write barriers in xen_disk,
Kevin Wolf <=
- [Qemu-devel] [PATCH 09/16] scsi: INQUIRY VPD fixes, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 01/16] scsi-disk: Move active request asserts, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 02/16] Implement drive_del to decouple block removal from device removal, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 03/16] block migration: do not submit multiple AIOs for same sector (v2), Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 16/16] ide: Reset current_addr after stopping DMA, Kevin Wolf, 2010/11/30