static void virtio_write_config(PCIDevice *pci_dev, uint32_t address,

                                uint32_t val, int len)

{

    VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);



    if (PCI_COMMAND == address) {

        if (!(val & PCI_COMMAND_MASTER)) {

            proxy->vdev->status &= !VIRTIO_CONFIG_S_DRIVER_OK;

        }

    }



    pci_default_write_config(pci_dev, address, val, len);

    if(proxy->vdev->nvectors)

        msix_write_config(pci_dev, address, val, len);

}

static void virtio_write_config(PCIDevice *pci_dev, uint32_t address,

                                uint32_t val, int len)

{

    VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);



    if (PCI_COMMAND == address) {

        if (!(val & PCI_COMMAND_MASTER)) {

            proxy->vdev->status &= !VIRTIO_CONFIG_S_DRIVER_OK;

        }

    }



    pci_default_write_config(pci_dev, address, val, len);

    if(proxy->vdev->nvectors)

        msix_write_config(pci_dev, address, val, len);

}

static void FUNC_0(PCIDevice *VAR_0, uint32_t VAR_1,

                                uint32_t VAR_2, int VAR_3)

{

    VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, VAR_0, VAR_0);



    if (PCI_COMMAND == VAR_1) {

        if (!(VAR_2 & PCI_COMMAND_MASTER)) {

            proxy->vdev->status &= !VIRTIO_CONFIG_S_DRIVER_OK;

        }

    }



    pci_default_write_config(VAR_0, VAR_1, VAR_2, VAR_3);

    if(proxy->vdev->nvectors)

        msix_write_config(VAR_0, VAR_1, VAR_2, VAR_3);

}

static void FUNC_0(PCIDevice *VAR_0, uint32_t VAR_1,
uint32_t VAR_2, int VAR_3)
{ VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, VAR_0, VAR_0); if (PCI_COMMAND == VAR_1) { if (!(VAR_2 & PCI_COMMAND_MASTER)) { proxy->vdev->status &= !VIRTIO_CONFIG_S_DRIVER_OK; } } pci_default_write_config(VAR_0, VAR_1, VAR_2, VAR_3); if(proxy->vdev->nvectors)
msix_write_config(VAR_0, VAR_1, VAR_2, VAR_3); }