void qemu_fflush(QEMUFile *f)

{

    if (!f->is_writable)

        return;

    if (f->buf_index > 0) {

        if (f->is_file) {

            fseek(f->outfile, f->buf_offset, SEEK_SET);

            fwrite(f->buf, 1, f->buf_index, f->outfile);

        } else {

            bdrv_pwrite(f->bs, f->base_offset + f->buf_offset,

                        f->buf, f->buf_index);

        }

        f->buf_offset += f->buf_index;

        f->buf_index = 0;

    }

}

void qemu_fflush(QEMUFile *f)

{

    if (!f->is_writable)

        return;

    if (f->buf_index > 0) {

        if (f->is_file) {

            fseek(f->outfile, f->buf_offset, SEEK_SET);

            fwrite(f->buf, 1, f->buf_index, f->outfile);

        } else {

            bdrv_pwrite(f->bs, f->base_offset + f->buf_offset,

                        f->buf, f->buf_index);

        }

        f->buf_offset += f->buf_index;

        f->buf_index = 0;

    }

}

void FUNC_0(QEMUFile *VAR_0)

{

    if (!VAR_0->is_writable)

        return;

    if (VAR_0->buf_index > 0) {

        if (VAR_0->is_file) {

            fseek(VAR_0->outfile, VAR_0->buf_offset, SEEK_SET);

            fwrite(VAR_0->buf, 1, VAR_0->buf_index, VAR_0->outfile);

        } else {

            bdrv_pwrite(VAR_0->bs, VAR_0->base_offset + VAR_0->buf_offset,

                        VAR_0->buf, VAR_0->buf_index);

        }

        VAR_0->buf_offset += VAR_0->buf_index;

        VAR_0->buf_index = 0;

    }

}

void FUNC_0(QEMUFile *VAR_0)
{ if (!VAR_0->is_writable)
return; if (VAR_0->buf_index > 0) { if (VAR_0->is_file) { fseek(VAR_0->outfile, VAR_0->buf_offset, SEEK_SET); fwrite(VAR_0->buf, 1, VAR_0->buf_index, VAR_0->outfile); } else { bdrv_pwrite(VAR_0->bs, VAR_0->base_offset + VAR_0->buf_offset,
VAR_0->buf, VAR_0->buf_index); } VAR_0->buf_offset += VAR_0->buf_index; VAR_0->buf_index = 0; } }