[Libvirt-cim] [PATCH 1/4] FilterEntry: Change 'Priority' property type

Eduardo Lima (Etrunko) eblima at linux.vnet.ibm.com
Mon Jan 30 23:57:48 UTC 2012


From: "Eduardo Lima (Etrunko)" <eblima at br.ibm.com>

According to libvirt network filters specification, since version 0.9.8,
priority values can accept negative values within the range -1000 to 1000. Thus
the FilterEntry property value type went from unsigned int to signed int.

Signed-off-by: Eduardo Lima (Etrunko) <eblima at br.ibm.com>
---
 schema/FilterEntry.mof |   18 +++++++++---------
 src/Virt_FilterEntry.c |    2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/schema/FilterEntry.mof b/schema/FilterEntry.mof
index b51150c..f60abae 100644
--- a/schema/FilterEntry.mof
+++ b/schema/FilterEntry.mof
@@ -30,11 +30,11 @@ class KVM_Hdr8021Filter : CIM_Hdr8021Filter
                 "the rule will be, instantiated relative to other rules. "
                 "Rules with lower value will be instantiated and therefore "
                 "evaluated before rules with higher value. Valid values are "
-                "in the range of 0 to 1000. If this attribute is not "
+                "in the range of -1000 to 1000. If this attribute is not "
                 "provided, the value 500 will automatically be assigned."),
-        MinValue(0),
+        MinValue(-1000),
         MaxValue(1000)]
-        uint16 Priority = 500;
+        sint16 Priority = 500;
 };
 
 [Provider("cmpi::Virt_FilterEntry")]
@@ -68,11 +68,11 @@ class KVM_IPHeadersFilter : CIM_IPHeadersFilter
                 "the rule will be, instantiated relative to other rules. "
                 "Rules with lower value will be instantiated and therefore "
                 "evaluated before rules with higher value. Valid values are "
-                "in the range of 0 to 1000. If this attribute is not "
+                "in the range of -1000 to 1000. If this attribute is not "
                 "provided, the value 500 will automatically be assigned."),
-        MinValue(0),
+        MinValue(-1000),
         MaxValue(1000)]
-        uint16 Priority = 500;
+        sint16 Priority = 500;
 };
 
 [Provider("cmpi::Virt_FilterEntry")]
@@ -98,9 +98,9 @@ class KVM_FilterEntry : CIM_FilterEntry
                 "the rule will be, instantiated relative to other rules. "
                 "Rules with lower value will be instantiated and therefore "
                 "evaluated before rules with higher value. Valid values are "
-                "in the range of 0 to 1000. If this attribute is not "
+                "in the range of -1000 to 1000. If this attribute is not "
                 "provided, the value 500 will automatically be assigned."),
-        MinValue(0),
+        MinValue(-1000),
         MaxValue(1000)]
-        uint16 Priority = 500;
+        sint16 Priority = 500;
 };
diff --git a/src/Virt_FilterEntry.c b/src/Virt_FilterEntry.c
index 16b211e..a4fa4cd 100644
--- a/src/Virt_FilterEntry.c
+++ b/src/Virt_FilterEntry.c
@@ -554,7 +554,7 @@ static CMPIInstance *convert_rule_to_instance(
         CMSetProperty(inst, "Direction", (CMPIValue *)&direction, CMPI_uint16);
 
         priority = convert_priority(rule->priority);
-        CMSetProperty(inst, "Priority", (CMPIValue *)&priority, CMPI_uint16);
+        CMSetProperty(inst, "Priority", (CMPIValue *)&priority, CMPI_sint16);
 
         if (convert_f)
                 convert_f(rule, inst, broker);
-- 
1.7.7.6




More information about the Libvirt-cim mailing list