1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
4 #ifndef _GUEST_CHANNEL_H
5 #define _GUEST_CHANNEL_H
11 #include <channel_commands.h>
14 * Check if any Virtio-Serial VM end-points exist in path.
17 * The path to the serial device on the filesystem
20 * - 1 if at least one potential end-point found.
21 * - 0 if no end-points found.
23 int guest_channel_host_check_exists(const char *path);
26 * Connect to the Virtio-Serial VM end-point located in path. It is
27 * thread safe for unique lcore_ids. This function must be only called once from
31 * The path to the serial device on the filesystem
38 * - Negative on error.
40 int guest_channel_host_connect(const char *path, unsigned int lcore_id);
43 * Disconnect from an already connected Virtio-Serial Endpoint.
50 void guest_channel_host_disconnect(unsigned int lcore_id);
53 * Send a message contained in pkt over the Virtio-Serial to the host endpoint.
56 * Pointer to a populated struct guest_agent_pkt
63 * - Negative on channel not connected.
64 * - errno on write to channel error.
66 int guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id);
69 * Send a message contained in pkt over the Virtio-Serial to the host endpoint.
72 * Pointer to a populated struct channel_packet
79 * - Negative on error.
81 int rte_power_guest_channel_send_msg(struct channel_packet *pkt,
82 unsigned int lcore_id);
85 * Read a message contained in pkt over the Virtio-Serial
86 * from the host endpoint.
89 * Pointer to channel_packet or
90 * channel_packet_freq_list struct.
93 * Size of expected data packet.
100 * - Negative on error.
102 int power_guest_channel_read_msg(void *pkt,
104 unsigned int lcore_id);
107 * Receive a message contained in pkt over the Virtio-Serial
108 * from the host endpoint.
111 * Pointer to channel_packet or
112 * channel_packet_freq_list struct.
115 * Size of expected data packet.
122 * - Negative on error.
126 rte_power_guest_channel_receive_msg(void *pkt,
128 unsigned int lcore_id);