+Fri Sep 5 15:59:26 BST 2008 Daniel P. Berrange <berrange@redhat.com>
+
+ * src/openvz_conf.c, src/openvz_driver.c: Fix trailing
+ whitespace mistakes
+
Fri Sep 5 15:09:26 BST 2008 Daniel P. Berrange <berrange@redhat.com>
* src/openvz_conf.c, src/openvz_conf.h, src/openvz_driver.c,
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);
-}
+}
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")))
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) {
}
/* XXX load rest of VM config data .... */
-
+
if (prev) {
prev->next = dom;
} else {
}
prev = dom;
}
-
+
fclose(fp);
-
+
return 0;
-
+
no_memory:
openvzError(NULL, VIR_ERR_NO_MEMORY, NULL);
-
+
cleanup:
fclose(fp);
virDomainObjFree(dom);
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"));
dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
if (!dom)
return NULL;
-
+
dom->id = vm->def->id;
return dom;
}
}
info->state = vm->state;
-
+
if (!virDomainIsActive(vm)) {
info->cpuTime = 0;
} else {
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);
}
_("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;
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;