public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH datacenter-manager/proxmox{,-yew-comp}/qemu-server v2 0/4] load VM-specific CPU flags from the remote
@ 2026-11-30 14:10 Arthur Bied-Charreton
  2026-11-30 14:10 ` [PATCH qemu-server v2 1/4] api: cpu flags: proxy the request to the given node Arthur Bied-Charreton
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Arthur Bied-Charreton @ 2026-11-30 14:10 UTC (permalink / raw)
  To: pdm-devel

The CPU editor in PDM offers a hardcoded list of VM-specific CPU flags
which has fallen behind qemu-server.

Since qemu-server 9.0.26 and pve-manager 9.0.12, PVE has an endpoint
listing these flags. This series adds that call to pve-api-types,
proxies it to PDM and makes the editor load the flags from the guest's
node.

If the node does not have the endpoint, the editor falls back to the
hardcoded list. Other errors are shown.

The flag descriptions now come from qemu-server and are therefore no
longer translated, except on the fallback path.

Note that currently the only symptom this fixes is the missing
nested-virt flag, if preferred we could also just add that to the
hardcoded list as a stopgap to limit churn.

Changes since v1:
- new qemu-server patch to proxy the endpoint to the given node
- PDM: require Resource.Audit on anything below the remote instead of
  on the node, which matches PVE's user => 'all' while not allowing
  users to probe remotes they have no access to
- UI: pass the guest's arch if set, reload when it changes
- UI: return an empty fallback list for non-x86 guests
- UI: retry fetching the flags without arch if the request returns 400
  to handle pre-arch nodes
- UI: show a loading mask and a text for an empty list
- UI: only fall back on 501, show 404 (e.g. removed remote) as an error

Build dependencies:
- proxmox-datacenter-manager requires bumped pve-api-types
- proxmox-yew-comp requires bumped pve-api-types


qemu-server:

Arthur Bied-Charreton (1):
  api: cpu flags: proxy the request to the given node

 src/PVE/API2/Qemu/CPUFlags.pm | 1 +
 1 file changed, 1 insertion(+)


proxmox:

Arthur Bied-Charreton (1):
  pve-api-types: add VM-specific CPU flags endpoint

 pve-api-types/generate.pl            |   1 +
 pve-api-types/src/generated/code.rs  |  30 +++++-
 pve-api-types/src/generated/types.rs | 140 ++++++++++++++++++++-------
 3 files changed, 133 insertions(+), 38 deletions(-)


datacenter-manager:

Arthur Bied-Charreton (1):
  api: pve: add VM-specific CPU flags endpoint

 server/src/api/pve/node.rs | 64 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 61 insertions(+), 3 deletions(-)


proxmox-yew-comp:

Arthur Bied-Charreton (1):
  qemu: cpu flags: load the CPU flags from the node

 .../pve/qemu_hardware_panel/mobile.rs         |   6 +-
 src/form/pve/qemu_cpu_flags_list.rs           | 192 ++++++++++++++----
 .../qemu_property/qemu_processor_property.rs  |  26 ++-
 3 files changed, 182 insertions(+), 42 deletions(-)


Summary over all repositories:
  8 files changed, 377 insertions(+), 83 deletions(-)

-- 
Generated by murpp 0.12.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH qemu-server v2 1/4] api: cpu flags: proxy the request to the given node
  2026-11-30 14:10 [PATCH datacenter-manager/proxmox{,-yew-comp}/qemu-server v2 0/4] load VM-specific CPU flags from the remote Arthur Bied-Charreton
@ 2026-11-30 14:10 ` Arthur Bied-Charreton
  2026-11-30 14:10 ` [PATCH proxmox v2 2/4] pve-api-types: add VM-specific CPU flags endpoint Arthur Bied-Charreton
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Arthur Bied-Charreton @ 2026-11-30 14:10 UTC (permalink / raw)
  To: pdm-devel

The endpoint did not use its node parameter and just answered with the
flags known to the node that happened to receive the request. In a
mixed-version cluster, that list can contain flags `node` does not
support or miss flags it does support.

Proxy the request to the given node, like the machine types endpoint.

Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
---
 src/PVE/API2/Qemu/CPUFlags.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/API2/Qemu/CPUFlags.pm b/src/PVE/API2/Qemu/CPUFlags.pm
index b81cbfaf..a3767554 100644
--- a/src/PVE/API2/Qemu/CPUFlags.pm
+++ b/src/PVE/API2/Qemu/CPUFlags.pm
@@ -16,6 +16,7 @@ __PACKAGE__->register_method({
     name => 'index',
     path => '',
     method => 'GET',
+    proxyto => 'node',
     description =>
         "List of available VM-specific CPU flags. Returns an empty list for 'aarch64' "
         . "as no VM-specific flags are defined for it yet.",
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH proxmox v2 2/4] pve-api-types: add VM-specific CPU flags endpoint
  2026-11-30 14:10 [PATCH datacenter-manager/proxmox{,-yew-comp}/qemu-server v2 0/4] load VM-specific CPU flags from the remote Arthur Bied-Charreton
  2026-11-30 14:10 ` [PATCH qemu-server v2 1/4] api: cpu flags: proxy the request to the given node Arthur Bied-Charreton
