static int vhost_sync_dirty_bitmap(struct vhost_dev *dev,

                                   MemoryRegionSection *section,

                                   hwaddr start_addr,

                                   hwaddr end_addr)

{

    int i;



    if (!dev->log_enabled || !dev->started) {

        return 0;

    }

    for (i = 0; i < dev->mem->nregions; ++i) {

        struct vhost_memory_region *reg = dev->mem->regions + i;

        vhost_dev_sync_region(dev, section, start_addr, end_addr,

                              reg->guest_phys_addr,

                              range_get_last(reg->guest_phys_addr,

                                             reg->memory_size));

    }

    for (i = 0; i < dev->nvqs; ++i) {

        struct vhost_virtqueue *vq = dev->vqs + i;

        vhost_dev_sync_region(dev, section, start_addr, end_addr, vq->used_phys,

                              range_get_last(vq->used_phys, vq->used_size));

    }

    return 0;

}

static int vhost_sync_dirty_bitmap(struct vhost_dev *dev,

                                   MemoryRegionSection *section,

                                   hwaddr start_addr,

                                   hwaddr end_addr)

{

    int i;



    if (!dev->log_enabled || !dev->started) {

        return 0;

    }

    for (i = 0; i < dev->mem->nregions; ++i) {

        struct vhost_memory_region *reg = dev->mem->regions + i;

        vhost_dev_sync_region(dev, section, start_addr, end_addr,

                              reg->guest_phys_addr,

                              range_get_last(reg->guest_phys_addr,

                                             reg->memory_size));

    }

    for (i = 0; i < dev->nvqs; ++i) {

        struct vhost_virtqueue *vq = dev->vqs + i;

        vhost_dev_sync_region(dev, section, start_addr, end_addr, vq->used_phys,

                              range_get_last(vq->used_phys, vq->used_size));

    }

    return 0;

}

                                   hwaddr start_addr,                                    hwaddr end_addr)
static int FUNC_0(struct vhost_dev *VAR_0,

                                   MemoryRegionSection *VAR_1,

                                   hwaddr VAR_2,

                                   hwaddr VAR_3)

{

    int VAR_4;



    if (!VAR_0->log_enabled || !VAR_0->started) {

        return 0;

    }

    for (VAR_4 = 0; VAR_4 < VAR_0->mem->nregions; ++VAR_4) {

        struct vhost_memory_region *VAR_5 = VAR_0->mem->regions + VAR_4;

        vhost_dev_sync_region(VAR_0, VAR_1, VAR_2, VAR_3,

                              VAR_5->guest_phys_addr,

                              range_get_last(VAR_5->guest_phys_addr,

                                             VAR_5->memory_size));

    }

    for (VAR_4 = 0; VAR_4 < VAR_0->nvqs; ++VAR_4) {

        struct vhost_virtqueue *VAR_6 = VAR_0->vqs + VAR_4;

        vhost_dev_sync_region(VAR_0, VAR_1, VAR_2, VAR_3, VAR_6->used_phys,

                              range_get_last(VAR_6->used_phys, VAR_6->used_size));

    }

    return 0;

}

static int FUNC_0(struct vhost_dev *VAR_0,
MemoryRegionSection *VAR_1,
hwaddr VAR_2,
hwaddr VAR_3)
{ int VAR_4; if (!VAR_0->log_enabled || !VAR_0->started) { return 0; } for (VAR_4 = 0; VAR_4 < VAR_0->mem->nregions; ++VAR_4) { struct vhost_memory_region *VAR_5 = VAR_0->mem->regions + VAR_4; vhost_dev_sync_region(VAR_0, VAR_1, VAR_2, VAR_3,
VAR_5->guest_phys_addr,
range_get_last(VAR_5->guest_phys_addr,
VAR_5->memory_size)); } for (VAR_4 = 0; VAR_4 < VAR_0->nvqs; ++VAR_4) { struct vhost_virtqueue *VAR_6 = VAR_0->vqs + VAR_4; vhost_dev_sync_region(VAR_0, VAR_1, VAR_2, VAR_3, VAR_6->used_phys,
range_get_last(VAR_6->used_phys, VAR_6->used_size)); } return 0; }