libvirt-cim-bounces@redhat.com wrote on 2008-07-22 08:34:00:

> # HG changeset patch
> # User Kaitlin Rupert <karupert@us.ibm.com>
> # Date 1216686405 25200
> # Node ID e14f791f1cb4f84ed3cad03c9099d336e232fb48
> # Parent  abcd4c8a873656b6f12c4416832d185f8c9eb151
> [TEST] Fixes to support the ReferencedConfiguration VSMS param.
>
> These changes are needed to create a test case that tests the
> ReferencedConfiguration VSMS parameter.
>
> Fixes:
>   -Add ref_config param to create_using_definesystem() - allows the
> caller to specify a reference for the ReferenceConfiguration param
>   -Add enumerate_names() - Calls EnumerateInstanceNames() so the
> caller can get a list of CS references
>   -Fix default_vssd_rasd_str() so that is a mac address is supplied
> to the function, it is used instead of one of the const.<> values.
>
> Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>
>
> diff -r abcd4c8a8736 -r e14f791f1cb4 suites/libvirt-
> cim/lib/XenKvmLib/common_util.py
> --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py   Mon Jul 21
> 10:33:31 2008 -0700
> +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py   Mon Jul 21
> 17:26:45 2008 -0700
> @@ -64,8 +64,8 @@
>  
>      return (0, cs)
>  
> -def create_using_definesystem(domain_name, ip,
> -                              params=None, exp_err=None, virt='Xen'):
> +def create_using_definesystem(domain_name, ip, params=None, ref_config=' ',
> +                              exp_err=None, virt='Xen'):
>      bug = "85673"
>      try:
>          class_vsms = eval('vsms.' + \
> @@ -89,7 +89,7 @@
>  
>          service.DefineSystem(SystemSettings=vssd,
>                               ResourceSettings=rasd,
> -                             ReferenceConfiguration=' ')
> +                             ReferenceConfiguration=ref_config)
>      except pywbem.CIMError, (rc, desc):
>          if rc == exp_rc and desc.find(exp_desc) >= 0:
>              logger.info('Got expected rc code and error string.')
> diff -r abcd4c8a8736 -r e14f791f1cb4 suites/libvirt-
> cim/lib/XenKvmLib/computersystem.py
> --- a/suites/libvirt-cim/lib/XenKvmLib/computersystem.py   Mon Jul
> 21 10:33:31 2008 -0700
> +++ b/suites/libvirt-cim/lib/XenKvmLib/computersystem.py   Mon Jul
> 21 17:26:45 2008 -0700
> @@ -95,6 +95,20 @@
>  
>      return list
>  
> +def enumerate_names(server, virt='Xen'):
> +    conn = pywbem.WBEMConnection('http://%s' % server,
> +                                 (Globals.CIM_USER, Globals.CIM_PASS),
> +                                 Globals.CIM_NS)
> +    classname = get_typed_class(virt, 'ComputerSystem')
> +
> +    try:
> +        refs = conn.EnumerateInstanceNames(classname)
> +    except pywbem.CIMError, arg:
> +        raise Exception(arg[1])
> +        return []
> +
> +    return refs
> +
>  def system_of(server, iname):
>      t = eval(iname["CreationClassName"])
>  
> diff -r abcd4c8a8736 -r e14f791f1cb4 suites/libvirt-cim/lib/XenKvmLib/vsms.py
> --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py   Mon Jul 21 10:33:312008 -0700
> +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py   Mon Jul 21 17:26:452008 -0700
> @@ -263,7 +263,9 @@
>          return vssd.mof(), [d.mof(), m.mof()]
>      
>      class_nasd = get_nasd_class(virt)
> -    if virt == 'KVM':
> +    if net_mac != const.Xen_default_mac:
> +        pass
> +    elif virt == 'KVM':
>          net_mac= const.KVM_default_mac
>      elif virt == 'XenFV':
>          net_mac = const.XenFV_default_mac
>

  LXC network devices take a mac address argument as well?


> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim