[libvirt] [PATCH] fix size parameter in calls to numa_node_to_cpus

Daniel Veillard veillard at redhat.com
Fri Dec 12 12:27:54 UTC 2008


On Fri, Dec 12, 2008 at 10:46:27AM +0000, Daniel P. Berrange wrote:
> On Fri, Dec 12, 2008 at 11:40:23AM +0100, Daniel Veillard wrote:
> >   So applied and commited, thanks a lot, but I'm still puzzled, why did
> > we end out of memory, I will look quickly
> 
> The 'out of memory' message is a red-herring - its a bogus error reporting
> path after the failure. Something that also needs fixing...

  numa_node_to_cpus in the new version of libnuma seems to be a macro
doing more checks than the older entry point, umlCapsInitNUMA()
returns -1 and we assumed it was possible only if running out of memory.
I guess reporting a normal error is better, note the patch will
touch the strerror cleanup,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/
-------------- next part --------------
Index: src/qemu_driver.c
===================================================================
RCS file: /data/cvs/libxen/src/qemu_driver.c,v
retrieving revision 1.170
diff -u -p -r1.170 qemu_driver.c
--- src/qemu_driver.c	9 Dec 2008 20:22:39 -0000	1.170
+++ src/qemu_driver.c	12 Dec 2008 12:26:24 -0000
@@ -250,8 +250,11 @@ qemudStartup(void) {
 
     VIR_FREE(base);
 
-    if ((qemu_driver->caps = qemudCapsInit()) == NULL)
-        goto out_of_memory;
+    if ((qemu_driver->caps = qemudCapsInit()) == NULL) {
+        qemudLog(QEMUD_ERR, _("Failed to initilize capabilities: %s\n"),
+                 strerror(errno));
+        goto error;
+    }
 
     if (qemudLoadDriverConfig(qemu_driver, driverConf) < 0) {
         goto error;
Index: src/uml_driver.c
===================================================================
RCS file: /data/cvs/libxen/src/uml_driver.c,v
retrieving revision 1.10
diff -u -p -r1.10 uml_driver.c
--- src/uml_driver.c	10 Dec 2008 16:35:01 -0000	1.10
+++ src/uml_driver.c	12 Dec 2008 12:26:24 -0000
@@ -363,8 +363,10 @@ umlStartup(void) {
 
     VIR_FREE(base);
 
-    if ((uml_driver->caps = umlCapsInit()) == NULL)
-        goto out_of_memory;
+    if ((uml_driver->caps = umlCapsInit()) == NULL) {
+        umlLog(UML_ERR, "%s", _("cannot initialize capabilities"));
+        goto error;
+    }
 
 
     if ((uml_driver->inotifyFD = inotify_init()) < 0) {


More information about the libvir-list mailing list