static int htab_save_complete(QEMUFile *f, void *opaque)

{

    sPAPRMachineState *spapr = opaque;



    /* Iteration header */

    qemu_put_be32(f, 0);



    if (!spapr->htab) {

        int rc;



        assert(kvm_enabled());



        rc = spapr_check_htab_fd(spapr);

        if (rc < 0) {

            return rc;

        }



        rc = kvmppc_save_htab(f, spapr->htab_fd, MAX_KVM_BUF_SIZE, -1);

        if (rc < 0) {

            return rc;

        }

        close(spapr->htab_fd);

        spapr->htab_fd = -1;

    } else {

        htab_save_later_pass(f, spapr, -1);

    }



    /* End marker */

    qemu_put_be32(f, 0);

    qemu_put_be16(f, 0);

    qemu_put_be16(f, 0);



    return 0;

}

static int htab_save_complete(QEMUFile *f, void *opaque)

{

    sPAPRMachineState *spapr = opaque;



    

    qemu_put_be32(f, 0);



    if (!spapr->htab) {

        int rc;



        assert(kvm_enabled());



        rc = spapr_check_htab_fd(spapr);

        if (rc < 0) {

            return rc;

        }



        rc = kvmppc_save_htab(f, spapr->htab_fd, MAX_KVM_BUF_SIZE, -1);

        if (rc < 0) {

            return rc;

        }

        close(spapr->htab_fd);

        spapr->htab_fd = -1;

    } else {

        htab_save_later_pass(f, spapr, -1);

    }



    

    qemu_put_be32(f, 0);

    qemu_put_be16(f, 0);

    qemu_put_be16(f, 0);



    return 0;

}

static int FUNC_0(QEMUFile *VAR_0, void *VAR_1)

{

    sPAPRMachineState *spapr = VAR_1;



    

    qemu_put_be32(VAR_0, 0);



    if (!spapr->htab) {

        int VAR_2;



        assert(kvm_enabled());



        VAR_2 = spapr_check_htab_fd(spapr);

        if (VAR_2 < 0) {

            return VAR_2;

        }



        VAR_2 = kvmppc_save_htab(VAR_0, spapr->htab_fd, MAX_KVM_BUF_SIZE, -1);

        if (VAR_2 < 0) {

            return VAR_2;

        }

        close(spapr->htab_fd);

        spapr->htab_fd = -1;

    } else {

        htab_save_later_pass(VAR_0, spapr, -1);

    }



    

    qemu_put_be32(VAR_0, 0);

    qemu_put_be16(VAR_0, 0);

    qemu_put_be16(VAR_0, 0);



    return 0;

}

static int FUNC_0(QEMUFile *VAR_0, void *VAR_1)
{ sPAPRMachineState *spapr = VAR_1; qemu_put_be32(VAR_0, 0); if (!spapr->htab) { int VAR_2; assert(kvm_enabled()); VAR_2 = spapr_check_htab_fd(spapr); if (VAR_2 < 0) { return VAR_2; } VAR_2 = kvmppc_save_htab(VAR_0, spapr->htab_fd, MAX_KVM_BUF_SIZE, -1); if (VAR_2 < 0) { return VAR_2; } close(spapr->htab_fd); spapr->htab_fd = -1; } else { htab_save_later_pass(VAR_0, spapr, -1); } qemu_put_be32(VAR_0, 0); qemu_put_be16(VAR_0, 0); qemu_put_be16(VAR_0, 0); return 0; }