[pve-devel] [PATCH many] add cluster-wide hardware device mapping

Dominik Csapak d.csapak at proxmox.com
Tue Jul 19 15:26:46 CEST 2022


just a quick note, aaron noticed some small things immediately,

root at pam did not see the hardware panel:

access control needs this diff:

----8<----
diff --git a/src/PVE/RPCEnvironment.pm b/src/PVE/RPCEnvironment.pm
index c1b712d..b686c6b 100644
--- a/src/PVE/RPCEnvironment.pm
+++ b/src/PVE/RPCEnvironment.pm
@@ -191,7 +191,7 @@ sub compute_api_permission {
      };
      map { $res->{$_} = {} } keys %$priv_re_map;

-    my $required_paths = ['/', '/nodes', '/access/groups', '/vms', '/storage', '/sdn'];
+    my $required_paths = ['/', '/nodes', '/access/groups', '/vms', '/storage', '/sdn', '/hardware'];

      my $checked_paths = {};
      foreach my $path (@$required_paths, keys %{$usercfg->{acl}}) {
---->8----

and qemu-server does not build without root without this:

----8<----
diff --git a/test/MigrationTest/Shared.pm b/test/MigrationTest/Shared.pm
index 8ae6a6e..bcbd769 100644
--- a/test/MigrationTest/Shared.pm
+++ b/test/MigrationTest/Shared.pm
@@ -69,6 +69,16 @@ $cluster_module->mock(
      },
  );

+our $hardware_map_module = Test::MockModule->new("PVE::HardwareMap");
+$hardware_map_module->mock(
+    find_device_on_current_node => sub {
+       return {};
+    },
+    config => sub {
+       return {};
+    },
+);
+
  our $ha_config_module = Test::MockModule->new("PVE::HA::Config");
  $ha_config_module->mock(
      vm_is_ha_managed => sub {
---->8-----

i'll send a v2 when i get some more feedback
(i'll also include some tests then)




More information about the pve-devel mailing list