qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

Merge remote-tracking branch 'remotes/berrange/tags/misc-fixes-pull-request' into staging

Misc fixes

* Use correct constants for 'bool' type
* Fix compatibility with noVNC in websocket impl
* Remove inaccurate docs aout default NIC model

# gpg: Signature made Fri 07 Feb 2020 12:23:53 GMT
# gpg: using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg: aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF

* remotes/berrange/tags/misc-fixes-pull-request:
docs: stop documenting the e1000 NIC model as the default
authz: fix usage of bool in listfile.c
io/channel-websock: treat 'binary' and no sub-protocol as the same

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

+32 -18
+1 -1
authz/listfile.c
··· 239 239 240 240 authz->file_watch = -1; 241 241 #ifdef CONFIG_INOTIFY1 242 - authz->refresh = TRUE; 242 + authz->refresh = true; 243 243 #endif 244 244 } 245 245
+24 -12
io/channel-websock.c
··· 49 49 "Server: QEMU VNC\r\n" \ 50 50 "Date: %s\r\n" 51 51 52 + #define QIO_CHANNEL_WEBSOCK_HANDSHAKE_WITH_PROTO_RES_OK \ 53 + "HTTP/1.1 101 Switching Protocols\r\n" \ 54 + QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_COMMON \ 55 + "Upgrade: websocket\r\n" \ 56 + "Connection: Upgrade\r\n" \ 57 + "Sec-WebSocket-Accept: %s\r\n" \ 58 + "Sec-WebSocket-Protocol: binary\r\n" \ 59 + "\r\n" 52 60 #define QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_OK \ 53 61 "HTTP/1.1 101 Switching Protocols\r\n" \ 54 62 QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_COMMON \ 55 63 "Upgrade: websocket\r\n" \ 56 64 "Connection: Upgrade\r\n" \ 57 65 "Sec-WebSocket-Accept: %s\r\n" \ 58 - "Sec-WebSocket-Protocol: binary\r\n" \ 59 66 "\r\n" 60 67 #define QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_NOT_FOUND \ 61 68 "HTTP/1.1 404 Not Found\r\n" \ ··· 336 343 337 344 static void qio_channel_websock_handshake_send_res_ok(QIOChannelWebsock *ioc, 338 345 const char *key, 346 + const bool use_protocols, 339 347 Error **errp) 340 348 { 341 349 char combined_key[QIO_CHANNEL_WEBSOCK_CLIENT_KEY_LEN + ··· 361 369 } 362 370 363 371 date = qio_channel_websock_date_str(); 364 - qio_channel_websock_handshake_send_res( 365 - ioc, QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_OK, date, accept); 372 + if (use_protocols) { 373 + qio_channel_websock_handshake_send_res( 374 + ioc, QIO_CHANNEL_WEBSOCK_HANDSHAKE_WITH_PROTO_RES_OK, 375 + date, accept); 376 + } else { 377 + qio_channel_websock_handshake_send_res( 378 + ioc, QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_OK, date, accept); 379 + } 366 380 367 381 g_free(date); 368 382 g_free(accept); ··· 387 401 388 402 protocols = qio_channel_websock_find_header( 389 403 hdrs, nhdrs, QIO_CHANNEL_WEBSOCK_HEADER_PROTOCOL); 390 - if (!protocols) { 391 - error_setg(errp, "Missing websocket protocol header data"); 392 - goto bad_request; 393 - } 394 404 395 405 version = qio_channel_websock_find_header( 396 406 hdrs, nhdrs, QIO_CHANNEL_WEBSOCK_HEADER_VERSION); ··· 430 440 trace_qio_channel_websock_http_request(ioc, protocols, version, 431 441 host, connection, upgrade, key); 432 442 433 - if (!g_strrstr(protocols, QIO_CHANNEL_WEBSOCK_PROTOCOL_BINARY)) { 434 - error_setg(errp, "No '%s' protocol is supported by client '%s'", 435 - QIO_CHANNEL_WEBSOCK_PROTOCOL_BINARY, protocols); 436 - goto bad_request; 443 + if (protocols) { 444 + if (!g_strrstr(protocols, QIO_CHANNEL_WEBSOCK_PROTOCOL_BINARY)) { 445 + error_setg(errp, "No '%s' protocol is supported by client '%s'", 446 + QIO_CHANNEL_WEBSOCK_PROTOCOL_BINARY, protocols); 447 + goto bad_request; 448 + } 437 449 } 438 450 439 451 if (!g_str_equal(version, QIO_CHANNEL_WEBSOCK_SUPPORTED_VERSION)) { ··· 467 479 goto bad_request; 468 480 } 469 481 470 - qio_channel_websock_handshake_send_res_ok(ioc, key, errp); 482 + qio_channel_websock_handshake_send_res_ok(ioc, key, !!protocols, errp); 471 483 return; 472 484 473 485 bad_request:
+7 -5
qemu-options.hx
··· 2428 2428 The hardware MAC address can be set with @option{mac=@var{macaddr}}. 2429 2429 2430 2430 The following two example do exactly the same, to show how @option{-nic} can 2431 - be used to shorten the command line length (note that the e1000 is the default 2432 - on i386, so the @option{model=e1000} parameter could even be omitted here, too): 2431 + be used to shorten the command line length: 2433 2432 @example 2434 2433 @value{qemu_system} -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32 2435 2434 @value{qemu_system} -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 ··· 2843 2842 Legacy option to configure or create an on-board (or machine default) Network 2844 2843 Interface Card(NIC) and connect it either to the emulated hub with ID 0 (i.e. 2845 2844 the default hub), or to the netdev @var{nd}. 2846 - The NIC is an e1000 by default on the PC target. Optionally, the MAC address 2847 - can be changed to @var{mac}, the device address set to @var{addr} (PCI cards 2848 - only), and a @var{name} can be assigned for use in monitor commands. 2845 + If @var{model} is omitted, then the default NIC model associated with 2846 + the machine type is used. Note that the default NIC model may change in 2847 + future QEMU releases, so it is highly recommended to always specify a model. 2848 + Optionally, the MAC address can be changed to @var{mac}, the device 2849 + address set to @var{addr} (PCI cards only), and a @var{name} can be 2850 + assigned for use in monitor commands. 2849 2851 Optionally, for PCI cards, you can specify the number @var{v} of MSI-X vectors 2850 2852 that the card should have; this option currently only affects virtio cards; set 2851 2853 @var{v} = 0 to disable MSI-X. If no @option{-net} option is specified, a single