@ 2026-11-30 14:10 ` Arthur Bied-Charreton
  2026-11-30 14:10 ` [PATCH datacenter-manager v2 3/4] api: pve: " Arthur Bied-Charreton
  2026-11-30 14:10 ` [PATCH proxmox-yew-comp v2 4/4] qemu: cpu flags: load the CPU flags from the node Arthur Bied-Charreton
  3 siblings, 0 replies; 5+ messages in thread
From: Arthur Bied-Charreton @ 2026-11-30 14:10 UTC (permalink / raw)
  To: pdm-devel

PDM hardcodes VM-specific flags in the CPU editor, so the list fell
behind qemu-server (e.g. it does not offer nested-virt). Add declaration
for /nodes/{node}/capabilities/qemu/cpu-flags to allow PDM to offer the
up-to-date list.

Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
---
 pve-api-types/generate.pl            |   1 +
 pve-api-types/src/generated/code.rs  |  30 +++++-
 pve-api-types/src/generated/types.rs | 140 ++++++++++++++++++++-------
 3 files changed, 133 insertions(+), 38 deletions(-)

diff --git a/pve-api-types/generate.pl b/pve-api-types/generate.pl
index c9cdb272..7b31ec5e 100755
--- a/pve-api-types/generate.pl
+++ b/pve-api-types/generate.pl
@@ -489,6 +489,7 @@ Schema2Rust::derive('BulkShutdownGuests' => 'Default');
 Schema2Rust::derive('BulkSuspendGuests' => 'Default');
 
 api(GET => '/nodes/{node}/capabilities/qemu/cpu', 'qemu_cpu_capabilities', 'output-type' => 'Vec<QemuCpuModel>');
+api(GET => '/nodes/{node}/capabilities/qemu/cpu-flags', 'qemu_cpu_flags', 'return-name' => 'QemuCpuFlag');
 
 
 Schema2Rust::register_api_override('ClusterMetrics', '/properties/data/items', { type => "ClusterMetricsData"});
diff --git a/pve-api-types/src/generated/code.rs b/pve-api-types/src/generated/code.rs
index 22eba954..ab874777 100644
--- a/pve-api-types/src/generated/code.rs
+++ b/pve-api-types/src/generated/code.rs
@@ -138,7 +138,6 @@
 /// - /nodes/{node}/apt
 /// - /nodes/{node}/capabilities
 /// - /nodes/{node}/capabilities/qemu
-/// - /nodes/{node}/capabilities/qemu/cpu-flags
 /// - /nodes/{node}/capabilities/qemu/machines
 /// - /nodes/{node}/capabilities/qemu/migration
 /// - /nodes/{node}/ceph
@@ -1467,6 +1466,17 @@ pub trait PveClient {
         Err(Error::Other("qemu_cpu_capabilities not implemented"))
     }
 
+    /// List of available VM-specific CPU flags. Returns an empty list for
+    /// 'aarch64' as no VM-specific flags are defined for it yet.
+    async fn qemu_cpu_flags(
+        &self,
+        node: &str,
+        accel: Option<QemuCpuFlagsAccel>,
+        arch: Option<ClusterResourceHostArch>,
+    ) -> Result<Vec<QemuCpuFlag>, Error> {
+        Err(Error::Other("qemu_cpu_flags not implemented"))
+    }
+
     /// List aliases
     async fn qemu_firewall_aliases(
         &self,
@@ -4073,6 +4083,24 @@ where
         Ok(self.0.get(url).await?.expect_json()?.data)
     }
 
+    /// List of available VM-specific CPU flags. Returns an empty list for
+    /// 'aarch64' as no VM-specific flags are defined for it yet.
+    async fn qemu_cpu_flags(
+        &self,
+        node: &str,
+        accel: Option<QemuCpuFlagsAccel>,
+        arch: Option<ClusterResourceHostArch>,
+    ) -> Result<Vec<QemuCpuFlag>, Error> {
+        let url = &ApiPathBuilder::new(format!(
+            "/api2/extjs/nodes/{}/capabilities/qemu/cpu-flags",
+            percent_encode(node.as_bytes(), percent_encoding::NON_ALPHANUMERIC)
+        ))
+        .maybe_arg("accel", &accel)
+        .maybe_arg("arch", &arch)
+        .build();
+        Ok(self.0.get(url).await?.expect_json()?.data)
+    }
+
     /// List aliases
     async fn qemu_firewall_aliases(
         &self,
diff --git a/pve-api-types/src/generated/types.rs b/pve-api-types/src/generated/types.rs
index 295be47b..5e3cfb43 100644
--- a/pve-api-types/src/generated/types.rs
+++ b/pve-api-types/src/generated/types.rs
@@ -18645,6 +18645,72 @@ pub enum QemuConfigVirtiofsCache {
 serde_plain::derive_display_from_serialize!(QemuConfigVirtiofsCache);
 serde_plain::derive_fromstr_from_deserialize!(QemuConfigVirtiofsCache);
 
+const_regex! {
+
+QEMU_CPU_FLAG_SUPPORTED_ON_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"##;
+
+}
+
+#[test]
+fn test_regex_compilation_39() {
+    use regex::Regex;
+    let _: &Regex = &QEMU_CPU_FLAG_SUPPORTED_ON_RE;
+}
+#[api(
+    properties: {
+        description: {
+            optional: true,
+            type: String,
+        },
+        name: {
+            type: String,
+        },
+        "supported-on": {
+            items: {
+                description: "The cluster node name.",
+                format: &ApiStringFormat::Pattern(&QEMU_CPU_FLAG_SUPPORTED_ON_RE),
+                type: String,
+            },
+            optional: true,
+            type: Array,
+        },
+    },
+)]
+/// Object.
+#[derive(Debug, serde::Deserialize, serde::Serialize)]
+pub struct QemuCpuFlag {
+    /// Description of the CPU flag.
+    #[serde(default, skip_serializing_if = "Option::is_none")]
+    pub description: Option<String>,
+
+    /// Name of the CPU flag.
+    pub name: String,
+
+    /// List of nodes supporting the CPU flag with the selected acceleration
+    /// type ("accel").
+    #[serde(default, skip_serializing_if = "Option::is_none")]
+    #[serde(rename = "supported-on")]
+    pub supported_on: Option<Vec<String>>,
+}
+
+#[api]
+/// Acceleration type to check node compatibility for.
+#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
+pub enum QemuCpuFlagsAccel {
+    #[serde(rename = "kvm")]
+    #[default]
+    /// kvm.
+    Kvm,
+    #[serde(rename = "tcg")]
+    /// tcg.
+    Tcg,
+    /// Unknown variants for forward compatibility.
+    #[serde(untagged)]
+    UnknownEnumValue(FixedString),
+}
+serde_plain::derive_display_from_serialize!(QemuCpuFlagsAccel);
+serde_plain::derive_fromstr_from_deserialize!(QemuCpuFlagsAccel);
+
 #[api(
     properties: {
         allowed_nodes: {
@@ -18861,7 +18927,7 @@ QEMU_MOVE_DISK_STORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##;
 }
 
 #[test]
-fn test_regex_compilation_39() {
+fn test_regex_compilation_40() {
     use regex::Regex;
     let _: &Regex = &QEMU_MOVE_DISK_STORAGE_RE;
 }
@@ -20702,7 +20768,7 @@ REMOTE_MIGRATE_LXC_TARGET_STORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9]):(?i:
 }
 
 #[test]
-fn test_regex_compilation_40() {
+fn test_regex_compilation_41() {
     use regex::Regex;
     let _: &Regex = &REMOTE_MIGRATE_LXC_TARGET_BRIDGE_RE;
     let _: &Regex = &REMOTE_MIGRATE_LXC_TARGET_STORAGE_RE;
@@ -20830,7 +20896,7 @@ REMOTE_MIGRATE_QEMU_TARGET_STORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9]):(?i
 }
 
 #[test]
-fn test_regex_compilation_41() {
+fn test_regex_compilation_42() {
     use regex::Regex;
     let _: &Regex = &REMOTE_MIGRATE_QEMU_TARGET_BRIDGE_RE;
     let _: &Regex = &REMOTE_MIGRATE_QEMU_TARGET_STORAGE_RE;
@@ -20941,7 +21007,7 @@ REPLICATION_JOB_TARGET_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"##;
 }
 
 #[test]
-fn test_regex_compilation_42() {
+fn test_regex_compilation_43() {
     use regex::Regex;
     let _: &Regex = &REPLICATION_JOB_ID_RE;
     let _: &Regex = &REPLICATION_JOB_SOURCE_RE;
@@ -21053,7 +21119,7 @@ REPLICATION_JOB_CONFIG_TARGET_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"
 }
 
 #[test]
-fn test_regex_compilation_43() {
+fn test_regex_compilation_44() {
     use regex::Regex;
     let _: &Regex = &REPLICATION_JOB_CONFIG_ID_RE;
     let _: &Regex = &REPLICATION_JOB_CONFIG_SOURCE_RE;
@@ -21195,7 +21261,7 @@ REPLICATION_JOB_STATUS_TARGET_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"
 }
 
 #[test]
-fn test_regex_compilation_44() {
+fn test_regex_compilation_45() {
     use regex::Regex;
     let _: &Regex = &REPLICATION_JOB_STATUS_ID_RE;
     let _: &Regex = &REPLICATION_JOB_STATUS_SOURCE_RE;
@@ -21412,7 +21478,7 @@ RESTORE_LXC_STORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##;
 }
 
 #[test]
-fn test_regex_compilation_45() {
+fn test_regex_compilation_46() {
     use regex::Regex;
     let _: &Regex = &RESTORE_LXC_STORAGE_RE;
 }
@@ -21504,7 +21570,7 @@ RESTORE_QEMU_STORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##;
 }
 
 #[test]
-fn test_regex_compilation_46() {
+fn test_regex_compilation_47() {
     use regex::Regex;
     let _: &Regex = &RESTORE_QEMU_STORAGE_RE;
 }
@@ -21980,7 +22046,7 @@ SDN_CONTROLLER_NODES_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"##;
 }
 
 #[test]
-fn test_regex_compilation_47() {
+fn test_regex_compilation_48() {
     use regex::Regex;
     let _: &Regex = &SDN_CONTROLLER_ISIS_IFACES_RE;
     let _: &Regex = &SDN_CONTROLLER_ISIS_NET_RE;
@@ -22183,7 +22249,7 @@ SDN_CONTROLLER_PENDING_NODES_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"#
 }
 
 #[test]
-fn test_regex_compilation_48() {
+fn test_regex_compilation_49() {
     use regex::Regex;
     let _: &Regex = &SDN_CONTROLLER_PENDING_ISIS_IFACES_RE;
     let _: &Regex = &SDN_CONTROLLER_PENDING_ISIS_NET_RE;
@@ -22439,7 +22505,7 @@ SDN_VNET_MAC_VRF_MAC_RE = r##"^(?i)[a-f0-9][02468ace](?::[a-f0-9]{2}){5}$"##;
 }
 
 #[test]
-fn test_regex_compilation_49() {
+fn test_regex_compilation_50() {
     use regex::Regex;
     let _: &Regex = &SDN_VNET_MAC_VRF_MAC_RE;
 }
@@ -22551,7 +22617,7 @@ SDN_ZONE_EXITNODES_PRIMARY_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"##;
 }
 
 #[test]
-fn test_regex_compilation_50() {
+fn test_regex_compilation_51() {
     use regex::Regex;
     let _: &Regex = &SDN_ZONE_EXITNODES_RE;
     let _: &Regex = &SDN_ZONE_EXITNODES_PRIMARY_RE;
@@ -22881,7 +22947,7 @@ SDN_ZONE_PENDING_EXITNODES_PRIMARY_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9]
 }
 
 #[test]
-fn test_regex_compilation_51() {
+fn test_regex_compilation_52() {
     use regex::Regex;
     let _: &Regex = &SDN_ZONE_PENDING_EXITNODES_RE;
     let _: &Regex = &SDN_ZONE_PENDING_EXITNODES_PRIMARY_RE;
@@ -23419,7 +23485,7 @@ START_ALL_GUESTS_VMS_RE = r##"^[1-9][0-9]{2,8}$"##;
 }
 
 #[test]
-fn test_regex_compilation_52() {
+fn test_regex_compilation_53() {
     use regex::Regex;
     let _: &Regex = &START_ALL_GUESTS_VMS_RE;
 }
@@ -23519,7 +23585,7 @@ START_QEMU_TARGETSTORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9]):(?i:[a-z][a-z
 }
 
 #[test]
-fn test_regex_compilation_53() {
+fn test_regex_compilation_54() {
     use regex::Regex;
     let _: &Regex = &START_QEMU_MIGRATEDFROM_RE;
     let _: &Regex = &START_QEMU_TARGETSTORAGE_RE;
@@ -23679,7 +23745,7 @@ STOP_ALL_GUESTS_VMS_RE = r##"^[1-9][0-9]{2,8}$"##;
 }
 
 #[test]
-fn test_regex_compilation_54() {
+fn test_regex_compilation_55() {
     use regex::Regex;
     let _: &Regex = &STOP_ALL_GUESTS_VMS_RE;
 }
@@ -23792,7 +23858,7 @@ STOP_QEMU_MIGRATEDFROM_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"##;
 }
 
 #[test]
-fn test_regex_compilation_55() {
+fn test_regex_compilation_56() {
     use regex::Regex;
     let _: &Regex = &STOP_QEMU_MIGRATEDFROM_RE;
 }
@@ -23861,7 +23927,7 @@ STORAGE_CONFIG_STORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##;
 }
 
 #[test]
-fn test_regex_compilation_56() {
+fn test_regex_compilation_57() {
     use regex::Regex;
     let _: &Regex = &STORAGE_CONFIG_FS_NAME_RE;
     let _: &Regex = &STORAGE_CONFIG_NODES_RE;
@@ -24120,7 +24186,7 @@ STORAGE_INFO_STORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##;
 }
 
 #[test]
-fn test_regex_compilation_57() {
+fn test_regex_compilation_58() {
     use regex::Regex;
     let _: &Regex = &STORAGE_INFO_STORAGE_RE;
 }
@@ -24558,7 +24624,7 @@ SUSPEND_ALL_GUESTS_VMS_RE = r##"^[1-9][0-9]{2,8}$"##;
 }
 
 #[test]
-fn test_regex_compilation_58() {
+fn test_regex_compilation_59() {
     use regex::Regex;
     let _: &Regex = &SUSPEND_ALL_GUESTS_VMS_RE;
 }
@@ -24604,7 +24670,7 @@ SUSPEND_QEMU_STATESTORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##;
 }
 
 #[test]
-fn test_regex_compilation_59() {
+fn test_regex_compilation_60() {
     use regex::Regex;
     let _: &Regex = &SUSPEND_QEMU_STATESTORAGE_RE;
 }
@@ -24848,7 +24914,7 @@ UPDATE_ACL_TOKENS_RE = r##"^[^\s:/]+@[A-Za-z][A-Za-z0-9\.\-_]+![A-Za-z][A-Za-z0-
 }
 
 #[test]
-fn test_regex_compilation_60() {
+fn test_regex_compilation_61() {
     use regex::Regex;
     let _: &Regex = &UPDATE_ACL_GROUPS_RE;
     let _: &Regex = &UPDATE_ACL_ROLES_RE;
@@ -24958,7 +25024,7 @@ UPDATE_CLUSTER_FIREWALL_OPTIONS_DELETE_RE = r##"^(?i:[a-z][a-z0-9_-]+)$"##;
 }
 
 #[test]
-fn test_regex_compilation_61() {
+fn test_regex_compilation_62() {
     use regex::Regex;
     let _: &Regex = &UPDATE_CLUSTER_FIREWALL_OPTIONS_DELETE_RE;
 }
@@ -25052,7 +25118,7 @@ UPDATE_CLUSTER_OPTIONS_MAC_PREFIX_RE = r##"^(?i)[a-f0-9][02468ace](?::[a-f0-9]{2
 }
 
 #[test]
-fn test_regex_compilation_62() {
+fn test_regex_compilation_63() {
     use regex::Regex;
     let _: &Regex = &UPDATE_CLUSTER_OPTIONS_DELETE_RE;
     let _: &Regex = &UPDATE_CLUSTER_OPTIONS_EMAIL_FROM_RE;
@@ -25402,7 +25468,7 @@ UPDATE_GUEST_FIREWALL_OPTIONS_DELETE_RE = r##"^(?i:[a-z][a-z0-9_-]+)$"##;
 }
 
 #[test]
-fn test_regex_compilation_63() {
+fn test_regex_compilation_64() {
     use regex::Regex;
     let _: &Regex = &UPDATE_GUEST_FIREWALL_OPTIONS_DELETE_RE;
 }
@@ -25533,7 +25599,7 @@ UPDATE_LXC_CONFIG_TIMEZONE_RE = r##"^.*/.*$"##;
 }
 
 #[test]
-fn test_regex_compilation_64() {
+fn test_regex_compilation_65() {
     use regex::Regex;
     let _: &Regex = &UPDATE_LXC_CONFIG_DELETE_RE;
     let _: &Regex = &UPDATE_LXC_CONFIG_REVERT_RE;
@@ -25928,7 +25994,7 @@ UPDATE_NODE_CONFIG_DELETE_RE = r##"^(?i:[a-z][a-z0-9_-]+)$"##;
 }
 
 #[test]
-fn test_regex_compilation_65() {
+fn test_regex_compilation_66() {
     use regex::Regex;
     let _: &Regex = &UPDATE_NODE_CONFIG_DELETE_RE;
 }
@@ -26042,7 +26108,7 @@ UPDATE_NODE_FIREWALL_OPTIONS_DELETE_RE = r##"^(?i:[a-z][a-z0-9_-]+)$"##;
 }
 
 #[test]
-fn test_regex_compilation_66() {
+fn test_regex_compilation_67() {
     use regex::Regex;
     let _: &Regex = &UPDATE_NODE_FIREWALL_OPTIONS_DELETE_RE;
 }
@@ -26263,7 +26329,7 @@ UPDATE_QEMU_CONFIG_VMSTATESTORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##;
 }
 
 #[test]
-fn test_regex_compilation_67() {
+fn test_regex_compilation_68() {
     use regex::Regex;
     let _: &Regex = &UPDATE_QEMU_CONFIG_AFFINITY_RE;
     let _: &Regex = &UPDATE_QEMU_CONFIG_BOOTDISK_RE;
@@ -27176,7 +27242,7 @@ UPDATE_QEMU_CONFIG_ASYNC_VMSTATESTORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9]
 }
 
 #[test]
-fn test_regex_compilation_68() {
+fn test_regex_compilation_69() {
     use regex::Regex;
     let _: &Regex = &UPDATE_QEMU_CONFIG_ASYNC_AFFINITY_RE;
     let _: &Regex = &UPDATE_QEMU_CONFIG_ASYNC_BOOTDISK_RE;
@@ -28067,7 +28133,7 @@ UPDATE_QEMU_CONFIG_EFIDISK0_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##;
 }
 
 #[test]
-fn test_regex_compilation_69() {
+fn test_regex_compilation_70() {
     use regex::Regex;
     let _: &Regex = &UPDATE_QEMU_CONFIG_EFIDISK0_SIZE_RE;
 }
@@ -28152,7 +28218,7 @@ UPDATE_QEMU_CONFIG_IDE_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##;
 }
 
 #[test]
-fn test_regex_compilation_70() {
+fn test_regex_compilation_71() {
     use regex::Regex;
     let _: &Regex = &UPDATE_QEMU_CONFIG_IDE_MODEL_RE;
     let _: &Regex = &UPDATE_QEMU_CONFIG_IDE_SERIAL_RE;
@@ -28508,7 +28574,7 @@ UPDATE_QEMU_CONFIG_SATA_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##;
 }
 
 #[test]
-fn test_regex_compilation_71() {
+fn test_regex_compilation_72() {
     use regex::Regex;
     let _: &Regex = &UPDATE_QEMU_CONFIG_SATA_SERIAL_RE;
     let _: &Regex = &UPDATE_QEMU_CONFIG_SATA_SIZE_RE;
@@ -28853,7 +28919,7 @@ UPDATE_QEMU_CONFIG_SCSI_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##;
 }
 
 #[test]
-fn test_regex_compilation_72() {
+fn test_regex_compilation_73() {
     use regex::Regex;
     let _: &Regex = &UPDATE_QEMU_CONFIG_SCSI_SERIAL_RE;
     let _: &Regex = &UPDATE_QEMU_CONFIG_SCSI_SIZE_RE;
@@ -29253,7 +29319,7 @@ UPDATE_QEMU_CONFIG_TPMSTATE0_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##;
 }
 
 #[test]
-fn test_regex_compilation_73() {
+fn test_regex_compilation_74() {
     use regex::Regex;
     let _: &Regex = &UPDATE_QEMU_CONFIG_TPMSTATE0_SIZE_RE;
 }
@@ -29316,7 +29382,7 @@ UPDATE_QEMU_CONFIG_VIRTIO_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##;
 }
 
 #[test]
-fn test_regex_compilation_74() {
+fn test_regex_compilation_75() {
     use regex::Regex;
     let _: &Regex = &UPDATE_QEMU_CONFIG_VIRTIO_SERIAL_RE;
     let _: &Regex = &UPDATE_QEMU_CONFIG_VIRTIO_SIZE_RE;
@@ -29676,7 +29742,7 @@ UPDATE_REPLICATION_JOB_SOURCE_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"
 }
 
 #[test]
-fn test_regex_compilation_75() {
+fn test_regex_compilation_76() {
     use regex::Regex;
     let _: &Regex = &UPDATE_REPLICATION_JOB_DELETE_RE;
     let _: &Regex = &UPDATE_REPLICATION_JOB_SOURCE_RE;
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH datacenter-manager v2 3/4] api: pve: add VM-specific CPU flags endpoint
  2026-11-30 14:10 [PATCH datacenter-manager/proxmox{,-yew-comp}/qemu-server v2 0/4] load VM-specific CPU flags from the remote Arthur Bied-Charreton
  2026-11-30 14:10 ` [PATCH qemu-server v2 1/4] api: cpu flags: proxy the request to the given node Arthur Bied-Charreton
  2026-11-30 14:10 ` [PATCH proxmox v2 2/4] pve-api-types: add VM-specific CPU flags endpoint Arthur Bied-Charreton
@ 2026-11-30 14:10 ` Arthur Bied-Charreton
  2026-11-30 14:10 ` [PATCH proxmox-yew-comp v2 4/4] qemu: cpu flags: load the CPU flags from the node Arthur Bied-Charreton
  3 siblings, 0 replies; 5+ messages in thread
From: Arthur Bied-Charreton @ 2026-11-30 14:10 UTC (permalink / raw)
  To: pdm-devel

Fetch VM-specific CPU flags from the node so the CPU editor can stay in
sync with qemu-server instead of hardcoding the list that misses newer
ones like nested-virt.

Needs Resource.Audit on anything below the remote, since PVE shows that
list to any logged-in user.

Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
---
 server/src/api/pve/node.rs | 64 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 61 insertions(+), 3 deletions(-)

diff --git a/server/src/api/pve/node.rs b/server/src/api/pve/node.rs
index 5c7683bc..234d2939 100644
--- a/server/src/api/pve/node.rs
+++ b/server/src/api/pve/node.rs
@@ -1,7 +1,9 @@
 use anyhow::{Context, Error};
 
 use proxmox_access_control::CachedUserInfo;
-use proxmox_router::{Permission, Router, RpcEnvironment, SubdirMap, list_subdirs_api_method};
+use proxmox_router::{
+    Permission, Router, RpcEnvironment, SubdirMap, http_bail, list_subdirs_api_method,
+};
 use proxmox_schema::api;
 use proxmox_sortable_macro::sortable;
 
@@ -313,8 +315,10 @@ const QEMU_CAPABILITIES_ROUTER: Router = Router::new()
     .get(&list_subdirs_api_method!(QEMU_CAPABILITIES_SUBDIRS))
     .subdirs(QEMU_CAPABILITIES_SUBDIRS);
 
-const QEMU_CAPABILITIES_SUBDIRS: SubdirMap =
-    &[("cpu", &Router::new().get(&API_METHOD_QEMU_CPU_CAPABILITIES))];
+const QEMU_CAPABILITIES_SUBDIRS: SubdirMap = &[
+    ("cpu", &Router::new().get(&API_METHOD_QEMU_CPU_CAPABILITIES)),
+    ("cpu-flags", &Router::new().get(&API_METHOD_QEMU_CPU_FLAGS)),
+];
 
 #[api(
     input: {
@@ -350,3 +354,57 @@ async fn qemu_cpu_capabilities(
         .await
         .map_err(Into::into)
 }
+
+#[api(
+    input: {
+        properties: {
+            remote: { schema: REMOTE_ID_SCHEMA },
+            node: { schema: NODE_SCHEMA },
+            accel: {
+                type: pve_api_types::QemuCpuFlagsAccel,
+                optional: true,
+            },
+            arch: {
+                type: pve_api_types::ClusterResourceHostArch,
+                optional: true,
+            },
+        },
+    },
+    access: {
+        permission: &Permission::Anybody,
+        description: "Requires `Resource.Audit` on anything below the remote.",
+    },
+    returns: {
+        type: Array,
+        description: "A list of VM-specific CPU flags available on the remote.",
+        items: {
+            type: pve_api_types::QemuCpuFlag,
+        }
+    }
+)]
+/// List the VM-specific CPU flags available on a remote.
+async fn qemu_cpu_flags(
+    remote: String,
+    node: String,
+    accel: Option<pve_api_types::QemuCpuFlagsAccel>,
+    arch: Option<pve_api_types::ClusterResourceHostArch>,
+    rpcenv: &mut dyn RpcEnvironment,
+) -> Result<Vec<pve_api_types::QemuCpuFlag>, Error> {
+    let auth_id: Authid = rpcenv
+        .get_auth_id()
+        .context("no authid available")?
+        .parse()?;
+    if !CachedUserInfo::new()?.any_privs_below(
+        &auth_id,
+        &["resource", &remote],
+        PRIV_RESOURCE_AUDIT,
+    )? {
+        http_bail!(FORBIDDEN, "user has no access to this remote");
+    }
+
+    let client = super::connect_to_remote_for_node(&remote, &node)?;
+    client
+        .qemu_cpu_flags(&node, accel, arch)
+        .await
+        .map_err(Into::into)
+}
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH proxmox-yew-comp v2 4/4] qemu: cpu flags: load the CPU flags from the node
  2026-11-30 14:10 [PATCH datacenter-manager/proxmox{,-yew-comp}/qemu-server v2 0/4] load VM-specific CPU flags from the remote Arthur Bied-Charreton
                   ` (2 preceding siblings ...)
  2026-11-30 14:10 ` [PATCH datacenter-manager v2 3/4] api: pve: " Arthur Bied-Charreton
@ 2026-11-30 14:10 ` Arthur Bied-Charreton
  3 siblings, 0 replies; 5+ messages in thread
