iscsi_set_events(IscsiLun *iscsilun)

{

    struct iscsi_context *iscsi = iscsilun->iscsi;

    int ev = iscsi_which_events(iscsi);



    if (ev != iscsilun->events) {

        aio_set_fd_handler(iscsilun->aio_context,

                           iscsi_get_fd(iscsi),

                           (ev & POLLIN) ? iscsi_process_read : NULL,

                           (ev & POLLOUT) ? iscsi_process_write : NULL,

                           iscsilun);

        iscsilun->events = ev;

    }



    /* newer versions of libiscsi may return zero events. In this

     * case start a timer to ensure we are able to return to service

     * once this situation changes. */

    if (!ev) {

        timer_mod(iscsilun->event_timer,

                  qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + EVENT_INTERVAL);

    }

}

iscsi_set_events(IscsiLun *iscsilun)

{

    struct iscsi_context *iscsi = iscsilun->iscsi;

    int ev = iscsi_which_events(iscsi);



    if (ev != iscsilun->events) {

        aio_set_fd_handler(iscsilun->aio_context,

                           iscsi_get_fd(iscsi),

                           (ev & POLLIN) ? iscsi_process_read : NULL,

                           (ev & POLLOUT) ? iscsi_process_write : NULL,

                           iscsilun);

        iscsilun->events = ev;

    }



    





    if (!ev) {

        timer_mod(iscsilun->event_timer,

                  qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + EVENT_INTERVAL);

    }

}

    if (!ev) {         timer_mod(iscsilun->event_timer,                   qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + EVENT_INTERVAL);
FUNC_0(IscsiLun *VAR_0)

{

    struct iscsi_context *VAR_1 = VAR_0->VAR_1;

    int VAR_2 = iscsi_which_events(VAR_1);



    if (VAR_2 != VAR_0->events) {

        aio_set_fd_handler(VAR_0->aio_context,

                           iscsi_get_fd(VAR_1),

                           (VAR_2 & POLLIN) ? iscsi_process_read : NULL,

                           (VAR_2 & POLLOUT) ? iscsi_process_write : NULL,

                           VAR_0);

        VAR_0->events = VAR_2;

    }



    





    if (!VAR_2) {

        timer_mod(VAR_0->event_timer,

                  qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + EVENT_INTERVAL);

    }

}

FUNC_0(IscsiLun *VAR_0)
{ struct iscsi_context *VAR_1 = VAR_0->VAR_1; int VAR_2 = iscsi_which_events(VAR_1); if (VAR_2 != VAR_0->events) { aio_set_fd_handler(VAR_0->aio_context,
iscsi_get_fd(VAR_1),
(VAR_2 & POLLIN) ? iscsi_process_read : NULL,
(VAR_2 & POLLOUT) ? iscsi_process_write : NULL,
VAR_0); VAR_0->events = VAR_2; } if (!VAR_2) { timer_mod(VAR_0->event_timer,
qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + EVENT_INTERVAL); } }