
δΊ 2013-3-11 23:24, John Ferlan ει:
Since I didn't have the original email to reply-to, here is the link:
https://www.redhat.com/archives/libvirt-cim/2012-December/msg00029.html
Should the following return 0 as well?:
+ if (ret != 1) { + CU_DEBUG("Failed to translate xml into struct domain"); + }
Especially since get_dominfo_from_xml() will free and initialize dominfo to NULL.
You'll also need a "free(xml);" if you return. That's a memory leak.
What probably should be done is (btw: 8 space tabs are hard to do!)
ret = get_dominfo_from_xml(xml, dominfo); if (ret == 0) { CU_DEBUG("Failed to translate xml into struct domain"); goto out; } ret = virDomainGetAutostart(dom, &start); if (ret != 0) { CU_DEBUG("Failed to get dom autostart with libvirt API."); goto out; } (*dominfo)->autostrt = start;
out: free(xml);
return ret;
John
Yes, this seems fine.
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Best Regards Wenchao Xia