[PATCH 0 of 2] Camel case to lower case variable name change.

I don't think these changes are necessary. IsIPv6Only fits the DMTF's naming convention for attributes. I would say to leave the attribute name as is. Sharad Mishra wrote:
Signed-off-by: Sharad Mishra <snmishra@us.ibm.com>
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

Kaitlin, But when cimtest's vxml.py calls DefineSystem - ########### service.DefineSystem(SystemSettings=sys_settings, ResourceSettings=res_settings, ReferenceConfiguration=ref_conf) ############# it passes "res_settings" and these were set in vsms.py as - ************ class CIM_GraphicsResourceAllocationSettingData(CIMClassMOF): def __init__(self, name, res_sub_type="vnc", ip=None, ipv6_flag=None, lport='-1', keymap="en-us", vnc_passwd=None): self.InstanceID = '%s/graphics' %name self.ResourceType = RASD_TYPE_GRAPHICS if res_sub_type != None: self.ResourceSubType = res_sub_type if ip != None and lport != None: self.Address = '%s:%s' % (ip, lport) if ipv6_flag != None::% self.is_ipv6_only = ipv6_flag ************* So the name should change in VSMS.c too. Sharad Mishra System x Enablement Linux Technology Center IBM: libvirt-cim-bounces@redhat.com wrote on 12/03/2009 04:48:31 PM:
Kaitlin Rupert <kaitlin@linux.vnet.ibm.com> Sent by: libvirt-cim-bounces@redhat.com
12/03/2009 04:48 PM
Please respond to List for discussion and development of libvirt CIM <libvirt-cim@redhat.com>
To
List for discussion and development of libvirt CIM <libvirt-cim@redhat.com>
cc
Subject
Re: [Libvirt-cim] [PATCH 0 of 2] Camel case to lower case variable name change.
I don't think these changes are necessary. IsIPv6Only fits the DMTF's naming convention for attributes. I would say to leave the attribute name as is.
Sharad Mishra wrote:
Signed-off-by: Sharad Mishra <snmishra@us.ibm.com>
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

Sharad Mishra wrote:
Kaitlin,
But when cimtest's vxml.py calls DefineSystem -
########### service.DefineSystem(SystemSettings=sys_settings, ResourceSettings=res_settings, ReferenceConfiguration=ref_conf) #############
it passes "res_settings" and these were set in vsms.py as -
************ class CIM_GraphicsResourceAllocationSettingData(CIMClassMOF): def __init__(self, name, res_sub_type="vnc", ip=None, ipv6_flag=None, lport='-1', keymap="en-us", vnc_passwd=None): self.InstanceID = '%s/graphics' %name self.ResourceType = RASD_TYPE_GRAPHICS
if res_sub_type != None: self.ResourceSubType = res_sub_type
if ip != None and lport != None: self.Address = '%s:%s' % (ip, lport)
if ipv6_flag != None: self.is_ipv6_only = ipv6_flag
Hi Sharad, Sorry for being unclear here. self.IsIPv6Only is correct. So you should have: *****************
class CIM_GraphicsResourceAllocationSettingData(CIMClassMOF): def __init__(self, name, res_sub_type="vnc", ip=None, ipv6_flag=None, lport='-1', keymap="en-us", vnc_passwd=None): self.InstanceID = '%s/graphics' %name self.ResourceType = RASD_TYPE_GRAPHICS
if res_sub_type != None: self.ResourceSubType = res_sub_type
if ip != None and lport != None: self.Address = '%s:%s' % (ip, lport)
if ipv6_flag != None: self.IsIPv6Only = ipv6_flag
******************* The camel case I wanted you to remove from the test case was the following:
diff -r 45c6da8ca664 -r 75243e330ed7 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Dec 01 16:08:15 2009 -0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Dec 02 16:13:22 2009 -0800 @@ -569,7 +569,7 @@ def __init__(self, virt, dom_name, uuid, pae, acpi, apic, disk_dev, disk_source, net_type, net_name, net_mac, vcpus, mem, mem_allocunits, emu_type, grstype, ip, - port_num, kmap, irstype, btype, vnc_passwd): + IsIPv6Only, port_num, kmap, irstype, btype, vnc_passwd):
Just this piece here. This is the __init__ definition. So "IsIPv6Only" here is simply a parameter name for the __init__ function. It doesn't represent the actual attribute name at this point. It's just holds a value - we can name it whatever. As all other a parameter names for this function are lower case, this one should be as well. Does this make sense?
*************
So the name should change in VSMS.c too.
Sharad Mishra System x Enablement Linux Technology Center IBM
-- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

# HG changeset patch # User Sharad Mishra <snmishra@us.ibm.com> # Date 1259887733 28800 # Node ID c43110511d0391a0b3203212ba85d658cc046291 # Parent 282660c5e43aba6b284a9909144b9df14dc95f5b Variable name change in VSMS. Name was changed from IsIPv6Only to is_ipv6_only Signed-off-by: Sharad Mishra <snmishra@us.ibm.com> diff -r 282660c5e43a -r c43110511d03 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Dec 02 12:48:47 2009 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Thu Dec 03 16:48:53 2009 -0800 @@ -982,7 +982,7 @@ /* FIXME: Add logic to prevent address:port collisions */ if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) { CU_DEBUG("no graphics port defined, giving default"); - if (cu_get_bool_prop(inst, "IsIPv6Only", &ipv6) != CMPI_RC_OK) + if (cu_get_bool_prop(inst, "is_ipv6_only", &ipv6) != CMPI_RC_OK) ipv6 = false; if (ipv6) dev->dev.graphics.host = strdup("[::1]");

# HG changeset patch # User Sharad Mishra <snmishra@us.ibm.com> # Date 1259887744 28800 # Node ID ca47600f4ce1e2f5e4f2057f47eb0cf7366d4e3f # Parent c43110511d0391a0b3203212ba85d658cc046291 mof file changes. Varialbe name had changed in provider. Signed-off-by: Sharad Mishra <snmishra@us.ibm.com> diff -r c43110511d03 -r ca47600f4ce1 schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Thu Dec 03 16:48:53 2009 -0800 +++ b/schema/ResourceAllocationSettingData.mof Thu Dec 03 16:49:04 2009 -0800 @@ -141,7 +141,7 @@ string Password; [Description ("Is IPv6 only addressing is to be used")] - boolean IsIPv6Only; + boolean is_ipv6_only; }; [Description ("KVM virtual graphics device"), @@ -160,7 +160,7 @@ string Password; [Description ("Is IPv6 only addressing is to be used")] - boolean IsIPv6Only; + boolean is_ipv6_only; }; [Description ("LXC virtual graphics device"), @@ -179,7 +179,7 @@ string Password; [Description ("Is IPv6 only addressing is to be used")] - boolean IsIPv6Only; + boolean is_ipv6_only; }; [Description ("Xen virtual input device"),
participants (2)
-
Kaitlin Rupert
-
Sharad Mishra