Misc bug fixes

This commit is contained in:
Daniel P. Berrange 2008-07-25 09:31:24 +00:00
parent c1e6cc1969
commit 3de646a51d
6 changed files with 101 additions and 25 deletions

View File

@ -1,3 +1,15 @@
Fri Jul 25 10:29:27 BST 2008 Daniel P. Berrange <berrange@redhat.com>
Miscellaneous minor bug fixes
* src/openvz_driver.c: Remove unused convCmdbufExec function
* src/qemu_conf.c: Use global default VNC listen address if
no domain specific address is available
* src/qemu_driver.c: Set CPU affinity to all CPUs if no domain
specific mask is provided
* src/test.c: Initialize variable to avoid crash on cleanup
* tests/.valgrind.supp: Suppress some valgrind warnins from
global variables not intended to be free'd
Fri Jul 25 11:00:27 CEST 2008 Daniel Veillard <veillard@redhat.com>
* src/qemu_driver.c: some uuid to string conversion were missing

View File

@ -91,33 +91,12 @@ static virDomainPtr openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
unsigned int flags ATTRIBUTE_UNUSED);
static int openvzDomainUndefine(virDomainPtr dom);
static int convCmdbufExec(char cmdbuf[], char *cmdExec[]);
static void cmdExecFree(char *cmdExec[]);
static int openvzGetProcessInfo(unsigned long long *cpuTime, int vpsid);
struct openvz_driver ovz_driver;
static int convCmdbufExec(char cmdbuf[], char *cmdExec[])
{
int i=0, limit = OPENVZ_MAX_ARG - 1;
char cmdWord[CMDOP_LEN];
while(*cmdbuf)
{
if(i >= limit)
{
cmdExec[i] = NULL;
return -1;
}
sscanf(cmdbuf, "%s", cmdWord);
cmdbuf += strlen(cmdWord);
while(*cmdbuf == ' ') cmdbuf++;
cmdExec[i++] = strdup(cmdWord);
}
cmdExec[i] = NULL;
return i;
}
static void cmdExecFree(char *cmdExec[])
{
int i=-1;

View File

@ -1106,7 +1106,9 @@ int qemudBuildCommandLine(virConnectPtr conn,
options[sizeof(options)-1] = '\0';
}
ret = snprintf(vncdisplay, sizeof(vncdisplay), "%s:%d%s",
vm->def->graphics->data.vnc.listenAddr,
(vm->def->graphics->data.vnc.listenAddr ?
vm->def->graphics->data.vnc.listenAddr :
(driver->vncListen ? driver->vncListen : "")),
vm->def->graphics->data.vnc.port - 5900,
options);
} else {

View File

@ -770,9 +770,14 @@ qemudInitCpus(virConnectPtr conn,
maxcpu = nodeinfo.cpus;
CPU_ZERO(&mask);
for (i = 0 ; i < maxcpu ; i++)
if (vm->def->cpumask[i])
if (vm->def->cpumask) {
for (i = 0 ; i < maxcpu ; i++)
if (vm->def->cpumask[i])
CPU_SET(i, &mask);
} else {
for (i = 0 ; i < maxcpu ; i++)
CPU_SET(i, &mask);
}
for (i = 0 ; i < vm->nvcpupids ; i++) {
if (sched_setaffinity(vm->vcpupids[i],

View File

@ -314,7 +314,7 @@ static int testOpenFromFile(virConnectPtr conn,
char *str;
xmlDocPtr xml = NULL;
xmlNodePtr root = NULL;
xmlNodePtr *domains, *networks = NULL;
xmlNodePtr *domains = NULL, *networks = NULL;
xmlXPathContextPtr ctxt = NULL;
virNodeInfoPtr nodeInfo;
virNetworkObjPtr net;

View File

@ -160,3 +160,81 @@
fun:virtTestRun
fun:mymain
}
{
xenDriverGlobalRegexes1
Memcheck:Leak
fun:*
fun:regcomp
fun:xenHypervisorInit
fun:xenUnifiedRegister
fun:virInitialize
fun:virConnectOpenReadOnly
fun:testCompareHelper
fun:virtTestRun
fun:mymain
fun:virtTestMain
}
{
xenDriverGlobalRegexes2
Memcheck:Leak
fun:*
fun:*
fun:regcomp
fun:xenHypervisorInit
fun:xenUnifiedRegister
fun:virInitialize
fun:virConnectOpenReadOnly
fun:testCompareHelper
fun:virtTestRun
fun:mymain
fun:virtTestMain
}
{
xenDriverGlobalRegexes3
Memcheck:Leak
fun:*
fun:*
fun:*
fun:regcomp
fun:xenHypervisorInit
fun:xenUnifiedRegister
fun:virInitialize
fun:virConnectOpenReadOnly
fun:testCompareHelper
fun:virtTestRun
fun:mymain
fun:virtTestMain
}
{
xenDriverGlobalRegexes4
Memcheck:Leak
fun:*
fun:*
fun:*
fun:*
fun:regcomp
fun:xenHypervisorInit
fun:xenUnifiedRegister
fun:virInitialize
fun:virConnectOpenReadOnly
fun:testCompareHelper
fun:virtTestRun
fun:mymain
fun:virtTestMain
}
{
libXMLGlobals1
Memcheck:Leak
fun:malloc
fun:xmlNewMutex
fun:xmlInitGlobals
fun:xmlInitParser
fun:xmlParseDocument
obj:/usr/lib64/libxml2.so.2.6.32
fun:virDomainDefParseString
fun:testOpen
fun:do_open
fun:testCompareHelper
fun:virtTestRun
fun:mymain
}