From 2db25314eaad3ff817840b27c9cfb34411d09f2e Mon Sep 17 00:00:00 2001 From: catborise Date: Wed, 11 Nov 2026 16:22:42 +0300 Subject: [PATCH] fix(instances): USB device changes as PCI ones; device refusals name no VM to owners - A USB device added to or removed from a VM with a saved state applied only at the next cold boot: refused now, as for PCI devices, and the form says so. - A USB hot plug or removal that failed half way said only libvirt's error: it now says where the device is, as for PCI devices (_hostdev_outcome, shared). - A host device refusal (check_hostdevs) names the other VMs that have the device; users who do not see the hosts, such as an owner whose snapshot revert is refused, now read that a device is not free and that an administrator can see why. - The host's USB devices named among a PCI device's host resources were English in every language. --- .../instances/host_devices_form.html | 5 +- instances/views.py | 6 +- locale/tr/LC_MESSAGES/django.mo | Bin 200413 -> 200759 bytes locale/tr/LC_MESSAGES/django.po | 540 +++++++++--------- locale/zh/LC_MESSAGES/django.mo | Bin 187514 -> 187840 bytes locale/zh/LC_MESSAGES/django.po | 524 ++++++++--------- operations/tests/test_public_error.py | 9 + operations/utils.py | 8 +- vrtManager/instance.py | 66 ++- vrtManager/nodedevs.py | 27 +- vrtManager/tests/test_host_devices.py | 31 + vrtManager/tests/test_nodedevs.py | 9 + 12 files changed, 662 insertions(+), 563 deletions(-) diff --git a/instances/templates/instances/host_devices_form.html b/instances/templates/instances/host_devices_form.html index 6d7bfb4d..adcb255d 100644 --- a/instances/templates/instances/host_devices_form.html +++ b/instances/templates/instances/host_devices_form.html @@ -8,13 +8,14 @@
{% blocktrans with problems=unmatched|join:"; " %}The VM does not start until this is fixed: {{ problems }}. Remove the device and add the one the host has.{% endblocktrans %}
{% endif %}
{% csrf_token %} - {% for device in host_usb %} {% endfor %} - + + {% if usb_frozen %}
{% trans "A VM with a saved state does not change its USB devices: start it, or start it without its saved state" %}
{% endif %}
{% csrf_token %}