Modify the domain structure to to make console specific fields as an array indexed by the console type. Two console types are defined - PV and VCON.
Signed-off-by: Bhupinder Thakur <bhupinder.tha...@linaro.org> --- tools/console/daemon/io.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 7e6a886..0cd1fee 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -61,6 +61,10 @@ /* Duration of each time period in ms */ #define RATE_LIMIT_PERIOD 200 +#define MAX_CONSOLE 2 +#define CONSOLE_TYPE_PV 0 +#define CONSOLE_TYPE_VCON 1 + extern int log_reload; extern int log_guest; extern int log_hv; @@ -91,23 +95,25 @@ struct buffer { struct domain { int domid; - int master_fd; - int master_pollfd_idx; - int slave_fd; - int log_fd; + int master_fd[MAX_CONSOLE]; + int master_pollfd_idx[MAX_CONSOLE]; + int slave_fd[MAX_CONSOLE]; + int log_fd[MAX_CONSOLE]; bool is_dead; unsigned last_seen; - struct buffer buffer; + struct buffer buffer[MAX_CONSOLE]; struct domain *next; char *conspath; - int ring_ref; - xenevtchn_port_or_error_t local_port; - xenevtchn_port_or_error_t remote_port; + int ring_ref[MAX_CONSOLE]; + xenevtchn_port_or_error_t local_port[MAX_CONSOLE]; + xenevtchn_port_or_error_t remote_port[MAX_CONSOLE]; xenevtchn_handle *xce_handle; int xce_pollfd_idx; - struct xencons_interface *interface; + struct xencons_interface *interface[MAX_CONSOLE]; int event_count; long long next_period; + int console_data_pending; + bool vcon_enabled; }; static struct domain *dom_head; -- 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel