* [Qemu-devel] [PATCH] xen_disk: Always set feature-barrier = 1
@ 2011-10-21 10:26 Kevin Wolf
0 siblings, 0 replies; only message in thread
From: Kevin Wolf @ 2011-10-21 10:26 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, anthony.perard, pbonzini, kraxel, stefano.stabellini
The synchronous .bdrv_flush callback doesn't exist any more and a device really
shouldn't poke into the block layer internals anyway. All drivers are supposed
to have a correctly working bdrv_flush, so let's just hard-code this.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
I'm not sure what feature-barrier really means, but this is the closest thing
to what we used to do. Should this really be dependent on whether or not we are
using a writeback cache mode?
Also, someone should really get rid of that #include "block_int.h" in xen_disk.
Things defined there are not a device's business.
hw/xen_disk.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 8a9fac4..286bbac 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -620,7 +620,7 @@ static void blk_alloc(struct XenDevice *xendev)
static int blk_init(struct XenDevice *xendev)
{
struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
- int index, qflags, have_barriers, info = 0;
+ int index, qflags, info = 0;
/* read xenstore entries */
if (blkdev->params == NULL) {
@@ -706,7 +706,6 @@ static int blk_init(struct XenDevice *xendev)
blkdev->bs->drv ? blkdev->bs->drv->format_name : "-");
blkdev->file_size = 0;
}
- have_barriers = blkdev->bs->drv && blkdev->bs->drv->bdrv_flush ? 1 : 0;
xen_be_printf(xendev, 1, "type \"%s\", fileproto \"%s\", filename \"%s\","
" size %" PRId64 " (%" PRId64 " MB)\n",
@@ -714,7 +713,7 @@ static int blk_init(struct XenDevice *xendev)
blkdev->file_size, blkdev->file_size >> 20);
/* fill info */
- xenstore_write_be_int(&blkdev->xendev, "feature-barrier", have_barriers);
+ xenstore_write_be_int(&blkdev->xendev, "feature-barrier", 1);
xenstore_write_be_int(&blkdev->xendev, "info", info);
xenstore_write_be_int(&blkdev->xendev, "sector-size", blkdev->file_blk);
xenstore_write_be_int(&blkdev->xendev, "sectors",
--
1.7.6.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-10-21 10:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-21 10:26 [Qemu-devel] [PATCH] xen_disk: Always set feature-barrier = 1 Kevin Wolf
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).