virtio-pci: fix missing device properties
commit683c1d89efd1eeb111c129a9a91f629b94d90d45
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 25 Jun 2019 23:23:33 +0000 (26 01:23 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 4 Jul 2019 21:00:32 +0000 (4 17:00 -0400)
tree6c64eccef9258099ead96c8d4880a951e30ea276
parenta0a49813f7f2fc23bfe8a4fc6760e2a60c9a3e59
virtio-pci: fix missing device properties

Since commit a4ee4c8baa37154 ("virtio: Helper for registering virtio
device types"), virtio-gpu-pci, virtio-vga, and virtio-crypto-pci lost
some properties: "ioeventfd" and "vectors". This may cause various
issues, such as failing migration or invalid properties.

Since those VirtioPCI devices do not have a base name, their class are
initialized with virtio_pci_generic_base_class_init(). However, if the
VirtioPCIDeviceTypeInfo provided a class_init which sets dc->props,
the properties were overwritten by virtio_pci_generic_class_init().

Instead, introduce an intermediary base-type to register the generic
properties.

Fixes: a4ee4c8baa37154f42b4dc6a13fee79268d15238
Cc: qemu-stable@nongnu.org
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190625232333.30752-1-marcandre.lureau@redhat.com>
hw/virtio/virtio-pci.c