From 51416611c696fcc68a57c5f2392d2f4cbddb02ec Mon Sep 17 00:00:00 2001 From: Marcel Apfelbaum Date: Thu, 24 Sep 2015 17:03:58 +0200 Subject: [PATCH 03/13] virtio-blk: only clear VIRTIO_F_ANY_LAYOUT for legacy device Message-id: <1443114248-18614-2-git-send-email-marcel@redhat.com> Patchwork-id: 67935 O-Subject: [RHEL-7.2 qemu-kvm-rhev PATCH 01/11] virtio-blk: only clear VIRTIO_F_ANY_LAYOUT for legacy device Bugzilla: 1207687 RH-Acked-by: Victor Kaplansky RH-Acked-by: Xiao Wang RH-Acked-by: Michael S. Tsirkin From: Jason Wang 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 only clear VIRTIO_F_LAYOUT for legacy device. Cc: Stefan Hajnoczi Cc: Kevin Wolf Cc: qemu-block@nongnu.org Signed-off-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: Paolo Bonzini (cherry picked from commit c9b11f971cfa1fd3eed716f62f4b835553b75490) Signed-off-by: Marcel Apfelbaum Signed-off-by: Miroslav Rezanina --- hw/block/virtio-blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 2aa6ad6..62b617e 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -727,13 +727,13 @@ static uint64_t virtio_blk_get_features(VirtIODevice *vdev, uint64_t features, virtio_add_feature(&features, VIRTIO_BLK_F_GEOMETRY); virtio_add_feature(&features, VIRTIO_BLK_F_TOPOLOGY); virtio_add_feature(&features, VIRTIO_BLK_F_BLK_SIZE); - virtio_clear_feature(&features, VIRTIO_F_ANY_LAYOUT); if (__virtio_has_feature(features, VIRTIO_F_VERSION_1)) { if (s->conf.scsi) { error_setg(errp, "Please set scsi=off for virtio-blk devices in order to use virtio 1.0"); return 0; } } else { + virtio_clear_feature(&features, VIRTIO_F_ANY_LAYOUT); virtio_add_feature(&features, VIRTIO_BLK_F_SCSI); } -- 1.8.3.1