mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +00:00
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.
This commit is contained in:
parent
d07362106a
commit
2db25314ea
12 changed files with 662 additions and 563 deletions
|
|
@ -12,3 +12,12 @@ class PublicErrorTests(SimpleTestCase):
|
|||
self.assertEqual(public_error_text(PermissionDenied()), "You may no longer do this.")
|
||||
self.assertEqual(public_error_text(Http404("No Instance matches the given query.")),
|
||||
"The virtual machine is no longer in the panel.")
|
||||
|
||||
def test_a_host_device_refusal_names_no_other_vm(self):
|
||||
from vrtManager.nodedevs import HostDevicesRefused
|
||||
from vrtManager.util import message
|
||||
|
||||
refused = HostDevicesRefused("%(problems)s", problems=[message("%(device)s is given to %(vms)s",
|
||||
device="PCI device 0000:00:0a.0", vms="private-db-1")])
|
||||
self.assertNotIn("private-db-1", public_error_text(refused))
|
||||
self.assertIn("Host devices tab", public_error_text(refused))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue