void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)

{

    int i, r;



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

        vhost_virtqueue_cleanup(hdev,

                                vdev,

                                hdev->vqs + i,

                                i);

    }

    vhost_client_sync_dirty_bitmap(&hdev->client, 0,

                                   (target_phys_addr_t)~0x0ull);

    r = vdev->binding->set_guest_notifiers(vdev->binding_opaque, false);

    if (r < 0) {

        fprintf(stderr, "vhost guest notifier cleanup failed: %d\n", r);

        fflush(stderr);

    }

    assert (r >= 0);



    hdev->started = false;

    g_free(hdev->log);

    hdev->log = NULL;

    hdev->log_size = 0;

}

void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)

{

    int i, r;



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

        vhost_virtqueue_cleanup(hdev,

                                vdev,

                                hdev->vqs + i,

                                i);

    }

    vhost_client_sync_dirty_bitmap(&hdev->client, 0,

                                   (target_phys_addr_t)~0x0ull);

    r = vdev->binding->set_guest_notifiers(vdev->binding_opaque, false);

    if (r < 0) {

        fprintf(stderr, "vhost guest notifier cleanup failed: %d\n", r);

        fflush(stderr);

    }

    assert (r >= 0);



    hdev->started = false;

    g_free(hdev->log);

    hdev->log = NULL;

    hdev->log_size = 0;

}

                                   (target_phys_addr_t)~0x0ull);     vhost_client_sync_dirty_bitmap(&hdev->client, 0,                                    (target_phys_addr_t)~0x0ull);
void FUNC_0(struct vhost_dev *VAR_0, VirtIODevice *VAR_1)

{

    int VAR_2, VAR_3;



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

        vhost_virtqueue_cleanup(VAR_0,

                                VAR_1,

                                VAR_0->vqs + VAR_2,

                                VAR_2);

    }

    vhost_client_sync_dirty_bitmap(&VAR_0->client, 0,

                                   (target_phys_addr_t)~0x0ull);

    VAR_3 = VAR_1->binding->set_guest_notifiers(VAR_1->binding_opaque, false);

    if (VAR_3 < 0) {

        fprintf(stderr, "vhost guest notifier cleanup failed: %d\n", VAR_3);

        fflush(stderr);

    }

    assert (VAR_3 >= 0);



    VAR_0->started = false;

    g_free(VAR_0->log);

    VAR_0->log = NULL;

    VAR_0->log_size = 0;

}

void FUNC_0(struct vhost_dev *VAR_0, VirtIODevice *VAR_1)
{ int VAR_2, VAR_3; for (VAR_2 = 0; VAR_2 < VAR_0->nvqs; ++VAR_2) { vhost_virtqueue_cleanup(VAR_0,
VAR_1,
VAR_0->vqs + VAR_2,
VAR_2); } vhost_client_sync_dirty_bitmap(&VAR_0->client, 0,
(target_phys_addr_t)~0x0ull); VAR_3 = VAR_1->binding->set_guest_notifiers(VAR_1->binding_opaque, false); if (VAR_3 < 0) { fprintf(stderr, "vhost guest notifier cleanup failed: %d\n", VAR_3); fflush(stderr); } assert (VAR_3 >= 0); VAR_0->started = false; g_free(VAR_0->log); VAR_0->log = NULL; VAR_0->log_size = 0; }