mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 02:51:16 +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>
|
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,
|
* src/openvz_conf.c, src/openvz_conf.h, src/openvz_driver.c,
|
||||||
|
@ -156,19 +156,19 @@ void
|
|||||||
openvzFreeDriver(struct openvz_driver *driver)
|
openvzFreeDriver(struct openvz_driver *driver)
|
||||||
{
|
{
|
||||||
virDomainObjPtr dom;
|
virDomainObjPtr dom;
|
||||||
|
|
||||||
if (!driver)
|
if (!driver)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dom = driver->domains;
|
dom = driver->domains;
|
||||||
while (dom) {
|
while (dom) {
|
||||||
virDomainObjPtr tmp = dom->next;
|
virDomainObjPtr tmp = dom->next;
|
||||||
virDomainObjFree(dom);
|
virDomainObjFree(dom);
|
||||||
dom = tmp;
|
dom = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
virCapabilitiesFree(driver->caps);
|
virCapabilitiesFree(driver->caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -192,38 +192,38 @@ int openvzLoadDomains(struct openvz_driver *driver) {
|
|||||||
if (fscanf(fp, "%d %s\n", &veid, status) != 2) {
|
if (fscanf(fp, "%d %s\n", &veid, status) != 2) {
|
||||||
if (feof(fp))
|
if (feof(fp))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
openvzError(NULL, VIR_ERR_INTERNAL_ERROR,
|
openvzError(NULL, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Failed to parse vzlist output"));
|
_("Failed to parse vzlist output"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC(dom) < 0 ||
|
if (VIR_ALLOC(dom) < 0 ||
|
||||||
VIR_ALLOC(dom->def) < 0)
|
VIR_ALLOC(dom->def) < 0)
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
if (STREQ(status, "stopped"))
|
if (STREQ(status, "stopped"))
|
||||||
dom->state = VIR_DOMAIN_SHUTOFF;
|
dom->state = VIR_DOMAIN_SHUTOFF;
|
||||||
else
|
else
|
||||||
dom->state = VIR_DOMAIN_RUNNING;
|
dom->state = VIR_DOMAIN_RUNNING;
|
||||||
|
|
||||||
dom->pid = veid;
|
dom->pid = veid;
|
||||||
dom->def->id = dom->state == VIR_DOMAIN_SHUTOFF ? -1 : veid;
|
dom->def->id = dom->state == VIR_DOMAIN_SHUTOFF ? -1 : veid;
|
||||||
|
|
||||||
if (asprintf(&dom->def->name, "%i", veid) < 0) {
|
if (asprintf(&dom->def->name, "%i", veid) < 0) {
|
||||||
dom->def->name = NULL;
|
dom->def->name = NULL;
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
openvzGetVPSUUID(veid, uuidstr);
|
openvzGetVPSUUID(veid, uuidstr);
|
||||||
ret = virUUIDParse(uuidstr, dom->def->uuid);
|
ret = virUUIDParse(uuidstr, dom->def->uuid);
|
||||||
|
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
openvzError(NULL, VIR_ERR_INTERNAL_ERROR,
|
openvzError(NULL, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("UUID in config file malformed"));
|
_("UUID in config file malformed"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(dom->def->os.type = strdup("exe")))
|
if (!(dom->def->os.type = strdup("exe")))
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
if (!(dom->def->os.init = strdup("/sbin/init")))
|
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));
|
ret = openvzReadConfigParam(veid, "CPUS", temp, sizeof(temp));
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
openvzError(NULL, VIR_ERR_INTERNAL_ERROR,
|
openvzError(NULL, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Cound not read config for container %d"),
|
_("Cound not read config for container %d"),
|
||||||
veid);
|
veid);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else if (ret > 0) {
|
} else if (ret > 0) {
|
||||||
@ -242,7 +242,7 @@ int openvzLoadDomains(struct openvz_driver *driver) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* XXX load rest of VM config data .... */
|
/* XXX load rest of VM config data .... */
|
||||||
|
|
||||||
if (prev) {
|
if (prev) {
|
||||||
prev->next = dom;
|
prev->next = dom;
|
||||||
} else {
|
} else {
|
||||||
@ -250,14 +250,14 @@ int openvzLoadDomains(struct openvz_driver *driver) {
|
|||||||
}
|
}
|
||||||
prev = dom;
|
prev = dom;
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
no_memory:
|
no_memory:
|
||||||
openvzError(NULL, VIR_ERR_NO_MEMORY, NULL);
|
openvzError(NULL, VIR_ERR_NO_MEMORY, NULL);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
virDomainObjFree(dom);
|
virDomainObjFree(dom);
|
||||||
|
@ -116,14 +116,14 @@ static int openvzDomainDefineCmd(virConnectPtr conn,
|
|||||||
ADD_ARG_LIT("--quiet");
|
ADD_ARG_LIT("--quiet");
|
||||||
ADD_ARG_LIT("create");
|
ADD_ARG_LIT("create");
|
||||||
ADD_ARG_LIT(vmdef->name);
|
ADD_ARG_LIT(vmdef->name);
|
||||||
|
|
||||||
if (vmdef->fss) {
|
if (vmdef->fss) {
|
||||||
if (vmdef->fss->type != VIR_DOMAIN_FS_TYPE_TEMPLATE) {
|
if (vmdef->fss->type != VIR_DOMAIN_FS_TYPE_TEMPLATE) {
|
||||||
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
|
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("only filesystem templates are supported"));
|
"%s", _("only filesystem templates are supported"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vmdef->fss->next) {
|
if (vmdef->fss->next) {
|
||||||
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
|
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("only one filesystem supported"));
|
"%s", _("only one filesystem supported"));
|
||||||
@ -223,7 +223,7 @@ static virDomainPtr openvzDomainLookupByName(virConnectPtr conn,
|
|||||||
dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
|
dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
|
||||||
if (!dom)
|
if (!dom)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
dom->id = vm->def->id;
|
dom->id = vm->def->id;
|
||||||
return dom;
|
return dom;
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ static int openvzDomainGetInfo(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
info->state = vm->state;
|
info->state = vm->state;
|
||||||
|
|
||||||
if (!virDomainIsActive(vm)) {
|
if (!virDomainIsActive(vm)) {
|
||||||
info->cpuTime = 0;
|
info->cpuTime = 0;
|
||||||
} else {
|
} else {
|
||||||
@ -261,13 +261,13 @@ static int openvzDomainGetInfo(virDomainPtr dom,
|
|||||||
static char *openvzDomainDumpXML(virDomainPtr dom, int flags) {
|
static char *openvzDomainDumpXML(virDomainPtr dom, int flags) {
|
||||||
struct openvz_driver *driver = (struct openvz_driver *)dom->conn->privateData;
|
struct openvz_driver *driver = (struct openvz_driver *)dom->conn->privateData;
|
||||||
virDomainObjPtr vm = virDomainFindByUUID(driver->domains, dom->uuid);
|
virDomainObjPtr vm = virDomainFindByUUID(driver->domains, dom->uuid);
|
||||||
|
|
||||||
if (!vm) {
|
if (!vm) {
|
||||||
openvzError(dom->conn, VIR_ERR_INVALID_DOMAIN,
|
openvzError(dom->conn, VIR_ERR_INVALID_DOMAIN,
|
||||||
_("no domain with matching uuid"));
|
_("no domain with matching uuid"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return virDomainDefFormat(dom->conn, vm->def, flags);
|
return virDomainDefFormat(dom->conn, vm->def, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,16 +283,16 @@ static int openvzDomainShutdown(virDomainPtr dom) {
|
|||||||
_("no domain with matching uuid"));
|
_("no domain with matching uuid"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm->state != VIR_DOMAIN_RUNNING) {
|
if (vm->state != VIR_DOMAIN_RUNNING) {
|
||||||
openvzError(dom->conn, VIR_ERR_INTERNAL_ERROR,
|
openvzError(dom->conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("domain is not in running state"));
|
_("domain is not in running state"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virRun(dom->conn, prog, NULL) < 0)
|
if (virRun(dom->conn, prog, NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
vm->def->id = -1;
|
vm->def->id = -1;
|
||||||
vm->state = VIR_DOMAIN_SHUTOFF;
|
vm->state = VIR_DOMAIN_SHUTOFF;
|
||||||
|
|
||||||
@ -558,7 +558,7 @@ openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
|
|||||||
vm->pid = strtoI(vmdef->name);
|
vm->pid = strtoI(vmdef->name);
|
||||||
vm->def->id = vm->pid;
|
vm->def->id = vm->pid;
|
||||||
vm->state = VIR_DOMAIN_RUNNING;
|
vm->state = VIR_DOMAIN_RUNNING;
|
||||||
|
|
||||||
dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
|
dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
|
||||||
if (dom)
|
if (dom)
|
||||||
dom->id = vm->def->id;
|
dom->id = vm->def->id;
|
||||||
|
Loading…
Reference in New Issue
Block a user