qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/5] plugins: conditional callbacks


From: Pierrick Bouvier
Subject: Re: [PATCH v2 4/5] plugins: conditional callbacks
Date: Wed, 13 Mar 2024 11:53:28 +0400
User-agent: Mozilla Thunderbird

On 3/13/24 01:25, Richard Henderson wrote:
On 3/11/24 21:54, Pierrick Bouvier wrote:
+/**
+ * enum qemu_plugin_cond - condition to enable callback
+ *
+ * @QEMU_PLUGIN_COND_NEVER: false
+ * @QEMU_PLUGIN_COND_ALWAYS: true
+ * @QEMU_PLUGIN_COND_EQ: is equal?
+ * @QEMU_PLUGIN_COND_NE: is not equal?
+ * @QEMU_PLUGIN_COND_LT: is less than?
+ * @QEMU_PLUGIN_COND_LE: is less than or equal?
+ * @QEMU_PLUGIN_COND_GT: is greater than?
+ * @QEMU_PLUGIN_COND_GE: is greater than or equal?
+ */
+enum qemu_plugin_cond {
+    QEMU_PLUGIN_COND_NEVER,
+    QEMU_PLUGIN_COND_ALWAYS,
+    QEMU_PLUGIN_COND_EQ,
+    QEMU_PLUGIN_COND_NE,
+    QEMU_PLUGIN_COND_LT,
+    QEMU_PLUGIN_COND_LE,
+    QEMU_PLUGIN_COND_GT,
+    QEMU_PLUGIN_COND_GE,
+};

Do you really need to expose ALWAYS/NEVER?

Not mandatory, but offers possibility to have a condition (based on a plugin command line parameter for instance), without using necessarily conditional callbacks (if option=off,option=on or other value).

I guess these are all unsigned?  Would it be clearer to add "U" suffixes?


For now we only have conditional callbacks/inline ops with unsigned type (qemu_plugin_u64). Found this to be redundant, but we can always add this suffix if you think it's better.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]