Go to file
Fiona Ebner 48333b4d6a qmp helpers: device add/del: use HMP interface
Fixes device hotplug in combination with QEMU 9.2.

QEMU commit be93fd5372 ("qdev-monitor: avoid QemuOpts in QMP device_add")
notes:

> This patch changes the behavior of QMP device_add but not HMP
> device_add. QMP clients that sent incorrectly typed device_add QMP
> commands no longer work. This is a breaking change but clients should be
> using the correct types already.

The qemu_deviceadd() helper does not have the required type
information right now, so switch to using HMP, which still behaves the
same when passing a device commandline string. QEMU commit be93fd5372
fixes passing in complex properties via JSON, but the qemu_deviceadd()
helper never uses any such, as it already only received a string (and
naively split it up).

Use HMP for 'device_del' too, simply to keep the qemu_deviceadd() and
qemu_devicedel() helpers consistent.

Switching back to QMP using the correct types in the JSON can still be
done later. Unfortunately, 'qmp-query-schema' does not provide
device-specific types, so another way is needed.

A timeout of 25 seconds is used rather then relying on the low default
like before, since device plug operations require actions by the guest
kernel and might require IO. Device plug is often an interactive
operation, so a too high timeout could lead to bad UX. For now stay a
few seconds under the default timeout of 30 seconds of our web UI's
API request handler. Should specific devices need a higher timeout, it
can still be increased further for them in the future.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
 [TL: reduce timeout from 30s to 25s to ensure sync API requests
      (without a task worker) do not run into the frontend timeout]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-04 17:07:19 +01:00
debian bump version to 8.3.6 2025-01-20 14:46:45 +01:00
PVE qmp helpers: device add/del: use HMP interface 2025-02-04 17:07:19 +01:00
qemu-configs move qemu-configs to own directory 2019-09-24 18:59:35 +02:00
qmeventd fix #5714: fix calloc parameter ordering 2024-09-23 10:30:01 +02:00
query-machine-capabilities add pve prefix to query-machine-capabilities.service 2024-11-18 21:56:15 +01:00
test move kvm_user_version() function to helpers module 2025-01-17 19:24:02 +01:00
vm-network-scripts firewall: add handling for new nft firewall 2024-04-19 20:09:20 +02:00
.gitignore gitignore: sort content 2023-11-17 15:54:24 +01:00
bootsplash.jpg add seabios bootsplash and use it 2016-09-08 12:22:01 +02:00
bootsplash.xcf add seabios bootsplash and use it 2016-09-08 12:22:01 +02:00
Makefile add C program to get hardware capabilities from CPUID 2024-11-17 18:37:03 +01:00
modules-load.conf remove unnecessary init.d, postint, postrm and qmupdate scripts 2015-02-27 16:09:41 +01:00
qm convert qmrestore into a PVE::CLI class 2015-10-05 13:10:24 +02:00
qmextract remove legacy sparsecp 2017-08-23 10:03:37 +02:00
qmrestore convert qmrestore into a PVE::CLI class 2015-10-05 13:10:24 +02:00