virtio: set any_layout in virtio core

Exceptions:
    - virtio-blk
    - compat machine types

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Michael S. Tsirkin 2015-07-22 12:32:25 +03:00
parent cd4bfbb20d
commit 09999a5f7f
5 changed files with 25 additions and 6 deletions

View File

@ -731,6 +731,7 @@ static uint64_t virtio_blk_get_features(VirtIODevice *vdev, uint64_t features)
virtio_add_feature(&features, VIRTIO_BLK_F_TOPOLOGY);
virtio_add_feature(&features, VIRTIO_BLK_F_BLK_SIZE);
virtio_add_feature(&features, VIRTIO_BLK_F_SCSI);
virtio_clear_feature(&features, VIRTIO_F_ANY_LAYOUT);
if (s->conf.config_wce) {
virtio_add_feature(&features, VIRTIO_BLK_F_CONFIG_WCE);

View File

@ -1777,8 +1777,6 @@ static void virtio_net_instance_init(Object *obj)
}
static Property virtio_net_properties[] = {
DEFINE_PROP_BIT("any_layout", VirtIONet, host_features,
VIRTIO_F_ANY_LAYOUT, true),
DEFINE_PROP_BIT("csum", VirtIONet, host_features, VIRTIO_NET_F_CSUM, true),
DEFINE_PROP_BIT("guest_csum", VirtIONet, host_features,
VIRTIO_NET_F_GUEST_CSUM, true),

View File

@ -953,8 +953,6 @@ static Property virtio_scsi_properties[] = {
0xFFFF),
DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSI, parent_obj.conf.cmd_per_lun,
128),
DEFINE_PROP_BIT("any_layout", VirtIOSCSI, host_features,
VIRTIO_F_ANY_LAYOUT, true),
DEFINE_PROP_BIT("hotplug", VirtIOSCSI, host_features,
VIRTIO_SCSI_F_HOTPLUG, true),
DEFINE_PROP_BIT("param_change", VirtIOSCSI, host_features,

View File

@ -2,7 +2,27 @@
#define HW_COMPAT_H
#define HW_COMPAT_2_3 \
/* empty */
{\
.driver = "virtio-blk-pci",\
.property = "any_layout",\
.value = "off",\
},{\
.driver = "virtio-balloon-pci",\
.property = "any_layout",\
.value = "off",\
},{\
.driver = "virtio-serial-pci",\
.property = "any_layout",\
.value = "off",\
},{\
.driver = "virtio-9p-pci",\
.property = "any_layout",\
.value = "off",\
},{\
.driver = "virtio-rng-pci",\
.property = "any_layout",\
.value = "off",\
},
#define HW_COMPAT_2_2 \
/* empty */

View File

@ -218,7 +218,9 @@ typedef struct VirtIORNGConf VirtIORNGConf;
DEFINE_PROP_BIT64("event_idx", _state, _field, \
VIRTIO_RING_F_EVENT_IDX, true), \
DEFINE_PROP_BIT64("notify_on_empty", _state, _field, \
VIRTIO_F_NOTIFY_ON_EMPTY, true)
VIRTIO_F_NOTIFY_ON_EMPTY, true), \
DEFINE_PROP_BIT64("any_layout", _state, _field, \
VIRTIO_F_ANY_LAYOUT, true)
hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n);
hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n);