mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
Fix trailing whitespace mistakes
This commit is contained in:
parent
1cc9f9b3d8
commit
a8936295ce
@ -1,3 +1,8 @@
|
||||
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,
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user