[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/18] virtio-blk: restore VirtIOBlkConf->config_wce
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 10/18] virtio-blk: restore VirtIOBlkConf->config_wce flag |
Date: |
Wed, 19 Dec 2012 16:38:11 +0100 |
Two slightly different versions of a patch to conditionally set
VIRTIO_BLK_F_CONFIG_WCE through the "config-wce" qdev property have been
applied (ea776abca and eec7f96c2). David Gibson
<address@hidden> noticed that the "config-wce"
property is broken as a result and fixed it recently.
The fix sets the host_features VIRTIO_BLK_F_CONFIG_WCE bit from a qdev
property. Unfortunately, the virtio device then has no chance to test
for the presence of the feature bit during virtio_blk_init().
Therefore, reinstate the VirtIOBlkConf->config_wce flag. Drop the
duplicate qdev property to set the host_features bit. The
VirtIOBlkConf->config_wce flag will be used by virtio-blk-data-plane in
a later patch.
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hw/virtio-blk.c | 3 +++
hw/virtio-blk.h | 4 ++--
hw/virtio-pci.c | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index e25cc96..fabf387 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -524,6 +524,9 @@ static uint32_t virtio_blk_get_features(VirtIODevice *vdev,
uint32_t features)
features |= (1 << VIRTIO_BLK_F_BLK_SIZE);
features |= (1 << VIRTIO_BLK_F_SCSI);
+ if (s->blk->config_wce) {
+ features |= (1 << VIRTIO_BLK_F_CONFIG_WCE);
+ }
if (bdrv_enable_write_cache(s->bs))
features |= (1 << VIRTIO_BLK_F_WCE);
diff --git a/hw/virtio-blk.h b/hw/virtio-blk.h
index 651a000..454f445 100644
--- a/hw/virtio-blk.h
+++ b/hw/virtio-blk.h
@@ -104,10 +104,10 @@ struct VirtIOBlkConf
BlockConf conf;
char *serial;
uint32_t scsi;
+ uint32_t config_wce;
};
#define DEFINE_VIRTIO_BLK_FEATURES(_state, _field) \
- DEFINE_VIRTIO_COMMON_FEATURES(_state, _field), \
- DEFINE_PROP_BIT("config-wce", _state, _field, VIRTIO_BLK_F_CONFIG_WCE,
true)
+ DEFINE_VIRTIO_COMMON_FEATURES(_state, _field)
#endif
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 7684ac9..71f4fb5 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -895,6 +895,7 @@ static Property virtio_blk_properties[] = {
#ifdef __linux__
DEFINE_PROP_BIT("scsi", VirtIOPCIProxy, blk.scsi, 0, true),
#endif
+ DEFINE_PROP_BIT("config-wce", VirtIOPCIProxy, blk.config_wce, 0, true),
DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags,
VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true),
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
DEFINE_VIRTIO_BLK_FEATURES(VirtIOPCIProxy, host_features),
--
1.8.0.2
- [Qemu-devel] [PULL 00/18] Block patches, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 01/18] raw-posix: add raw_get_aio_fd() for virtio-blk-data-plane, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 02/18] configure: add CONFIG_VIRTIO_BLK_DATA_PLANE, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 03/18] dataplane: add host memory mapping code, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 04/18] dataplane: add virtqueue vring code, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 06/18] dataplane: add Linux AIO request queue, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 05/18] dataplane: add event loop, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 10/18] virtio-blk: restore VirtIOBlkConf->config_wce flag,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 09/18] iov: add qemu_iovec_concat_iov(), Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 12/18] virtio-blk: add x-data-plane=on|off performance feature, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 11/18] dataplane: add virtio-blk data plane code, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 13/18] virtio-blk: Return UNSUPP for unknown request types, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 14/18] cutils: change strtosz_suffix_unit function, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 16/18] block/raw-win32: Fix compiler warnings (wrong format specifiers), Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 15/18] qemu-img: report size overflow error message, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 08/18] test-iov: add iov_discard_front/back() testcases, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 07/18] iov: add iov_discard_front/back() to remove data, Stefan Hajnoczi, 2012/12/19
- [Qemu-devel] [PATCH 18/18] sheepdog: pass oid directly to send_pending_req(), Stefan Hajnoczi, 2012/12/19