[Libvirt-cim] [PATCH 2 of 2] Adds state information to the instance created in ComputerSystemDeletedIndication

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed Aug 26 22:42:33 UTC 2009


> diff -r ed7ae95312fc -r aceaaadd58fa src/Virt_ComputerSystem.h
> --- a/src/Virt_ComputerSystem.h	Wed Aug 26 16:40:06 2009 -0300
> +++ b/src/Virt_ComputerSystem.h	Wed Aug 26 16:40:18 2009 -0300
> @@ -24,6 +24,70 @@
>  #include "misc_util.h"
>  #include  "device_parsing.h"
> 
> +enum CIM_state {
> +        CIM_STATE_UNKNOWN      = 0,
> +        CIM_STATE_OTHER        = 1,
> +        CIM_STATE_ENABLED      = 2,
> +        CIM_STATE_DISABLED     = 3,
> +        CIM_STATE_SHUTDOWN     = 4,
> +        CIM_STATE_NOCHANGE     = 5,
> +        CIM_STATE_SUSPENDED    = 6,
> +        CIM_STATE_PAUSED       = 9,
> +        CIM_STATE_REBOOT       = 10,
> +        CIM_STATE_RESET        = 11,
> +};

I like having these moved out of Virt_CS.  However, can they be moved 
into src/svpc_types.h?

We have our SVPC types defined all over, but I think solidifying them in 
svpc_types.h makes sense.

> diff -r ed7ae95312fc -r aceaaadd58fa src/Virt_ComputerSystemIndication.c
> --- a/src/Virt_ComputerSystemIndication.c	Wed Aug 26 16:40:06 2009 -0300
> +++ b/src/Virt_ComputerSystemIndication.c	Wed Aug 26 16:40:18 2009 -0300
> @@ -330,6 +330,51 @@
>          return false;
>  }
> 
> +static bool set_instance_state(CMPIInstance *instance)
> +{
> +        CMPIStatus s = {CMPI_RC_OK, NULL};
> +        CMPIUint16 cim_state;
> +        CMPIString *cim_state_other = NULL;
> +        CMPIUint16 health_state;
> +        CMPIUint16 req_state;
> +        CMPIUint16 oping_status;
> +        CMPIUint16 op_status;
> +        CMPIArray *array;
> +
> +        cim_state = CIM_STATE_OTHER;
> +        cim_state_other = CMNewString(_BROKER, "Guest removed", &s);

I would say "Guest destroyed" here.  The function that the user calls is 
DestroySystem() - so it's in keeping with the same terminology.



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




More information about the Libvirt-cim mailing list