From: Arthur Bied-Charreton @ 2026-11-30 14:10 UTC (permalink / raw)
  To: pdm-devel

The CPU flags editor used a hardcoded list that fell behind
qemu-server, e.g. it misses the nested-virt alias.

Load the flags from the guest's node instead. The guest's arch is
passed if set explicitly so an emulated aarch64 guest does not get
the x86 flags, otherwise the node just defaults to its own arch.
Nodes before qemu-server 9.1.5 reject the arch parameter with a 400 and
only know x86 flags, so retry without it for x86_64.

Use the hardcoded list as a fallback for nodes without the endpoint,
which return 501. It only has x86 flags, so it is empty for guests with
another explicit arch. Other errors are shown.

Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
---
 .../pve/qemu_hardware_panel/mobile.rs         |   6 +-
 src/form/pve/qemu_cpu_flags_list.rs           | 192 ++++++++++++++----
 .../qemu_property/qemu_processor_property.rs  |  26 ++-
 3 files changed, 182 insertions(+), 42 deletions(-)

diff --git a/src/configuration/pve/qemu_hardware_panel/mobile.rs b/src/configuration/pve/qemu_hardware_panel/mobile.rs
index bc958b9..c9ccff0 100644
--- a/src/configuration/pve/qemu_hardware_panel/mobile.rs
+++ b/src/configuration/pve/qemu_hardware_panel/mobile.rs
@@ -768,7 +768,11 @@ impl PendingPropertyView for PveQemuHardwarePanel {
                 mobile,
             ),
             kernel_scheduler_property: qemu_kernel_scheduler_property(user_is_root, mobile),
