void qmp_guest_file_close(int64_t handle, Error **err)

{

    GuestFileHandle *gfh = guest_file_handle_find(handle, err);

    int ret;



    slog("guest-file-close called, handle: %ld", handle);

    if (!gfh) {

        return;

    }



    ret = fclose(gfh->fh);

    if (ret == -1) {

        error_set(err, QERR_QGA_COMMAND_FAILED, "fclose() failed");

        return;

    }



    QTAILQ_REMOVE(&guest_file_state.filehandles, gfh, next);

    g_free(gfh);

}

void qmp_guest_file_close(int64_t handle, Error **err)

{

    GuestFileHandle *gfh = guest_file_handle_find(handle, err);

    int ret;



    slog("guest-file-close called, handle: %ld", handle);

    if (!gfh) {

        return;

    }



    ret = fclose(gfh->fh);

    if (ret == -1) {

        error_set(err, QERR_QGA_COMMAND_FAILED, "fclose() failed");

        return;

    }



    QTAILQ_REMOVE(&guest_file_state.filehandles, gfh, next);

    g_free(gfh);

}

void FUNC_0(int64_t VAR_0, Error **VAR_1)

{

    GuestFileHandle *gfh = guest_file_handle_find(VAR_0, VAR_1);

    int VAR_2;



    slog("guest-file-close called, VAR_0: %ld", VAR_0);

    if (!gfh) {

        return;

    }



    VAR_2 = fclose(gfh->fh);

    if (VAR_2 == -1) {

        error_set(VAR_1, QERR_QGA_COMMAND_FAILED, "fclose() failed");

        return;

    }



    QTAILQ_REMOVE(&guest_file_state.filehandles, gfh, next);

    g_free(gfh);

}

void FUNC_0(int64_t VAR_0, Error **VAR_1)
{ GuestFileHandle *gfh = guest_file_handle_find(VAR_0, VAR_1); int VAR_2; slog("guest-file-close called, VAR_0: %ld", VAR_0); if (!gfh) { return; } VAR_2 = fclose(gfh->fh); if (VAR_2 == -1) { error_set(VAR_1, QERR_QGA_COMMAND_FAILED, "fclose() failed"); return; } QTAILQ_REMOVE(&guest_file_state.filehandles, gfh, next); g_free(gfh); }