static void qemu_chr_fe_write_log(CharDriverState *s,

                                  const uint8_t *buf, size_t len)

{

    size_t done = 0;

    ssize_t ret;



    if (s->logfd < 0) {

        return;

    }



    while (done < len) {

        do {

            ret = write(s->logfd, buf + done, len - done);

            if (ret == -1 && errno == EAGAIN) {

                g_usleep(100);

            }

        } while (ret == -1 && errno == EAGAIN);



        if (ret <= 0) {

            return;

        }

        done += ret;

    }

}

static void qemu_chr_fe_write_log(CharDriverState *s,

                                  const uint8_t *buf, size_t len)

{

    size_t done = 0;

    ssize_t ret;



    if (s->logfd < 0) {

        return;

    }



    while (done < len) {

        do {

            ret = write(s->logfd, buf + done, len - done);

            if (ret == -1 && errno == EAGAIN) {

                g_usleep(100);

            }

        } while (ret == -1 && errno == EAGAIN);



        if (ret <= 0) {

            return;

        }

        done += ret;

    }

}

        do {             ret = write(s->logfd, buf + done, len - done);             if (ret == -1 && errno == EAGAIN) {                 g_usleep(100);         } while (ret == -1 && errno == EAGAIN);         do {                 g_usleep(100);         do {                 g_usleep(100);
static void FUNC_0(CharDriverState *VAR_0,

                                  const uint8_t *VAR_1, size_t VAR_2)

{

    size_t done = 0;

    ssize_t ret;



    if (VAR_0->logfd < 0) {

        return;

    }



    while (done < VAR_2) {

        do {

            ret = write(VAR_0->logfd, VAR_1 + done, VAR_2 - done);

            if (ret == -1 && errno == EAGAIN) {

                g_usleep(100);

            }

        } while (ret == -1 && errno == EAGAIN);



        if (ret <= 0) {

            return;

        }

        done += ret;

    }

}

static void FUNC_0(CharDriverState *VAR_0,
const uint8_t *VAR_1, size_t VAR_2)
{ size_t done = 0; ssize_t ret; if (VAR_0->logfd < 0) { return; } while (done < VAR_2) { do { ret = write(VAR_0->logfd, VAR_1 + done, VAR_2 - done); if (ret == -1 && errno == EAGAIN) { g_usleep(100); } } while (ret == -1 && errno == EAGAIN); if (ret <= 0) { return; } done += ret; } }