diff --git a/ChangeLog b/ChangeLog index 5f23513c19..79bfdee358 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Sep 5 15:59:26 BST 2008 Daniel P. Berrange + + * src/openvz_conf.c, src/openvz_driver.c: Fix trailing + whitespace mistakes + Fri Sep 5 15:09:26 BST 2008 Daniel P. Berrange * src/openvz_conf.c, src/openvz_conf.h, src/openvz_driver.c, diff --git a/src/openvz_conf.c b/src/openvz_conf.c index 1ccf9239ee..25bd10fe69 100644 --- a/src/openvz_conf.c +++ b/src/openvz_conf.c @@ -156,19 +156,19 @@ void openvzFreeDriver(struct openvz_driver *driver) { virDomainObjPtr dom; - + if (!driver) return; - + dom = driver->domains; while (dom) { virDomainObjPtr tmp = dom->next; virDomainObjFree(dom); dom = tmp; } - + virCapabilitiesFree(driver->caps); -} +} @@ -192,38 +192,38 @@ int openvzLoadDomains(struct openvz_driver *driver) { if (fscanf(fp, "%d %s\n", &veid, status) != 2) { if (feof(fp)) break; - + openvzError(NULL, VIR_ERR_INTERNAL_ERROR, _("Failed to parse vzlist output")); goto cleanup; } - + if (VIR_ALLOC(dom) < 0 || VIR_ALLOC(dom->def) < 0) goto no_memory; - + if (STREQ(status, "stopped")) dom->state = VIR_DOMAIN_SHUTOFF; else dom->state = VIR_DOMAIN_RUNNING; - + dom->pid = veid; dom->def->id = dom->state == VIR_DOMAIN_SHUTOFF ? -1 : veid; - + if (asprintf(&dom->def->name, "%i", veid) < 0) { dom->def->name = NULL; goto no_memory; } - + openvzGetVPSUUID(veid, uuidstr); ret = virUUIDParse(uuidstr, dom->def->uuid); - + if (ret == -1) { openvzError(NULL, VIR_ERR_INTERNAL_ERROR, _("UUID in config file malformed")); goto cleanup; } - + if (!(dom->def->os.type = strdup("exe"))) goto no_memory; if (!(dom->def->os.init = strdup("/sbin/init"))) @@ -232,7 +232,7 @@ int openvzLoadDomains(struct openvz_driver *driver) { ret = openvzReadConfigParam(veid, "CPUS", temp, sizeof(temp)); if (ret < 0) { openvzError(NULL, VIR_ERR_INTERNAL_ERROR, - _("Cound not read config for container %d"), + _("Cound not read config for container %d"), veid); goto cleanup; } else if (ret > 0) { @@ -242,7 +242,7 @@ int openvzLoadDomains(struct openvz_driver *driver) { } /* XXX load rest of VM config data .... */ - + if (prev) { prev->next = dom; } else { @@ -250,14 +250,14 @@ int openvzLoadDomains(struct openvz_driver *driver) { } prev = dom; } - + fclose(fp); - + return 0; - + no_memory: openvzError(NULL, VIR_ERR_NO_MEMORY, NULL); - + cleanup: fclose(fp); virDomainObjFree(dom); diff --git a/src/openvz_driver.c b/src/openvz_driver.c index dd28303fe0..151a34862d 100644 --- a/src/openvz_driver.c +++ b/src/openvz_driver.c @@ -116,14 +116,14 @@ static int openvzDomainDefineCmd(virConnectPtr conn, ADD_ARG_LIT("--quiet"); ADD_ARG_LIT("create"); ADD_ARG_LIT(vmdef->name); - + if (vmdef->fss) { if (vmdef->fss->type != VIR_DOMAIN_FS_TYPE_TEMPLATE) { openvzError(conn, VIR_ERR_INTERNAL_ERROR, "%s", _("only filesystem templates are supported")); return -1; } - + if (vmdef->fss->next) { openvzError(conn, VIR_ERR_INTERNAL_ERROR, "%s", _("only one filesystem supported")); @@ -223,7 +223,7 @@ static virDomainPtr openvzDomainLookupByName(virConnectPtr conn, dom = virGetDomain(conn, vm->def->name, vm->def->uuid); if (!dom) return NULL; - + dom->id = vm->def->id; return dom; } @@ -240,7 +240,7 @@ static int openvzDomainGetInfo(virDomainPtr dom, } info->state = vm->state; - + if (!virDomainIsActive(vm)) { info->cpuTime = 0; } else { @@ -261,13 +261,13 @@ static int openvzDomainGetInfo(virDomainPtr dom, static char *openvzDomainDumpXML(virDomainPtr dom, int flags) { struct openvz_driver *driver = (struct openvz_driver *)dom->conn->privateData; virDomainObjPtr vm = virDomainFindByUUID(driver->domains, dom->uuid); - + if (!vm) { openvzError(dom->conn, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid")); return NULL; } - + return virDomainDefFormat(dom->conn, vm->def, flags); } @@ -283,16 +283,16 @@ static int openvzDomainShutdown(virDomainPtr dom) { _("no domain with matching uuid")); return -1; } - + if (vm->state != VIR_DOMAIN_RUNNING) { openvzError(dom->conn, VIR_ERR_INTERNAL_ERROR, _("domain is not in running state")); return -1; } - + if (virRun(dom->conn, prog, NULL) < 0) return -1; - + vm->def->id = -1; vm->state = VIR_DOMAIN_SHUTOFF; @@ -558,7 +558,7 @@ openvzDomainCreateLinux(virConnectPtr conn, const char *xml, vm->pid = strtoI(vmdef->name); vm->def->id = vm->pid; vm->state = VIR_DOMAIN_RUNNING; - + dom = virGetDomain(conn, vm->def->name, vm->def->uuid); if (dom) dom->id = vm->def->id;