static void virtio_gpu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)

{

    VirtIOGPUPCI *vgpu = VIRTIO_GPU_PCI(vpci_dev);

    VirtIOGPU *g = &vgpu->vdev;

    DeviceState *vdev = DEVICE(&vgpu->vdev);

    int i;



    qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));

    /* force virtio-1.0 */

    vpci_dev->flags &= ~VIRTIO_PCI_FLAG_DISABLE_MODERN;

    vpci_dev->flags |= VIRTIO_PCI_FLAG_DISABLE_LEGACY;

    object_property_set_bool(OBJECT(vdev), true, "realized", errp);



    for (i = 0; i < g->conf.max_outputs; i++) {

        object_property_set_link(OBJECT(g->scanout[i].con),

                                 OBJECT(vpci_dev),

                                 "device", errp);

    }

}

static void virtio_gpu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)

{

    VirtIOGPUPCI *vgpu = VIRTIO_GPU_PCI(vpci_dev);

    VirtIOGPU *g = &vgpu->vdev;

    DeviceState *vdev = DEVICE(&vgpu->vdev);

    int i;



    qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));

    

    vpci_dev->flags &= ~VIRTIO_PCI_FLAG_DISABLE_MODERN;

    vpci_dev->flags |= VIRTIO_PCI_FLAG_DISABLE_LEGACY;

    object_property_set_bool(OBJECT(vdev), true, "realized", errp);



    for (i = 0; i < g->conf.max_outputs; i++) {

        object_property_set_link(OBJECT(g->scanout[i].con),

                                 OBJECT(vpci_dev),

                                 "device", errp);

    }

}

static void FUNC_0(VirtIOPCIProxy *VAR_0, Error **VAR_1)

{

    VirtIOGPUPCI *vgpu = VIRTIO_GPU_PCI(VAR_0);

    VirtIOGPU *g = &vgpu->vdev;

    DeviceState *vdev = DEVICE(&vgpu->vdev);

    int VAR_2;



    qdev_set_parent_bus(vdev, BUS(&VAR_0->bus));

    

    VAR_0->flags &= ~VIRTIO_PCI_FLAG_DISABLE_MODERN;

    VAR_0->flags |= VIRTIO_PCI_FLAG_DISABLE_LEGACY;

    object_property_set_bool(OBJECT(vdev), true, "realized", VAR_1);



    for (VAR_2 = 0; VAR_2 < g->conf.max_outputs; VAR_2++) {

        object_property_set_link(OBJECT(g->scanout[VAR_2].con),

                                 OBJECT(VAR_0),

                                 "device", VAR_1);

    }

}

static void FUNC_0(VirtIOPCIProxy *VAR_0, Error **VAR_1)
{ VirtIOGPUPCI *vgpu = VIRTIO_GPU_PCI(VAR_0); VirtIOGPU *g = &vgpu->vdev; DeviceState *vdev = DEVICE(&vgpu->vdev); int VAR_2; qdev_set_parent_bus(vdev, BUS(&VAR_0->bus)); VAR_0->flags &= ~VIRTIO_PCI_FLAG_DISABLE_MODERN; VAR_0->flags |= VIRTIO_PCI_FLAG_DISABLE_LEGACY; object_property_set_bool(OBJECT(vdev), true, "realized", VAR_1); for (VAR_2 = 0; VAR_2 < g->conf.max_outputs; VAR_2++) { object_property_set_link(OBJECT(g->scanout[VAR_2].con),
OBJECT(VAR_0),
"device", VAR_1); } }