blob: 17784161150ea07465b3d0785f543792e190f375 [file] [log] [blame]
Michael Roth125b3102012-01-19 00:18:20 -06001/*
2 * QEMU Guest Agent channel declarations
3 *
4 * Copyright IBM Corp. 2012
5 *
6 * Authors:
7 * Michael Roth <mdroth@linux.vnet.ibm.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
11 */
12#ifndef QGA_CHANNEL_H
13#define QGA_CHANNEL_H
14
Michael Roth125b3102012-01-19 00:18:20 -060015
16typedef struct GAChannel GAChannel;
17
18typedef enum {
19 GA_CHANNEL_VIRTIO_SERIAL,
20 GA_CHANNEL_ISA_SERIAL,
21 GA_CHANNEL_UNIX_LISTEN,
Stefan Hajnoczi586ef5d2016-10-14 10:00:56 +010022 GA_CHANNEL_VSOCK_LISTEN,
Michael Roth125b3102012-01-19 00:18:20 -060023} GAChannelMethod;
24
25typedef gboolean (*GAChannelCallback)(GIOCondition condition, gpointer opaque);
26
27GAChannel *ga_channel_new(GAChannelMethod method, const gchar *path,
Stefan Hajnoczi26de2292017-01-06 15:29:30 +000028 int listen_fd, GAChannelCallback cb,
29 gpointer opaque);
Michael Roth125b3102012-01-19 00:18:20 -060030void ga_channel_free(GAChannel *c);
31GIOStatus ga_channel_read(GAChannel *c, gchar *buf, gsize size, gsize *count);
32GIOStatus ga_channel_write_all(GAChannel *c, const gchar *buf, gsize size);
33
34#endif