
Dan Smith wrote:
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1195154883 28800 # Node ID ecc46606e90388217b94916c1eab2ceeb051064a # Parent 670294145fcc1a786594f5110e2248cd4ec0b7ed Initialize libvirt early so that we avoid the backend register race
This fixes the errant behavior we see with parallel calls to connect_by_classname(). This behavior was certainly possible with lv_connect(), but I imagine we were getting lucky most of the time.
Signed-off-by: Dan Smith <danms@us.ibm.com>
I was also seeing the same issue after applying the connect_by_classname(). I'm using Pegasus with forceProviderProcesses=true. I would see the issue the first call after restarting Pegasus. After applying this patch, I haven't seen the error. I've tried restarting Pegasus about 10 times, no error yet. :( ... I'm still getting this error and reproducible for each request (not only the first one) and each CIMOM (pegasus and sfcb). Both patches have been applied to the latest tree from repository. FC6, Centrino Duo, 32 bit sfcb 1.2.4, Pegasus tog-pegasus-2.5.2-2.fc6, libvirt-0.3.1-1.fc6,
Kaitlin Rupert wrote: libxml2-2.6.29-1.fc6 But I found the reason for this: I do only have KVM on my machine and the error message is the result of the Xen_ComputerSystem request. A CIMOM does not have the possibility to return different return codes, meaning the error for Xen_ComputerSystem and the instances for KVM_ComputerSystem. In the case where one request returned with an error, this one is reported back to the client and all returned instances are revoked. The attached patch fixes this problem by adding debug messages instead of setting a FAILED status, when trying to connect to libvirt. The current implementation does also handle it like this, with the difference that an attempt to connect to libvirt is not necessary, as lv_connect already checks before, which hypervisor type is available. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck@linux.vnet.ibm.com ************************************************** IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschaeftsfuehrung: Herbert Kircher Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294 Try to fix initialization error with connect_by_classname Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r aeae495924c5 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Thu Nov 15 11:28:04 2007 -0800 +++ b/libxkutil/misc_util.c Fri Nov 16 13:13:21 2007 +0100 @@ -56,11 +56,11 @@ virConnectPtr connect_by_classname(const const char *uri; virConnectPtr conn; + CMSetStatus(s, CMPI_RC_OK); + uri = cn_to_uri(classname); if (!uri) { - CMSetStatusWithChars(broker, s, - CMPI_RC_ERR_FAILED, - "Unable to generate URI from classname"); + CU_DEBUG("Provider is not repsponsibel for %s", classname); return NULL; } @@ -68,9 +68,7 @@ virConnectPtr connect_by_classname(const conn = virConnectOpen(uri); if (!conn) { - CMSetStatusWithChars(broker, s, - CMPI_RC_ERR_FAILED, - "Unable to connect to hypervisor"); + CU_DEBUG("Requested Hypervisor type is not running on this system: %s", uri); return NULL; } diff -r aeae495924c5 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Thu Nov 15 11:28:04 2007 -0800 +++ b/src/Virt_ComputerSystem.c Fri Nov 16 13:16:37 2007 +0100 @@ -343,9 +343,6 @@ static CMPIStatus return_enum_domains(co virConnectPtr conn = NULL; int ret; - if (!provider_is_responsible(_BROKER, reference, &s)) - return s; - conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); if (conn == NULL) return s;