-            cpu_flags_property: qemu_cpu_flags_property(mobile),
+            cpu_flags_property: qemu_cpu_flags_property(
+                props.node.clone(),
+                props.remote.clone(),
+                mobile,
+            ),
             display_property: qemu_display_property(mobile),
             machine_property: qemu_machine_property(mobile),
             scsihw_property: qemu_scsihw_property(mobile),
diff --git a/src/form/pve/qemu_cpu_flags_list.rs b/src/form/pve/qemu_cpu_flags_list.rs
index bfcac50..37ef899 100644
--- a/src/form/pve/qemu_cpu_flags_list.rs
+++ b/src/form/pve/qemu_cpu_flags_list.rs
@@ -4,21 +4,43 @@ use serde::{Deserialize, Serialize};
 use serde_json::Value;
 use std::collections::HashMap;
 
+use yew::html::IntoPropValue;
+
 use pwt::prelude::*;
 use pwt::widget::form::{
     ManagedField, ManagedFieldContext, ManagedFieldMaster, ManagedFieldScopeExt, ManagedFieldState,
     RadioButton,
 };
-use pwt::widget::{Column, List, ListTile, Row};
+use pwt::widget::{error_message, Column, Container, List, ListTile, Mask, Row};
 
 use pwt_macros::{builder, widget};
 
