[Libvirt-cim] [PATCH] This patch fixes the problem with the get_console_sap_by_name

Richard Maciel richardm at br.ibm.com
Wed Dec 3 18:25:34 UTC 2008


# HG changeset patch
# User Richard Maciel <richardm at br.ibm.com>
# Date 1228328489 7200
# Node ID ae687011f6def5df176e5b9b553b93e9f907b7d6
# Parent  03af2846604b1fdc8d1d7fa3aef737f727b0414b
This patch fixes the problem with the get_console_sap_by_name
function crashing Pegasus sometimes.

This was caused when the local _BROKER was NULL, because the provider
hadn't been loaded.

To fix this we changed all _BROKER references to broker received as a
parameter of the function

Signed-off-by: Richard Maciel <richardm at br.ibm.com>

diff -r 03af2846604b -r ae687011f6de src/Virt_KVMRedirectionSAP.c
--- a/src/Virt_KVMRedirectionSAP.c	Tue Dec 02 11:14:00 2008 -0800
+++ b/src/Virt_KVMRedirectionSAP.c	Wed Dec 03 16:21:29 2008 -0200
@@ -400,7 +400,7 @@
         }
 
         if (sscanf(name, "%d:%d", &lport, &rport) != 2) {
-                cu_statusf(_BROKER, &s,
+                cu_statusf(broker, &s,
                            CMPI_RC_ERR_FAILED,
                            "Unable to determine console port for guest '%s'",
                            sys);
@@ -409,7 +409,7 @@
 
         port = malloc(sizeof(struct vnc_port));
         if (port == NULL) {
-                cu_statusf(_BROKER, &s,
+                cu_statusf(broker, &s,
                            CMPI_RC_ERR_FAILED,
                            "Unable to allocate guest port struct");
                 goto out;
@@ -417,7 +417,7 @@
 
         port->name = strdup(dominfo->name);
         if (port->name == NULL) {
-                cu_statusf(_BROKER, &s,
+                cu_statusf(broker, &s,
                            CMPI_RC_ERR_FAILED,
                            "Unable to allocate string");
                 goto out;
@@ -426,7 +426,7 @@
         port->port = lport;
         port->remote_port = rport;
 
-        inst = get_console_sap(_BROKER, ref, conn, port, &s);
+        inst = get_console_sap(broker, ref, conn, port, &s);
 
         virDomainFree(dom);
 




More information about the Libvirt-cim mailing list