qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] xen_disk: use NATIVE_AIO and NOCACHE
@ 2012-03-23 14:43 Stefano Stabellini
  2012-03-23 14:44 ` [Qemu-devel] [PATCH 1/2] xen_disk: open disk with BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO Stefano Stabellini
  2012-03-23 14:44 ` [Qemu-devel] [PATCH 2/2] xen_disk: when using AIO flush after the operation is completed Stefano Stabellini
  0 siblings, 2 replies; 4+ messages in thread
From: Stefano Stabellini @ 2012-03-23 14:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, aliguori, qemu-stable

Hi all,
this small patch series allows xen_disk to be used correctly with
NATIVE_AIO and O_DIRECT.

This series should be backported to the stable branch too.


Stefano Stabellini (2):
      xen_disk: open disk with BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO
      xen_disk: when using AIO flush after the operation is completed

 hw/xen_disk.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

git://xenbits.xen.org/people/sstabellini/qemu-dm.git disk_io

Cheers,

Stefano

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 1/2] xen_disk: open disk with BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO
  2012-03-23 14:43 [Qemu-devel] [PATCH 0/2] xen_disk: use NATIVE_AIO and NOCACHE Stefano Stabellini
@ 2012-03-23 14:44 ` Stefano Stabellini
  2012-03-23 14:44 ` [Qemu-devel] [PATCH 2/2] xen_disk: when using AIO flush after the operation is completed Stefano Stabellini
  1 sibling, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2012-03-23 14:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, aliguori, qemu-stable, Stefano Stabellini

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_disk.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 68fa36a..0f265a4 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -584,10 +584,10 @@ static int blk_init(struct XenDevice *xendev)
     }
 
     /* read-only ? */
+    qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
     if (strcmp(blkdev->mode, "w") == 0) {
-        qflags = BDRV_O_RDWR;
+        qflags |= BDRV_O_RDWR;
     } else {
-        qflags = 0;
         info  |= VDISK_READONLY;
     }
 
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 2/2] xen_disk: when using AIO flush after the operation is completed
  2012-03-23 14:43 [Qemu-devel] [PATCH 0/2] xen_disk: use NATIVE_AIO and NOCACHE Stefano Stabellini
  2012-03-23 14:44 ` [Qemu-devel] [PATCH 1/2] xen_disk: open disk with BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO Stefano Stabellini
@ 2012-03-23 14:44 ` Stefano Stabellini
  1 sibling, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2012-03-23 14:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, aliguori, qemu-stable, Stefano Stabellini

If ioreq->postsync call bdrv_flush when the AIO operation is actually
completed.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_disk.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 0f265a4..9cb0253 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -330,6 +330,9 @@ static void qemu_aio_complete(void *opaque, int ret)
     if (ioreq->aio_inflight > 0) {
         return;
     }
+    if (ioreq->postsync) {
+        bdrv_flush(ioreq->blkdev->bs);
+    }
 
     ioreq->status = ioreq->aio_errors ? BLKIF_RSP_ERROR : BLKIF_RSP_OKAY;
     ioreq_unmap(ioreq);
@@ -376,9 +379,6 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
         goto err;
     }
 
-    if (ioreq->postsync) {
-        bdrv_flush(blkdev->bs); /* FIXME: aio_flush() ??? */
-    }
     qemu_aio_complete(ioreq, 0);
 
     return 0;
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 2/2] xen_disk: when using AIO flush after the operation is completed
  2012-03-27 15:48 [Qemu-devel] [PULL 0/2] xen_disk: use NATIVE_AIO and NOCACHE Stefano Stabellini
@ 2012-03-27 15:50 ` Stefano Stabellini
  0 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2012-03-27 15:50 UTC (permalink / raw)
  To: anthony; +Cc: aliguori, Stefano Stabellini, qemu-stable, qemu-devel

If ioreq->postsync call bdrv_flush when the AIO operation is actually
completed.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_disk.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 0f265a4..9cb0253 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -330,6 +330,9 @@ static void qemu_aio_complete(void *opaque, int ret)
     if (ioreq->aio_inflight > 0) {
         return;
     }
+    if (ioreq->postsync) {
+        bdrv_flush(ioreq->blkdev->bs);
+    }
 
     ioreq->status = ioreq->aio_errors ? BLKIF_RSP_ERROR : BLKIF_RSP_OKAY;
     ioreq_unmap(ioreq);
@@ -376,9 +379,6 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
         goto err;
     }
 
-    if (ioreq->postsync) {
-        bdrv_flush(blkdev->bs); /* FIXME: aio_flush() ??? */
-    }
     qemu_aio_complete(ioreq, 0);
 
     return 0;
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-27 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-23 14:43 [Qemu-devel] [PATCH 0/2] xen_disk: use NATIVE_AIO and NOCACHE Stefano Stabellini
2012-03-23 14:44 ` [Qemu-devel] [PATCH 1/2] xen_disk: open disk with BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO Stefano Stabellini
2012-03-23 14:44 ` [Qemu-devel] [PATCH 2/2] xen_disk: when using AIO flush after the operation is completed Stefano Stabellini
  -- strict thread matches above, loose matches on Subject: below --
2012-03-27 15:48 [Qemu-devel] [PULL 0/2] xen_disk: use NATIVE_AIO and NOCACHE Stefano Stabellini
2012-03-27 15:50 ` [Qemu-devel] [PATCH 2/2] xen_disk: when using AIO flush after the operation is completed Stefano Stabellini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).