ui: dbus-display fix, new gtk config options.

usb: xhci fix, doc updates.
 microvm: no pcie io reservations.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmLWy+IACgkQTLbY7tPo
 cTif4w//fkEiSYavbqYccVdZjomZWPPjKiSJmxvY6KSYeB5V7oHXPLQJmjAzG8d5
 6FipgLcmxSCJ9dzsfeP678Kd3/7toct8faYcjkktLGzlc/U7/goo94bkorAl4Var
 dMGeo0WK+kdR06E5A2R+MVNdigdUoRiI0udCCvDW/o2mce/jB5eQbZVi6tX2yaxx
 I9q6uAmltRU+tIg3qA6KBkZinKdJ3ElikZq5B4n2w78Zfu9exScUuQVws71bFiJe
 z1CzCGzAnzMxA9sdgO0Tne9ibrpRS6F2NFK68dZUEzs7iDCtuPL044zNZnmxPQXB
 +OC4btkKY13YiNgf/Y4aqDp/3No0dRNxyNTHthdRswBGvGuWuPJYb5/w7rnLu/qy
 0+ZTZn3VRy8elbC+vs5ZkED7wm5vhfu1PlEx0zGaQCe5VYv9aEAUU5+I6lrDnj5K
 aV/2EId0tP2Bg2342tOq5OZ2jkZJyaU/RDNjF5AAIuMeZ84B3VPDHRKv2mtAdxjq
 AtNPT26yiiQNY+TCICwFCW5Faxd4t0H9q0Z701dFN6oCA1ysvnDSaaLYGo+tO8cn
 q4jlY9jgO8xQy2n80wcrcMXFMNc7Uv3J4ZuHIRdgnnRvokZ/vVSVFl4g5nGZbab2
 KSVNdu76XexW7lluJJQrHtrjpuup2825/NiFuAMygYMonwnl2/E=
 =EiWf
 -----END PGP SIGNATURE-----

Merge tag 'kraxel-20220719-pull-request' of https://gitlab.com/kraxel/qemu into staging

ui: dbus-display fix, new gtk config options.
usb: xhci fix, doc updates.
microvm: no pcie io reservations.

# gpg: Signature made Tue 19 Jul 2022 16:21:06 BST
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* tag 'kraxel-20220719-pull-request' of https://gitlab.com/kraxel/qemu:
  gtk: Add show_tabs=on|off command line option.
  usb: document pcap (aka usb traffic capture)
  usb: document guest-reset and guest-reset-all
  usb/hcd-xhci: check slotid in xhci_wakeup_endpoint()
  microvm: turn off io reservations for pcie root ports
  dbus-display: fix test race when initializing p2p connection

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
master
Peter Maydell 2022-07-19 17:40:36 +01:00
commit d48125de38
7 changed files with 72 additions and 4 deletions

View File

@ -353,3 +353,44 @@ and also assign it to the correct USB bus in QEMU like this:
-device usb-ehci,id=ehci \\
-device usb-host,bus=usb-bus.0,hostbus=3,hostport=1 \\
-device usb-host,bus=ehci.0,hostbus=1,hostport=1
``usb-host`` properties for reset behavior
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``guest-reset`` and ``guest-reset-all`` properties control
whenever the guest is allowed to reset the physical usb device on the
host. There are three cases:
``guest-reset=false``
The guest is not allowed to reset the (physical) usb device.
``guest-reset=true,guest-resets-all=false``
The guest is allowed to reset the device when it is not yet
initialized (aka no usb bus address assigned). Usually this results
in one guest reset being allowed. This is the default behavior.
``guest-reset=true,guest-resets-all=true``
The guest is allowed to reset the device as it pleases.
The reason for this existing are broken usb devices. In theory one
should be able to reset (and re-initialize) usb devices at any time.
In practice that may result in shitty usb device firmware crashing and
the device not responding any more until you power-cycle (aka un-plug
and re-plug) it.
What works best pretty much depends on the behavior of the specific
usb device at hand, so it's a trial-and-error game. If the default
doesn't work, try another option and see whenever the situation
improves.
record usb transfers
^^^^^^^^^^^^^^^^^^^^
All usb devices have support for recording the usb traffic. This can
be enabled using the ``pcap=<file>`` property, for example:
``-device usb-mouse,pcap=mouse.pcap``
The pcap files are compatible with the linux kernels usbmon. Many
tools, including ``wireshark``, can decode and inspect these trace
files.

