1vios-proxy-host(1) vios-proxy-host vios-proxy-host(1)
2
3
4
6 vios-proxy-host is the QEMU-host process of a network proxy between a
7 QEMU host and QEMU guests.
8
10 vios-proxy-host [-h | --help] [guest_directory [service_port
11 [log_level]]]
12
14 In a QEMU system, processes in the host need to communicate with
15 processes in guests even when there is no network configured between
16 the host and the guests. Vios-proxy is a network proxy framework that
17 uses virtioserial channels as the communications pipeline between the
18 host and the guests.
19
20 Virtioserial overview
21 Virtioserial comprises host device emulation, virtio-pci devices,
22 and drivers that provide a chardev interface between the QEMU host
23 and a QEMU guest. A single virtioserial channel appears to
24 application software as a domain socket path name in the QEMU host
25 and a file handle path name in the QEMU guest.
26
27 Learn more about virtioserial at
28 <http://fedoraproject.org/wiki/Features/VirtioSerial>
29
30 vios-proxy-host is a process that runs on the QEMU host. It opens a
31 series of virtioserial channels and listens for connection requests
32 from the peer vios-proxy-guest processes in the QEMU guests. During
33 connection negotiation with a guest, vios-proxy-host opens a network
34 socket to the service in the QEMU host and relays data between the
35 service socket on the host to the virtioserial channel going to the
36 guest.
37
38 vios-proxy-host is configured with a guest_directory path name and a
39 service_port port number.
40
41 · The guest_directory path name identifies a directory that holds
42 subdirectories where each subdirectory holds virtioserial end
43 points for a given virtual guest.
44
45 · Note that having the guest endpoints in separate directories is
46 only a convenience for system management. Separate directories
47 make the system easier to specify, examine, maintain, and
48 diagnose. There is no functional requirement for virtioserial
49 guest endpoints to be in separate subdirectories.
50
51 · The service_port port number is the localhost port for the host
52 service that is being proxied to the guests.
53
54 Only one instance of vios-proxy-host is required per proxied network
55 service. This instance will proxy any number of virtioserial channels
56 to any number of QEMU guests as long as the guest virtioserial channel
57 end points are configured to be in the guest_directory tree.
58
59 System administrators may run multiple instances of vios-proxy-host,
60 each configured to provide proxy service for different host services.
61
62 vios-proxy-host assumes exclusive ownership of all virtioserial
63 channels in the guest_directory path. If multiple instances of vios-
64 proxy-host are run then they must not share guest_directory path names.
65
66 A sysetm administrator may run several instances of vios-proxy-host to
67 proxy the same network service service_port as long as each instance
68 has a different guest_directory path.
69
70 Virtioserial connections are typically created synchronously with the
71 creation of the QEMU guest VM. vios-proxy-host does not create
72 virtioserial connections. If virtioserial connections are created or
73 destroyed dynamically by some other QEMU agent then vios-proxy-host
74 will recognize the action and use or stop using the channels
75 accordingly.
76
78 -h | --help
79 display a short help text
80
81 [ guest_directory
82 find guest subdirectories in guest_directory instead of /tmp/qpid
83
84 [ service_port
85 proxy given service_port instead of 5672
86
87 [ log_level ] ] ]
88 enable logging for given level instead of INFO. Log level choices
89 are FATAL, ALERT, ERROR, WARN, NOTICE, INFO, and DEBUG
90
92 0 Success
93 1 Failure
94
96 Error accessing guest path
97 FATAL - The command line guest_directory is not accessable.
98
99 Guest path is not a directory
100 FATAL - The command line guest_directory is not a directory.
101
102 Guest path open error
103 FATAL - The command line guest_directory can not be opened.
104
105 poll()
106 FATAL - Poller error.
107
108 Error accessing guest root path
109 WARNING - A subdirectory of the command line guest_directory is not
110 accessible. This directory will not be processed.
111
112 Guest root path is not a directory
113 WARNING - A subdirectory of the command line guest_directory is not
114 a directory. This directory will not be processed.
115
116 Guest root path open error
117 WARNING - A subdirectory of the command line guest_directory can
118 not be opened. This directory will not be processed.
119
121 Configuring QEMU Host and Guest with Virtioserial Ports
122 This script launches two guest VMs. Each guest VM has three
123 virtiserial ports.
124 #!/bin/sh
125 #
126 # Define a common root directory for broker-side channels to guests.
127 #
128 QB_ROOT="/tmp/qpid"
129 #
130 # Launch some number of guests in a loop.
131 # On the host the channels to the first guest shall be
132 # /tmp/qpid/guest1/0
133 # /tmp/qpid/guest1/1
134 # /tmp/qpid/guest1/2
135 # Successive guests increment guest1 to guest2, guest3, and so on.
136 #
137 # On the guest the channels to the host shall be
138 # /dev/virtio-ports/qpid.0
139 # /dev/virtio-ports/qpid.1
140 # /dev/virtio-ports/qpid.2
141 # The guest-to-host channel names are the same for all guests.
142 #
143 #
144 for gNameSeq in `seq 1 2`
145 do
146 G_NAME="guest"$gNameSeq
147 mkdir -p ${QB_ROOT}/${G_NAME}
148 qemu-kvm -name "${G_NAME}" -m 192M -smp 2 -snapshot ~chug/v/images/v14a.img \
149 -device virtio-serial \
150 -chardev socket,path=${QB_ROOT}/${G_NAME}/0,server,nowait,id=${G_NAME}_0 \
151 -chardev socket,path=${QB_ROOT}/${G_NAME}/1,server,nowait,id=${G_NAME}_1 \
152 -chardev socket,path=${QB_ROOT}/${G_NAME}/2,server,nowait,id=${G_NAME}_2 \
153 -device virtserialport,chardev=${G_NAME}_0,name=qpid.0 \
154 -device virtserialport,chardev=${G_NAME}_1,name=qpid.1 \
155 -device virtserialport,chardev=${G_NAME}_2,name=qpid.2 \
156 &
157 PID=$!
158 echo "QEMU ${G_NAME} PID = $PID"
159 done
160
161 Launching vios-proxy-host
162 Specifying a directory and port
163 vios-proxy-host /var/vios/red-service-root 6677
164
165 Specifying a directory, a port, and a log level
166 vios-proxy-host /var/vios/green-service-root 7766 ALERT
167
170 Each virtioserial channel carries only one proxy connection.
171 Data traffic between the QEMU host and QEMU guest across a
172 virtioserial channel is limited to one connection at a time. The
173 number of configured virtioserial channels between the QEMU host
174 and each QEMU guest is the maximum number of simultaneous
175 connections the QEMU guest may have to the proxied service.
176
179 vios-proxy-guest
180
182 Chuck Rolke <crolke@redhat.com>.
183
185 Copyright 2011 by Chuck Rolke <crolke@redhat.com>.
186
187 Licensed to the Apache Software Foundation (ASF) under one
188 or more contributor license agreements. See the NOTICE file
189 distributed with this work for additional information
190 regarding copyright ownership. The ASF licenses this file
191 to you under the Apache License, Version 2.0 (the
192 "License"); you may not use this file except in compliance
193 with the License. You may obtain a copy of the License at
194
195 http://www.apache.org/licenses/LICENSE-2.0
196
197 Unless required by applicable law or agreed to in writing,
198 software distributed under the License is distributed on an
199 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
200 KIND, either express or implied. See the License for the
201 specific language governing permissions and limitations
202 under the License.
203
204
205
206perl v5.12.4 0.1 vios-proxy-host(1)