static int nbd_negotiate_write(QIOChannel *ioc, const void *buffer, size_t size)

{

    ssize_t ret;

    guint watch;



    assert(qemu_in_coroutine());

    /* Negotiation are always in main loop. */

    watch = qio_channel_add_watch(ioc,

                                  G_IO_OUT,

                                  nbd_negotiate_continue,

                                  qemu_coroutine_self(),

                                  NULL);

    ret = write_sync(ioc, buffer, size, NULL);

    g_source_remove(watch);

    return ret;

}

static int nbd_negotiate_write(QIOChannel *ioc, const void *buffer, size_t size)

{

    ssize_t ret;

    guint watch;



    assert(qemu_in_coroutine());

    

    watch = qio_channel_add_watch(ioc,

                                  G_IO_OUT,

                                  nbd_negotiate_continue,

                                  qemu_coroutine_self(),

                                  NULL);

    ret = write_sync(ioc, buffer, size, NULL);

    g_source_remove(watch);

    return ret;

}

static int FUNC_0(QIOChannel *VAR_0, const void *VAR_1, size_t VAR_2)

{

    ssize_t ret;

    guint watch;



    assert(qemu_in_coroutine());

    

    watch = qio_channel_add_watch(VAR_0,

                                  G_IO_OUT,

                                  nbd_negotiate_continue,

                                  qemu_coroutine_self(),

                                  NULL);

    ret = write_sync(VAR_0, VAR_1, VAR_2, NULL);

    g_source_remove(watch);

    return ret;

}

static int FUNC_0(QIOChannel *VAR_0, const void *VAR_1, size_t VAR_2)
{ ssize_t ret; guint watch; assert(qemu_in_coroutine()); watch = qio_channel_add_watch(VAR_0,
G_IO_OUT,
nbd_negotiate_continue,
qemu_coroutine_self(),
NULL); ret = write_sync(VAR_0, VAR_1, VAR_2, NULL); g_source_remove(watch); return ret; }