static void virtio_scsi_migration_state_changed(Notifier *notifier, void *data)

{

    VirtIOSCSI *s = container_of(notifier, VirtIOSCSI,

                                 migration_state_notifier);

    MigrationState *mig = data;



    if (migration_in_setup(mig)) {

        if (!s->dataplane_started) {

            return;

        }

        virtio_scsi_dataplane_stop(s);

        s->dataplane_disabled = true;

    } else if (migration_has_finished(mig) ||

               migration_has_failed(mig)) {

        if (s->dataplane_started) {

            return;

        }

        bdrv_drain_all(); /* complete in-flight non-dataplane requests */

        s->dataplane_disabled = false;

    }

}

static void virtio_scsi_migration_state_changed(Notifier *notifier, void *data)

{

    VirtIOSCSI *s = container_of(notifier, VirtIOSCSI,

                                 migration_state_notifier);

    MigrationState *mig = data;



    if (migration_in_setup(mig)) {

        if (!s->dataplane_started) {

            return;

        }

        virtio_scsi_dataplane_stop(s);

        s->dataplane_disabled = true;

    } else if (migration_has_finished(mig) ||

               migration_has_failed(mig)) {

        if (s->dataplane_started) {

            return;

        }

        bdrv_drain_all(); 

        s->dataplane_disabled = false;

    }

}

static void FUNC_0(Notifier *VAR_0, void *VAR_1)

{

    VirtIOSCSI *s = container_of(VAR_0, VirtIOSCSI,

                                 migration_state_notifier);

    MigrationState *mig = VAR_1;



    if (migration_in_setup(mig)) {

        if (!s->dataplane_started) {

            return;

        }

        virtio_scsi_dataplane_stop(s);

        s->dataplane_disabled = true;

    } else if (migration_has_finished(mig) ||

               migration_has_failed(mig)) {

        if (s->dataplane_started) {

            return;

        }

        bdrv_drain_all(); 

        s->dataplane_disabled = false;

    }

}

static void FUNC_0(Notifier *VAR_0, void *VAR_1)
{ VirtIOSCSI *s = container_of(VAR_0, VirtIOSCSI,
migration_state_notifier); MigrationState *mig = VAR_1; if (migration_in_setup(mig)) { if (!s->dataplane_started) { return; } virtio_scsi_dataplane_stop(s); s->dataplane_disabled = true; } else if (migration_has_finished(mig) || migration_has_failed(mig)) { if (s->dataplane_started) { return; } bdrv_drain_all(); s->dataplane_disabled = false; } }