FreeBSD bhyve keyboard layout patch
Revisão | b74a2a2e75cbc10d0bbc6ff15ad60d859ffe3d20 (tree) |
---|---|
Hora | 2021-05-03 22:32:34 |
Autor | Koine Yuusuke(koinec) <koinec@user...> |
Commiter | Koine Yuusuke(koinec) |
* Update for FreeBSD 13.0-RELASE.(Along with this, the patch filename was changed)
* Fix the following issues on the FreeBSD review site. (Addition of CS_MSG_CLIENT_QEMU constant) (https://reviews.freebsd.org/D29430)
@@ -1,6 +1,6 @@ | ||
1 | 1 | diff -uprN bhyve_orig/console.c bhyve/console.c |
2 | ---- bhyve_orig/console.c 2020-12-24 09:12:34.000000000 +0900 | |
3 | -+++ bhyve/console.c 2020-12-30 21:50:53.384428000 +0900 | |
2 | +--- bhyve_orig/console.c 2021-04-09 09:24:13.000000000 +0900 | |
3 | ++++ bhyve/console.c 2021-05-03 13:11:57.869902000 +0900 | |
4 | 4 | @@ -106,10 +106,10 @@ console_ptr_register(ptr_event_func_t event_cb, void * |
5 | 5 | } |
6 | 6 |
@@ -15,8 +15,8 @@ diff -uprN bhyve_orig/console.c bhyve/console.c | ||
15 | 15 | |
16 | 16 | void |
17 | 17 | diff -uprN bhyve_orig/console.h bhyve/console.h |
18 | ---- bhyve_orig/console.h 2020-12-24 09:12:34.000000000 +0900 | |
19 | -+++ bhyve/console.h 2020-12-30 21:50:53.385443000 +0900 | |
18 | +--- bhyve_orig/console.h 2021-04-09 09:24:13.000000000 +0900 | |
19 | ++++ bhyve/console.h 2021-05-03 13:11:57.870288000 +0900 | |
20 | 20 | @@ -34,7 +34,7 @@ |
21 | 21 | struct bhyvegc; |
22 | 22 |
@@ -36,8 +36,8 @@ diff -uprN bhyve_orig/console.h bhyve/console.h | ||
36 | 36 | void console_ptr_register(ptr_event_func_t event_cb, void *arg, int pri); |
37 | 37 | void console_ptr_event(uint8_t button, int x, int y); |
38 | 38 | diff -uprN bhyve_orig/ps2kbd.c bhyve/ps2kbd.c |
39 | ---- bhyve_orig/ps2kbd.c 2020-12-24 09:12:34.000000000 +0900 | |
40 | -+++ bhyve/ps2kbd.c 2020-12-30 21:50:53.386722000 +0900 | |
39 | +--- bhyve_orig/ps2kbd.c 2021-04-09 09:24:13.000000000 +0900 | |
40 | ++++ bhyve/ps2kbd.c 2021-05-03 13:11:57.870908000 +0900 | |
41 | 41 | @@ -181,6 +181,26 @@ static const uint8_t ascii_translations[128] = { |
42 | 42 | 0x22, 0x35, 0x1a, 0x54, 0x5d, 0x5b, 0x0e, 0x00, |
43 | 43 | }; |
@@ -129,9 +129,17 @@ diff -uprN bhyve_orig/ps2kbd.c bhyve/ps2kbd.c | ||
129 | 129 | |
130 | 130 | if (!fifo_full) |
131 | 131 | diff -uprN bhyve_orig/rfb.c bhyve/rfb.c |
132 | ---- bhyve_orig/rfb.c 2020-12-24 09:12:34.000000000 +0900 | |
133 | -+++ bhyve/rfb.c 2020-12-31 10:39:54.009578000 +0900 | |
134 | -@@ -118,7 +118,10 @@ struct rfb_softc { | |
132 | +--- bhyve_orig/rfb.c 2021-04-09 09:24:13.000000000 +0900 | |
133 | ++++ bhyve/rfb.c 2021-05-03 13:13:08.713857000 +0900 | |
134 | +@@ -98,6 +98,7 @@ static int rfb_debug = 0; | |
135 | + #define CS_KEY_EVENT 4 | |
136 | + #define CS_POINTER_EVENT 5 | |
137 | + #define CS_CUT_TEXT 6 | |
138 | ++#define CS_MSG_CLIENT_QEMU 255 | |
139 | + | |
140 | + #define SECURITY_TYPE_NONE 1 | |
141 | + #define SECURITY_TYPE_VNC_AUTH 2 | |
142 | +@@ -118,7 +119,10 @@ struct rfb_softc { | |
135 | 143 | bool enc_raw_ok; |
136 | 144 | bool enc_zlib_ok; |
137 | 145 | bool enc_resize_ok; |
@@ -142,7 +150,7 @@ diff -uprN bhyve_orig/rfb.c bhyve/rfb.c | ||
142 | 150 | z_stream zstream; |
143 | 151 | uint8_t *zbuf; |
144 | 152 | int zbuflen; |
145 | -@@ -170,7 +173,10 @@ struct rfb_pixfmt_msg { | |
153 | +@@ -170,7 +174,10 @@ struct rfb_pixfmt_msg { | |
146 | 154 | #define RFB_ENCODING_RAW 0 |
147 | 155 | #define RFB_ENCODING_ZLIB 6 |
148 | 156 | #define RFB_ENCODING_RESIZE -223 |
@@ -153,7 +161,7 @@ diff -uprN bhyve_orig/rfb.c bhyve/rfb.c | ||
153 | 161 | #define RFB_MAX_WIDTH 2000 |
154 | 162 | #define RFB_MAX_HEIGHT 1200 |
155 | 163 | #define RFB_ZLIB_BUFSZ RFB_MAX_WIDTH*RFB_MAX_HEIGHT*4 |
156 | -@@ -197,6 +203,19 @@ struct rfb_key_msg { | |
164 | +@@ -197,6 +204,19 @@ struct rfb_key_msg { | |
157 | 165 | uint8_t type; |
158 | 166 | uint8_t down; |
159 | 167 | uint16_t pad; |
@@ -173,7 +181,7 @@ diff -uprN bhyve_orig/rfb.c bhyve/rfb.c | ||
173 | 181 | uint32_t code; |
174 | 182 | }; |
175 | 183 | |
176 | -@@ -277,6 +296,27 @@ rfb_send_resize_update_msg(struct rfb_softc *rc, int c | |
184 | +@@ -277,6 +297,27 @@ rfb_send_resize_update_msg(struct rfb_softc *rc, int c | |
177 | 185 | } |
178 | 186 | |
179 | 187 | static void |
@@ -201,7 +209,7 @@ diff -uprN bhyve_orig/rfb.c bhyve/rfb.c | ||
201 | 209 | rfb_recv_set_pixfmt_msg(struct rfb_softc *rc, int cfd) |
202 | 210 | { |
203 | 211 | struct rfb_pixfmt_msg pixfmt_msg; |
204 | -@@ -309,6 +349,9 @@ rfb_recv_set_encodings_msg(struct rfb_softc *rc, int c | |
212 | +@@ -309,6 +350,9 @@ rfb_recv_set_encodings_msg(struct rfb_softc *rc, int c | |
205 | 213 | case RFB_ENCODING_RESIZE: |
206 | 214 | rc->enc_resize_ok = true; |
207 | 215 | break; |
@@ -211,7 +219,7 @@ diff -uprN bhyve_orig/rfb.c bhyve/rfb.c | ||
211 | 219 | } |
212 | 220 | } |
213 | 221 | } |
214 | -@@ -686,6 +729,11 @@ rfb_recv_update_msg(struct rfb_softc *rc, int cfd) | |
222 | +@@ -686,6 +730,11 @@ rfb_recv_update_msg(struct rfb_softc *rc, int cfd) | |
215 | 223 | |
216 | 224 | (void)stream_read(cfd, ((void *)&updt_msg) + 1 , sizeof(updt_msg) - 1); |
217 | 225 |
@@ -223,7 +231,7 @@ diff -uprN bhyve_orig/rfb.c bhyve/rfb.c | ||
223 | 231 | rc->pending = true; |
224 | 232 | if (!updt_msg.incremental) |
225 | 233 | rc->update_all = true; |
226 | -@@ -698,11 +746,26 @@ rfb_recv_key_msg(struct rfb_softc *rc, int cfd) | |
234 | +@@ -698,11 +747,26 @@ rfb_recv_key_msg(struct rfb_softc *rc, int cfd) | |
227 | 235 | |
228 | 236 | (void)stream_read(cfd, ((void *)&key_msg) + 1, sizeof(key_msg) - 1); |
229 | 237 |
@@ -251,17 +259,17 @@ diff -uprN bhyve_orig/rfb.c bhyve/rfb.c | ||
251 | 259 | rfb_recv_ptr_msg(struct rfb_softc *rc, int cfd) |
252 | 260 | { |
253 | 261 | struct rfb_ptr_msg ptr_msg; |
254 | -@@ -997,6 +1060,9 @@ report_and_done: | |
262 | +@@ -997,6 +1061,9 @@ report_and_done: | |
255 | 263 | case CS_CUT_TEXT: |
256 | 264 | rfb_recv_cuttext_msg(rc, cfd); |
257 | 265 | break; |
258 | -+ case 255: | |
266 | ++ case CS_MSG_CLIENT_QEMU: | |
259 | 267 | + rfb_recv_client_msg(rc, cfd); |
260 | 268 | + break; |
261 | 269 | default: |
262 | 270 | WPRINTF(("rfb unknown cli-code %d!", buf[0] & 0xff)); |
263 | 271 | goto done; |
264 | -@@ -1031,6 +1097,9 @@ rfb_thr(void *arg) | |
272 | +@@ -1031,6 +1098,9 @@ rfb_thr(void *arg) | |
265 | 273 | rc->enc_raw_ok = false; |
266 | 274 | rc->enc_zlib_ok = false; |
267 | 275 | rc->enc_resize_ok = false; |