[Libvirt-cim] [PATCH] [RFC] Check for matching hypervisor prefixes

Dan Smith danms at us.ibm.com
Tue Nov 27 15:44:58 UTC 2007


HE> +        if (info->assoc_class) {
HE> +                pfx = class_prefix_name(info->assoc_class);
HE> +
HE> +                if (!STREQC(ref_pfx, pfx)) {
HE> +                        if (!STREQC("CIM", pfx))

I would rather this be:

  if (!STREQC(ref_pfx, pfx) &&
      !STREQC("CIM", pfx))
    rc = false;

It cuts down on the nesting and makes the true condition clearer, I
think.

Also, could we name this function a little better to avoid confusion
with the ASSOC_MATCH macro?  ASSOC_MATCH should probably be named
ASSOC_MATCH_PN, but it would be easier to make the name of this new
function more explicit.

Thanks!

-- 
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/20071127/e3ab1abe/attachment.sig>


More information about the Libvirt-cim mailing list