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 <rte_power_guest_channel.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 * Read a message contained in pkt over the Virtio-Serial
70 * from the host endpoint.
73 * Pointer to channel_packet or
74 * channel_packet_freq_list struct.
77 * Size of expected data packet.
84 * - Negative on error.
86 int power_guest_channel_read_msg(void *pkt,
88 unsigned int lcore_id);