Message ID | 1436766411-29144-3-git-send-email-jasowang@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index f30ad25..0f07e25 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -732,6 +732,8 @@ static uint64_t virtio_blk_get_features(VirtIODevice *vdev, uint64_t features) virtio_add_feature(&features, VIRTIO_BLK_F_BLK_SIZE); if (!__virtio_has_feature(features, VIRTIO_F_VERSION_1)) virtio_add_feature(&features, VIRTIO_BLK_F_SCSI); + else + virtio_add_feature(&features, VIRTIO_F_ANY_LAYOUT); if (s->conf.config_wce) { virtio_add_feature(&features, VIRTIO_BLK_F_CONFIG_WCE);
Chapter 6.3 of spec said " Transitional devices MUST offer, and if offered by the device transitional drivers MUST accept the following: VIRTIO_F_ANY_LAYOUT (27) " So this patch sets VIRTIO_F_ANY_LAYOUT when 1.0 is supported. Cc: Stefan Hajnoczi <stefanha@redhat.com> Cc: Kevin Wolf <kwolf@redhat.com> Cc: qemu-block@nongnu.org Signed-off-by: Jason Wang <jasowang@redhat.com> --- hw/block/virtio-blk.c | 2 ++ 1 file changed, 2 insertions(+)