[Libvirt-cim] [PATCH] Remove hardcoded Xen prefix from VSMigrationService

Dan Smith danms at us.ibm.com
Fri Aug 15 16:43:00 UTC 2008


KR>  static CMPIInstance *prepare_indication(const CMPIBroker *broker,
KR>                                          CMPIInstance *inst,
KR> -                                        char *ns,
KR> +                                        struct migration_job *job,
KR>                                          int ind_type,
KR>                                          CMPIStatus *s)
KR>  {
KR>          const char *ind_name = NULL;
KR>          CMPIInstance *ind = NULL;
KR>          CMPIInstance *prev_inst = NULL;
KR> +        const char *pfx = NULL;

KR>          ind_name = ind_type_to_name(ind_type);

KR>          CU_DEBUG("Creating indication.");
KR> -        /* Prefix needs to be dynamic */
KR> +
KR> +        pfx = pfx_from_conn(job->conn);

I think you leak 'pfx'.

KR> @@ -816,15 +808,20 @@
KR>                                      CMPIStatus *s)
KR>  {
KR>          CMPIObjectPath *ref = NULL;
KR> +        char *type;
KR> +        
KR> +        type = get_typed_class(job->ref_cn, "MigrationJob");
KR>          ref = CMNewObjectPath(_BROKER,
job-> ref_ns,
KR> -                              "Virt_MigrationJob",
KR> +                              type,
KR>                                s);
KR> -        if (s->rc != CMPI_RC_OK) {
KR> +        if (s->rc != CMPI_RC_OK) { 

The only change to this line is the addition of some trailing
whitespace.

KR>                  CU_DEBUG("Failed to create job ref for update");
KR>                  goto out;
KR>          }
KR> +
KR> +        free(type);

It looks like you leak 'type' if you take the "goto out" in the context
above.  There may be other places too.

-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms at us.ibm.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20080815/06abab4b/attachment.sig>


More information about the Libvirt-cim mailing list