diff mbox series

[3/4] hw/virtio/virtio-balloon: Remove the "class" property

Message ID 20210203171832.483176-4-thuth@redhat.com
State New
Headers show
Series Remove the deprecated pc-1.x machine types and related stuff | expand

Commit Message

Thomas Huth Feb. 3, 2021, 5:18 p.m. UTC
This property was only required for compatibility reasons in the
pc-1.0 machine type and earlier. Now that these machine types have
been removed, the property is not useful anymore.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/virtio/virtio-balloon-pci.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

David Hildenbrand Feb. 3, 2021, 7:42 p.m. UTC | #1
On 03.02.21 18:18, Thomas Huth wrote:
> This property was only required for compatibility reasons in the
> pc-1.0 machine type and earlier. Now that these machine types have
> been removed, the property is not useful anymore.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   hw/virtio/virtio-balloon-pci.c | 11 +----------
>   1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/hw/virtio/virtio-balloon-pci.c b/hw/virtio/virtio-balloon-pci.c
> index a2c5cc7207..79a3ba979a 100644
> --- a/hw/virtio/virtio-balloon-pci.c
> +++ b/hw/virtio/virtio-balloon-pci.c
> @@ -34,21 +34,13 @@ struct VirtIOBalloonPCI {
>       VirtIOPCIProxy parent_obj;
>       VirtIOBalloon vdev;
>   };
> -static Property virtio_balloon_pci_properties[] = {
> -    DEFINE_PROP_UINT32("class", VirtIOPCIProxy, class_code, 0),
> -    DEFINE_PROP_END_OF_LIST(),
> -};
>   
>   static void virtio_balloon_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
>   {
>       VirtIOBalloonPCI *dev = VIRTIO_BALLOON_PCI(vpci_dev);
>       DeviceState *vdev = DEVICE(&dev->vdev);
>   
> -    if (vpci_dev->class_code != PCI_CLASS_OTHERS &&
> -        vpci_dev->class_code != PCI_CLASS_MEMORY_RAM) { /* qemu < 1.1 */
> -        vpci_dev->class_code = PCI_CLASS_OTHERS;
> -    }
> -
> +    vpci_dev->class_code = PCI_CLASS_OTHERS;
>       qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
>   }
>   
> @@ -59,7 +51,6 @@ static void virtio_balloon_pci_class_init(ObjectClass *klass, void *data)
>       PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
>       k->realize = virtio_balloon_pci_realize;
>       set_bit(DEVICE_CATEGORY_MISC, dc->categories);
> -    device_class_set_props(dc, virtio_balloon_pci_properties);
>       pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
>       pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_BALLOON;
>       pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;
> 

Acked-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/hw/virtio/virtio-balloon-pci.c b/hw/virtio/virtio-balloon-pci.c
index a2c5cc7207..79a3ba979a 100644
--- a/hw/virtio/virtio-balloon-pci.c
+++ b/hw/virtio/virtio-balloon-pci.c
@@ -34,21 +34,13 @@  struct VirtIOBalloonPCI {
     VirtIOPCIProxy parent_obj;
     VirtIOBalloon vdev;
 };
-static Property virtio_balloon_pci_properties[] = {
-    DEFINE_PROP_UINT32("class", VirtIOPCIProxy, class_code, 0),
-    DEFINE_PROP_END_OF_LIST(),
-};
 
 static void virtio_balloon_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
     VirtIOBalloonPCI *dev = VIRTIO_BALLOON_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
 
-    if (vpci_dev->class_code != PCI_CLASS_OTHERS &&
-        vpci_dev->class_code != PCI_CLASS_MEMORY_RAM) { /* qemu < 1.1 */
-        vpci_dev->class_code = PCI_CLASS_OTHERS;
-    }
-
+    vpci_dev->class_code = PCI_CLASS_OTHERS;
     qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }
 
@@ -59,7 +51,6 @@  static void virtio_balloon_pci_class_init(ObjectClass *klass, void *data)
     PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
     k->realize = virtio_balloon_pci_realize;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
-    device_class_set_props(dc, virtio_balloon_pci_properties);
     pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
     pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_BALLOON;
     pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;