View File

@ -631,6 +631,14 @@ static void microvm_machine_initfn(Object *obj)
qemu_register_powerdown_notifier(&mms->powerdown_req);
}
GlobalProperty microvm_properties[] = {
/*
* pcie host bridge (gpex) on microvm has no io address window,
* so reserving io space is not going to work. Turn it off.
*/
{ "pcie-root-port", "io-reserve", "0" },
};
static void microvm_class_init(ObjectClass *oc, void *data)
{
X86MachineClass *x86mc = X86_MACHINE_CLASS(oc);
@ -707,6 +715,9 @@ static void microvm_class_init(ObjectClass *oc, void *data)
"Set off to disable adding virtio-mmio devices to the kernel cmdline");
machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE);
compat_props_add(mc->compat_props, microvm_properties,
G_N_ELEMENTS(microvm_properties));
}
static const TypeInfo microvm_machine_info = {

View File

@ -3269,7 +3269,8 @@ static void xhci_wakeup_endpoint(USBBus *bus, USBEndpoint *ep,
DPRINTF("%s\n", __func__);
slotid = ep->dev->addr;
if (slotid == 0 || !xhci->slots[slotid-1].enabled) {
if (slotid == 0 || slotid > xhci->numslots ||
!xhci->slots[slotid - 1].enabled) {
DPRINTF("%s: oops, no slot for dev %d\n", __func__, ep->dev->addr);
return;
}

View File

@ -1195,12 +1195,17 @@
# assuming the guest will resize the display to match
# the window size then. Otherwise it defaults to "off".
# Since 3.1
# @show-tabs: Display the tab bar for switching between the various graphical
# interfaces (e.g. VGA and virtual console character devices)
# by default.
# Since 7.1
#
# Since: 2.12
##
{ 'struct' : 'DisplayGTK',
'data' : { '*grab-on-hover' : 'bool',
'*zoom-to-fit' : 'bool' } }
'*zoom-to-fit' : 'bool',
'*show-tabs' : 'bool' } }
##
# @DisplayEGLHeadless:

View File

@ -1938,7 +1938,7 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
#endif
#if defined(CONFIG_GTK)
"-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n"
" [,show-cursor=on|off][,window-close=on|off]\n"
" [,show-tabs=on|off][,show-cursor=on|off][,window-close=on|off]\n"
#endif
#if defined(CONFIG_VNC)
"-display vnc=<display>[,<optargs>]\n"
@ -2023,6 +2023,10 @@ SRST
``grab-on-hover=on|off`` : Grab keyboard input on mouse hover
``show-tabs=on|off`` : Display the tab bar for switching between the
various graphical interfaces (e.g. VGA and
virtual console character devices) by default.
``show-cursor=on|off`` : Force showing the mouse cursor
``window-close=on|off`` : Allow to quit qemu with window close button

View File

@ -268,6 +268,7 @@ dbus_display_add_client_ready(GObject *source_object,
}
g_dbus_object_manager_server_set_connection(dbus_display->server, conn);
g_dbus_connection_start_message_processing(conn);
}
@ -300,7 +301,8 @@ dbus_display_add_client(int csock, Error **errp)
g_dbus_connection_new(G_IO_STREAM(conn),
guid,
G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER,
G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER |
G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING,
NULL,
dbus_display->add_client_cancellable,
dbus_display_add_client_ready,

View File

@ -2390,6 +2390,10 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
opts->u.gtk.grab_on_hover) {
gtk_menu_item_activate(GTK_MENU_ITEM(s->grab_on_hover_item));
}
if (opts->u.gtk.has_show_tabs &&
opts->u.gtk.show_tabs) {
gtk_menu_item_activate(GTK_MENU_ITEM(s->show_tabs_item));
}
gd_clipboard_init(s);
}