[Libvirt-cim] [PATCH] [TEST] Fixing and updating 02_reverse.py of HostedDependency to work with sblim-base-provider

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Sep 30 22:38:48 UTC 2008


> -    virtxml = vxml.get_class(options.virt)
> -    if options.virt == "LXC":
> +    virtxml = vxml.get_class(virt)
> +    if virt == "LXC":
>         cxml = virtxml(test_dom)
>      else:
>         cxml = virtxml(test_dom, mac = test_mac)
> -    ret = cxml.create(options.ip)
> 
> +    ret = cxml.cim_define(server)
>      if not ret:
> -        logger.error("ERROR: Failed to Create the dom: %s" % test_dom)
> -        status = FAIL
> -        return status
> -    keys = ['Name', 'CreationClassName']
> +        logger.error("Failed to define the dom: %s" % test_dom)
> +        return FAIL
> +
> +    rc = call_request_state_change(test_dom, server, 2, TIME, virt)
> +    if rc != 0:
> +        logger.error("Failed to start the dom: %s" % test_dom)
> +        cxml.undefine(server)
> +        return FAIL

What we really want to do here is implement cim_start().  You're welcome 
to leave this as is, but eventually we'll need to replace this (and the 
cxml.start() calls) with a cim_start() call.

This will be more uniform than using cim_define() to define a guest and 
then using a non-vxml related function to change the guest's state.  But 
cim_start() (or cim_state_change(), whichever way you think is best) can 
be added at some later time.

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list