Statistics
| Branch: | Revision:

root / qga / channel.h @ ef5b2344

History | View | Annotate | Download (912 Bytes)

1 125b310e Michael Roth
/*
2 125b310e Michael Roth
 * QEMU Guest Agent channel declarations
3 125b310e Michael Roth
 *
4 125b310e Michael Roth
 * Copyright IBM Corp. 2012
5 125b310e Michael Roth
 *
6 125b310e Michael Roth
 * Authors:
7 125b310e Michael Roth
 *  Michael Roth      <mdroth@linux.vnet.ibm.com>
8 125b310e Michael Roth
 *
9 125b310e Michael Roth
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 125b310e Michael Roth
 * See the COPYING file in the top-level directory.
11 125b310e Michael Roth
 */
12 125b310e Michael Roth
#ifndef QGA_CHANNEL_H
13 125b310e Michael Roth
#define QGA_CHANNEL_H
14 125b310e Michael Roth
15 125b310e Michael Roth
#include <glib.h>
16 125b310e Michael Roth
17 125b310e Michael Roth
typedef struct GAChannel GAChannel;
18 125b310e Michael Roth
19 125b310e Michael Roth
typedef enum {
20 125b310e Michael Roth
    GA_CHANNEL_VIRTIO_SERIAL,
21 125b310e Michael Roth
    GA_CHANNEL_ISA_SERIAL,
22 125b310e Michael Roth
    GA_CHANNEL_UNIX_LISTEN,
23 125b310e Michael Roth
} GAChannelMethod;
24 125b310e Michael Roth
25 125b310e Michael Roth
typedef gboolean (*GAChannelCallback)(GIOCondition condition, gpointer opaque);
26 125b310e Michael Roth
27 125b310e Michael Roth
GAChannel *ga_channel_new(GAChannelMethod method, const gchar *path,
28 125b310e Michael Roth
                          GAChannelCallback cb, gpointer opaque);
29 125b310e Michael Roth
void ga_channel_free(GAChannel *c);
30 125b310e Michael Roth
GIOStatus ga_channel_read(GAChannel *c, gchar *buf, gsize size, gsize *count);
31 125b310e Michael Roth
GIOStatus ga_channel_write_all(GAChannel *c, const gchar *buf, gsize size);
32 125b310e Michael Roth
33 125b310e Michael Roth
#endif