mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
virtio: move host_features
Move host_features from the individual transport proxies into the virtio device. Transports may continue to add feature bits during device plugging. This should it make easier to offer different sets of host features for virtio-1/transitional support. Tested-by: Shannon Zhao <shannon.zhao@linaro.org> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
2332333c97
commit
6b8f102054
11 changed files with 30 additions and 99 deletions
|
@ -306,7 +306,7 @@ static uint32_t virtio_ioport_read(VirtIOPCIProxy *proxy, uint32_t addr)
|
|||
|
||||
switch (addr) {
|
||||
case VIRTIO_PCI_HOST_FEATURES:
|
||||
ret = proxy->host_features;
|
||||
ret = vdev->host_features;
|
||||
break;
|
||||
case VIRTIO_PCI_GUEST_FEATURES:
|
||||
ret = vdev->guest_features;
|
||||
|
@ -434,12 +434,6 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address,
|
|||
}
|
||||
}
|
||||
|
||||
static unsigned virtio_pci_get_features(DeviceState *d)
|
||||
{
|
||||
VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d);
|
||||
return proxy->host_features;
|
||||
}
|
||||
|
||||
static int kvm_virtio_pci_vq_vector_use(VirtIOPCIProxy *proxy,
|
||||
unsigned int queue_no,
|
||||
unsigned int vector,
|
||||
|
@ -924,6 +918,7 @@ static void virtio_pci_device_plugged(DeviceState *d)
|
|||
VirtioBusState *bus = &proxy->bus;
|
||||
uint8_t *config;
|
||||
uint32_t size;
|
||||
VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
|
||||
|
||||
config = proxy->pci_dev.config;
|
||||
if (proxy->class_code) {
|
||||
|
@ -958,10 +953,8 @@ static void virtio_pci_device_plugged(DeviceState *d)
|
|||
proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD;
|
||||
}
|
||||
|
||||
virtio_add_feature(&proxy->host_features, VIRTIO_F_NOTIFY_ON_EMPTY);
|
||||
virtio_add_feature(&proxy->host_features, VIRTIO_F_BAD_FEATURE);
|
||||
proxy->host_features = virtio_bus_get_vdev_features(bus,
|
||||
proxy->host_features);
|
||||
virtio_add_feature(&vdev->host_features, VIRTIO_F_NOTIFY_ON_EMPTY);
|
||||
virtio_add_feature(&vdev->host_features, VIRTIO_F_BAD_FEATURE);
|
||||
}
|
||||
|
||||
static void virtio_pci_device_unplugged(DeviceState *d)
|
||||
|
@ -999,7 +992,6 @@ static void virtio_pci_reset(DeviceState *qdev)
|
|||
static Property virtio_pci_properties[] = {
|
||||
DEFINE_PROP_BIT("virtio-pci-bus-master-bug-migration", VirtIOPCIProxy, flags,
|
||||
VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT, false),
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
|
@ -1469,7 +1461,6 @@ static void virtio_pci_bus_class_init(ObjectClass *klass, void *data)
|
|||
k->load_config = virtio_pci_load_config;
|
||||
k->save_queue = virtio_pci_save_queue;
|
||||
k->load_queue = virtio_pci_load_queue;
|
||||
k->get_features = virtio_pci_get_features;
|
||||
k->query_guest_notifiers = virtio_pci_query_guest_notifiers;
|
||||
k->set_host_notifier = virtio_pci_set_host_notifier;
|
||||
k->set_guest_notifiers = virtio_pci_set_guest_notifiers;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue