
δΊ 2013-3-12 4:54, John Ferlan ει:
Since I don't have the original email to reply-to, here is a link:
https://www.redhat.com/archives/libvirt-cim/2012-December/msg00038.html
In instance_from_dom(): * virDomainIsActive returns: Returns 1 if running, 0 if inactive, -1 on error. You are testing for < 0 (error condition) and an else with no determination about whether it's really active or not. Your comments in the code and the CU_DEBUG statements don't seem to sync. How is VSSD_RECOVERABLE true when active = -1?
logic is: ret = get_dominfo(dom, &dominfo); if (!ret) { int active = virDomainIsActive(dom); if (active < 0) { /* ret > 1 indicate that it is recoverable */ CU_DEBUG("Failed to get dominfo, " "domain may not be active anymore."); ret = VSSD_ERROR_RECOVERABLE; } else { CU_DEBUG("Failed to get dominfo."); } goto out; } if it get_dominfo() fail, then check the reason. if virDomainIsActive() returns negative also, that means domain may not exist. if it succeed, but get_dominfo() fail, that means somethings bad happen below. I know this seems inreasonable, but I did observe the case for one VM, while it shows active but get xml fail, for underlining storage issue, in stress test. This is not perfect, let me check virConnectListAllDomains() case.
NOTE: In looking at get_dominfo() again - and thinking about this as a caller - why does it matter if autostart is set or not?
I really think the "get_domain_list()" should change to use virConnectListAllDomains() - it may solve more timing issues.
Yep, let me check the API version of libvirt.
John
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Best Regards Wenchao Xia