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~