On 2/6/23 03:32, Eric Auger wrote:
+void kvm_arm_enable_mte(Error **errp)
+{
+ static bool tried_to_enable = false;
+ Error *mte_migration_blocker = NULL;
can't you make the mte_migration_blocker static instead?
+ int ret;
+
+ if (tried_to_enable) {
+ /*
+ * MTE on KVM is enabled on a per-VM basis (and retrying doesn't make
+ * sense), and we only want a single migration blocker as well.
+ */
+ return;
+ }
+ tried_to_enable = true;
+
+ if ((ret = kvm_vm_enable_cap(kvm_state, KVM_CAP_ARM_MTE, 0))) {
+ error_setg_errno(errp, -ret, "Failed to enable KVM_CAP_ARM_MTE");
+ return;
+ }
+
+ /* TODO: add proper migration support with MTE enabled */
+ error_setg(&mte_migration_blocker,
+ "Live migration disabled due to MTE enabled");
Making the blocker static wouldn't stop multiple errors from kvm_vm_enable_cap.
r~