void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s)

{

    if (!s->started) {

        return;

    }

    s->started = false;

    trace_virtio_blk_data_plane_stop(s);



    /* Stop thread or cancel pending thread creation BH */

    if (s->start_bh) {

        qemu_bh_delete(s->start_bh);

        s->start_bh = NULL;

    } else {

        event_poll_notify(&s->event_poll);

        qemu_thread_join(&s->thread);

    }



    ioq_cleanup(&s->ioqueue);



    s->vdev->binding->set_host_notifier(s->vdev->binding_opaque, 0, false);



    event_poll_cleanup(&s->event_poll);



    /* Clean up guest notifier (irq) */

    s->vdev->binding->set_guest_notifiers(s->vdev->binding_opaque, 1, false);



    vring_teardown(&s->vring);

}

void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s)

{

    if (!s->started) {

        return;

    }

    s->started = false;

    trace_virtio_blk_data_plane_stop(s);



    

    if (s->start_bh) {

        qemu_bh_delete(s->start_bh);

        s->start_bh = NULL;

    } else {

        event_poll_notify(&s->event_poll);

        qemu_thread_join(&s->thread);

    }



    ioq_cleanup(&s->ioqueue);



    s->vdev->binding->set_host_notifier(s->vdev->binding_opaque, 0, false);



    event_poll_cleanup(&s->event_poll);



    

    s->vdev->binding->set_guest_notifiers(s->vdev->binding_opaque, 1, false);



    vring_teardown(&s->vring);

}

    if (!s->started) {     s->started = false;
void FUNC_0(VirtIOBlockDataPlane *VAR_0)

{

    if (!VAR_0->started) {

        return;

    }

    VAR_0->started = false;

    trace_virtio_blk_data_plane_stop(VAR_0);



    

    if (VAR_0->start_bh) {

        qemu_bh_delete(VAR_0->start_bh);

        VAR_0->start_bh = NULL;

    } else {

        event_poll_notify(&VAR_0->event_poll);

        qemu_thread_join(&VAR_0->thread);

    }



    ioq_cleanup(&VAR_0->ioqueue);



    VAR_0->vdev->binding->set_host_notifier(VAR_0->vdev->binding_opaque, 0, false);



    event_poll_cleanup(&VAR_0->event_poll);



    

    VAR_0->vdev->binding->set_guest_notifiers(VAR_0->vdev->binding_opaque, 1, false);



    vring_teardown(&VAR_0->vring);

}

void FUNC_0(VirtIOBlockDataPlane *VAR_0)
{ if (!VAR_0->started) { return; } VAR_0->started = false; trace_virtio_blk_data_plane_stop(VAR_0); if (VAR_0->start_bh) { qemu_bh_delete(VAR_0->start_bh); VAR_0->start_bh = NULL; } else { event_poll_notify(&VAR_0->event_poll); qemu_thread_join(&VAR_0->thread); } ioq_cleanup(&VAR_0->ioqueue); VAR_0->vdev->binding->set_host_notifier(VAR_0->vdev->binding_opaque, 0, false); event_poll_cleanup(&VAR_0->event_poll); VAR_0->vdev->binding->set_guest_notifiers(VAR_0->vdev->binding_opaque, 1, false); vring_teardown(&VAR_0->vring); }