+use pve_api_types::QemuCpuFlag;
+
+use crate::http_get;
+use crate::percent_encoding::percent_encode_component;
+
 pub type QemuCpuFlagsComp = ManagedFieldMaster<QemuCpuFlagsField>;
 
 #[widget(comp=QemuCpuFlagsComp, @input)]
 #[derive(Clone, PartialEq, Properties)]
 #[builder]
-pub struct QemuCpuFlags {}
+pub struct QemuCpuFlags {
+    /// The node to query for available flags.
+    #[builder(IntoPropValue, into_prop_value)]
+    #[prop_or_default]
+    pub node: Option<AttrValue>,
+
+    /// Use Proxmox Datacenter Manager API endpoints
+    #[builder(IntoPropValue, into_prop_value)]
+    #[prop_or_default]
+    pub remote: Option<AttrValue>,
+
+    /// The guest's architecture, defaults to the node's architecture.
+    #[builder(IntoPropValue, into_prop_value)]
+    #[prop_or_default]
+    pub arch: Option<AttrValue>,
+}
 
 impl Default for QemuCpuFlags {
     fn default() -> Self {
@@ -30,10 +52,15 @@ impl QemuCpuFlags {
     pub fn new() -> Self {
         yew::props!(Self {})
     }
+
+    fn same_query(&self, other: &Self) -> bool {
+        self.node == other.node && self.remote == other.remote && self.arch == other.arch
+    }
 }
 
 pub enum Msg {
     Set(String, Option<bool>),
+    Loaded(QemuCpuFlags, Result<Vec<QemuCpuFlag>, Error>),
 }
 
 #[derive(Clone, Debug, Serialize, Deserialize)]
@@ -46,7 +73,72 @@ struct FlagEntry {
 #[doc(hidden)]
 pub struct QemuCpuFlagsField {
     state: ManagedFieldState,
-    flag_list: IndexMap<&'static str, FlagEntry>,
+    flag_list: IndexMap<String, FlagEntry>,
+    error: Option<String>,
+    loading: bool,
+}
+
+async fn load_flags(props: QemuCpuFlags) -> Msg {
+    let node = props.node.as_deref().unwrap_or("localhost");
+    let url = match &props.remote {
+        Some(remote) => format!(
+            "/pve/remotes/{}/nodes/{}/capabilities/qemu/cpu-flags",
+            percent_encode_component(remote),
+            percent_encode_component(node),
+        ),
+        None => format!(
+            "/nodes/{}/capabilities/qemu/cpu-flags",
+            percent_encode_component(node),
+        ),
+    };
+    let Some(arch) = props.arch.clone() else {
+        return Msg::Loaded(props, http_get(url, None).await);
+    };
+    let mut result = http_get(&url, Some(serde_json::json!({ "arch": arch.as_str() }))).await;
+    if matches!(&result, Err(err) if has_status(err, http::StatusCode::BAD_REQUEST)) {
+        // nodes before qemu-server 9.1.5 reject arch and only know x86 flags
+        result = if arch == "x86_64" {
+            http_get(url, None).await
+        } else {
+            Ok(Vec::new())
+        };
+    }
+    Msg::Loaded(props, result)
+}
+
+/// The VM-specific x86 flags of nodes without the cpu-flags API endpoint.
+fn fallback_flags(arch: Option<&str>) -> Vec<FlagEntry> {
+    if arch.is_some_and(|arch| arch != "x86_64") {
+        return Vec::new();
+    }
+    [
+        ("md-clear", tr!("Required to let the guest OS know if MDS is mitigated correctly")),
+        ("pcid", tr!("Meltdown fix cost reduction on Westmere, Sandy-, and IvyBridge Intel CPUs")),
+        ("spec-ctrl", tr!("Allows improved Spectre mitigation with Intel CPUs")),
+        ("ssbd", tr!("Protection for \"Speculative Store Bypass\" for Intel models")),
+        ("ibpb", tr!("Allows improved Spectre mitigation with AMD CPUs")),
+        ("virt-ssbd", tr!("Basis for \"Speculative Store Bypass\" protection for AMD models")),
+        ("amd-ssbd", tr!("Improves Spectre mitigation performance with AMD CPUs, best used with \"virt-ssbd\"")),
+        ("amd-no-ssb", tr!("Notifies guest OS that host is not vulnerable for Spectre on AMD CPUs")),
+        ("pdpe1gb", tr!("Allow guest OS to use 1GB size pages, if host HW supports it")),
+        ("hv-tlbflush", tr!("Improve performance in overcommitted Windows guests. May lead to guest bluescreens on old CPUs.")),
+        ("hv-evmcs", tr!("Improve performance for nested virtualization. Only supported on Intel CPUs.")),
+        ("aes", tr!("Activate AES instruction set for HW acceleration.")),
+    ]
+    .into_iter()
+    .map(|(name, descr)| FlagEntry {
+        enabled: None,
+        name: name.to_string(),
+        descr,
+    })
+    .collect()
+}
+
+fn has_status(err: &Error, status: http::StatusCode) -> bool {
+    matches!(
+        err.downcast_ref::<proxmox_client::Error>(),
+        Some(proxmox_client::Error::Api(err_status, _)) if *err_status == status
+    )
 }
 
 fn parse_flags(flags: &str) -> HashMap<String, bool> {
@@ -73,7 +165,7 @@ impl QemuCpuFlagsField {
     pub fn update_flag_list(&mut self, value: Value) {
         let current_flags = parse_flags(value.as_str().unwrap_or(""));
         for (name, item) in self.flag_list.iter_mut() {
-            if let Some(value) = current_flags.get(*name) {
+            if let Some(value) = current_flags.get(name) {
                 item.enabled = Some(*value);
             } else {
                 item.enabled = None;
@@ -93,39 +185,23 @@ impl ManagedField for QemuCpuFlagsField {
         Ok(value.clone())
     }
 
-    fn create(_ctx: &ManagedFieldContext<Self>) -> Self {
-        // TODO: let qemu-server host this and autogenerate or get from API call??
-        let all_flags = [
-            ("md-clear", tr!("Required to let the guest OS know if MDS is mitigated correctly")),
-            ("pcid", tr!("Meltdown fix cost reduction on Westmere, Sandy-, and IvyBridge Intel CPUs")),
-            ("spec-ctrl", tr!("Allows improved Spectre mitigation with Intel CPUs")),
-            ("ssbd", tr!("Protection for \"Speculative Store Bypass\" for Intel models")),
-            ("ibpb", tr!("Allows improved Spectre mitigation with AMD CPUs")),
-            ("virt-ssbd", tr!("Basis for \"Speculative Store Bypass\" protection for AMD models")),
-            ("amd-ssbd", tr!("Improves Spectre mitigation performance with AMD CPUs, best used with \"virt-ssbd\"")),
-            ("amd-no-ssb", tr!("Notifies guest OS that host is not vulnerable for Spectre on AMD CPUs")),
-            ("pdpe1gb", tr!("Allow guest OS to use 1GB size pages, if host HW supports it")),
-            ("hv-tlbflush", tr!("Improve performance in overcommitted Windows guests. May lead to guest bluescreens on old CPUs.")),
-            ("hv-evmcs", tr!("Improve performance for nested virtualization. Only supported on Intel CPUs.")),
-            ("aes", tr!("Activate AES instruction set for HW acceleration.")),
-        ];
-
-        let mut flag_list = IndexMap::new();
-        flag_list.extend(all_flags.into_iter().map(|(flag, descr)| {
-            (
-                flag,
-                FlagEntry {
-                    name: flag.to_string(),
-                    descr,
-                    enabled: None,
-                },
-            )
-        }));
-
+    fn create(ctx: &ManagedFieldContext<Self>) -> Self {
+        ctx.link().send_future(load_flags(ctx.props().clone()));
         Self {
             state: ManagedFieldState::new(Value::Null, Value::Null),
-            flag_list,
+            flag_list: IndexMap::new(),
+            error: None,
+            loading: true,
+        }
+    }
+
+    fn changed(&mut self, ctx: &ManagedFieldContext<Self>, old_props: &Self::Properties) -> bool {
+        if !ctx.props().same_query(old_props) {
+            self.loading = true;
+            self.error = None;
+            ctx.link().send_future(load_flags(ctx.props().clone()));
         }
+        true
     }
 
     fn value_changed(&mut self, _ctx: &ManagedFieldContext<Self>) {
@@ -137,6 +213,34 @@ impl ManagedField for QemuCpuFlagsField {
             Msg::Set(flag, enabled) => {
                 self.flag_list[flag.as_str()].enabled = enabled;
             }
+            Msg::Loaded(props, result) => {
+                if !props.same_query(ctx.props()) {
+                    return false; // stale response for previous properties
+                }
+                self.error = None;
+                self.loading = false;
+                let flags = match result {
+                    Ok(flags) => flags
+                        .into_iter()
+                        .map(|flag| FlagEntry {
+                            enabled: None,
+                            name: flag.name,
+                            descr: flag.description.unwrap_or_default(),
+                        })
+                        .collect(),
+                    // nodes without the route answer 501
+                    Err(err) if has_status(&err, http::StatusCode::NOT_IMPLEMENTED) => {
+                        fallback_flags(props.arch.as_deref())
+                    }
+                    Err(err) => {
+                        self.error = Some(err.to_string());
+                        Vec::new()
+                    }
+                };
+                self.flag_list = flags.into_iter().map(|f| (f.name.clone(), f)).collect();
+                self.update_flag_list(self.state.value.clone());
+                return true;
+            }
         }
 
         let mut new_flags: Vec<String> = self
@@ -166,6 +270,10 @@ impl ManagedField for QemuCpuFlagsField {
     }
 
     fn view(&self, ctx: &ManagedFieldContext<Self>) -> Html {
+        if let Some(err) = &self.error {
+            return error_message(err).padding(2).into();
+        }
+
         let tiles: Vec<ListTile> = self
             .flag_list
             .iter()
@@ -223,9 +331,21 @@ impl ManagedField for QemuCpuFlagsField {
                 .key(item.name.clone())
             })
             .collect();
-        List::from_tiles(tiles)
+        let content: Html = if tiles.is_empty() && !self.loading {
+            Container::new()
+                .padding(2)
+                .with_child(tr!("No CPU flags available"))
+                .into()
+        } else {
+            List::from_tiles(tiles)
+                .class(pwt::css::FlexFit)
+                .grid_template_columns("1fr auto")
+                .into()
+        };
+        Mask::new(content)
             .class(pwt::css::FlexFit)
-            .grid_template_columns("1fr auto")
+            .style("min-height", self.loading.then_some("4em"))
+            .visible(self.loading)
             .into()
     }
 }
diff --git a/src/form/pve/qemu_property/qemu_processor_property.rs b/src/form/pve/qemu_property/qemu_processor_property.rs
index 0ba24a0..cfcc3bc 100644
--- a/src/form/pve/qemu_property/qemu_processor_property.rs
+++ b/src/form/pve/qemu_property/qemu_processor_property.rs
@@ -133,7 +133,8 @@ fn processor_input_panel(
 
         let main_view =
             socket_cores_input_panel(node.clone(), remote.clone(), false).apply(state.clone());
-        let flags_view = cpu_flags_input_panel(false).apply(state.clone());
+        let flags_view =
+            cpu_flags_input_panel(node.clone(), remote.clone(), false).apply(state.clone());
         let scheduler_view = kernel_scheduler_input_panel(user_is_root, false).apply(state.clone());
 
         Column::new()
@@ -229,15 +230,30 @@ pub fn qemu_sockets_cores_property(
     })
 }
 
-fn cpu_flags_input_panel(_mobile: bool) -> RenderPropertyInputPanelFn {
-    RenderPropertyInputPanelFn::new(move |_| QemuCpuFlags::new().name("_flags").into())
+fn cpu_flags_input_panel(
+    node: AttrValue,
+    remote: Option<AttrValue>,
+    _mobile: bool,
+) -> RenderPropertyInputPanelFn {
+    RenderPropertyInputPanelFn::new(move |state: PropertyEditorState| {
+        QemuCpuFlags::new()
+            .node(node.clone())
+            .remote(remote.clone())
+            .arch(state.record["arch"].as_str().map(String::from))
+            .name("_flags")
+            .into()
+    })
 }
 
-pub fn qemu_cpu_flags_property(mobile: bool) -> EditableProperty {
+pub fn qemu_cpu_flags_property(
+    node: AttrValue,
+    remote: Option<AttrValue>,
+    mobile: bool,
+) -> EditableProperty {
     EditableProperty::new("cpu", tr!("CPU flags"))
         .required(true)
         .renderer(renderer)
-        .render_input_panel(cpu_flags_input_panel(mobile))
+        .render_input_panel(cpu_flags_input_panel(node, remote, mobile))
         .load_hook(move |mut record: Value| {
             flatten_property_string::<PveVmCpuConf>(&mut record, "cpu")?;
             Ok(record)
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-30 14:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 14:10 [PATCH datacenter-manager/proxmox{,-yew-comp}/qemu-server v2 0/4] load VM-specific CPU flags from the remote Arthur Bied-Charreton
2026-11-30 14:10 ` [PATCH qemu-server v2 1/4] api: cpu flags: proxy the request to the given node Arthur Bied-Charreton
2026-11-30 14:10 ` [PATCH proxmox v2 2/4] pve-api-types: add VM-specific CPU flags endpoint Arthur Bied-Charreton
2026-11-30 14:10 ` [PATCH datacenter-manager v2 3/4] api: pve: " Arthur Bied-Charreton
2026-11-30 14:10 ` [PATCH proxmox-yew-comp v2 4/4] qemu: cpu flags: load the CPU flags from the node Arthur Bied-Charreton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal