[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support
From: |
Rusty Russell |
Subject: |
[Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support |
Date: |
Wed, 16 Mar 2011 14:39:39 +1030 |
User-agent: |
Notmuch/0.3.1 (http://notmuchmail.org) Emacs/23.1.1 (i686-pc-linux-gnu) |
On Tue, 15 Mar 2011 15:16:44 +0100, Christoph Hellwig <address@hidden> wrote:
> Add support for the new dynamic features config space field to allow
> en/disabling the write cache at runtime. The userspace interface is
> a SCSI-compatible sysfs attribute.
>
> Signed-off-by: Christoph Hellwig <address@hidden>
Hi Christoph,
Neat work. Minor comments:
> + if (strncmp(buf, "write through", sizeof("write through") - 1) == 0) {
> + ;
> + } else if (strncmp(buf, "write back", sizeof("write back") - 1) == 0) {
Is there a reason we're not letting gcc and/or strcmp do the
optimization work here?
> + vdev->config->set(vdev, offsetof(struct virtio_blk_config, features),
> + &features, sizeof(features));
> +
> + vdev->config->get(vdev, offsetof(struct virtio_blk_config, features),
> + &features2, sizeof(features2));
> +
> + if ((features & VIRTIO_BLK_RT_WCE) !=
> + (features2 & VIRTIO_BLK_RT_WCE))
> + return -EIO;
This seems like a debugging check you left in. Or do you suspect
some issues?
Thanks,
Rusty.
- [Qemu-devel] [PATCH 2/4] block: add a helper to change writeback mode on the fly, (continued)
[Qemu-devel] [PATCH, RFC] virtio_blk: add cache control support, Christoph Hellwig, 2011/03/15
- [Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support,
Rusty Russell <=
- [Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support, Christoph Hellwig, 2011/03/16
- [Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support, Rusty Russell, 2011/03/17
- Re: [Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support, Christoph Hellwig, 2011/03/17
- Re: [Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support, Rusty Russell, 2011/03/23
- Re: [Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support, Anthony Liguori, 2011/03/23
- [Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support, Anthony Liguori, 2011/03/23
- [Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support, Christian Borntraeger, 2011/03/24
- [Qemu-devel] Re: [PATCH, RFC] virtio_blk: add cache control support, Rusty Russell, 2011/03/25