[Libvirt-cim] [PATCH 1 of 2] Add new provider - VirtualSystemMigrationSettingData

Dan Smith danms at us.ibm.com
Wed Feb 6 16:51:07 UTC 2008


KR> +        conn = connect_by_classname(broker, CLASSNAME(ref), &s);

You open a connection here...

KR> +        if (conn == NULL) {
KR> +                if (is_get_inst)
KR> +                        cu_statusf(broker, &s,
KR> +                                   CMPI_RC_ERR_NOT_FOUND,
KR> +                                   "No such instance");
KR> +                goto out;
KR> +        }
KR> +
KR> +        inst = get_typed_instance(broker,
KR> +                                  CLASSNAME(ref),
KR> +                                  "VirtualSystemMigrationSettingData",
KR> +                                  NAMESPACE(ref));
KR> +        if (inst == NULL) {
KR> +                cu_statusf(broker, &s,
KR> +                           CMPI_RC_ERR_FAILED,
KR> +                           "Unable to get instance for %s", CLASSNAME(ref));
KR> +                goto out;
KR> +        }
KR> +
KR> +        CMSetProperty(inst, "InstanceID",
KR> +                      (CMPIValue *)"MigrationSettingData", CMPI_chars);
KR> +
KR> +        s = set_properties(broker, inst);
KR> +
KR> +        if (s.rc != CMPI_RC_OK)
KR> +            goto out;
KR> +
KR> +        if (is_get_inst) {
KR> +                s = cu_validate_ref(broker, ref, inst);
KR> +                if (s.rc != CMPI_RC_OK)
KR> +                        goto out;
KR> +        }
KR> +
KR> +        *_inst = inst;
KR> +
KR> + out:
KR> +        return s;
KR> +}

...and then leak it here :)

-- 
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/20080206/32c41d76/attachment.sig>


More information about the Libvirt-cim mailing list