summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ferlan <jferlan@redhat.com>2017-10-23 12:04:43 -0400
committerJohn Ferlan <jferlan@redhat.com>2018-03-26 11:20:04 -0400
commit5bb07527c11a6123e044a5dfc48bdeccee144994 (patch)
tree231270da540b6415d398de805e683e3389866448
parenta1745174e9e7bcab01db43688840b588018789ca (diff)
downloadlibvirt-5bb07527c11a6123e044a5dfc48bdeccee144994.tar.gz
openvz: Cleanup indentionv4.2.0-rc1
Some of the indents were only 2 spaces, make consistent w/ 4 spaces. Also some indents didn't align properly. Fix them all up. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
-rw-r--r--src/openvz/openvz_driver.c87
1 files changed, 44 insertions, 43 deletions
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index d95887ff7e..f1132490e8 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -222,10 +222,10 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef)
ret = 0;
cleanup:
- VIR_FREE(confdir);
- virCommandFree(cmd);
+ VIR_FREE(confdir);
+ virCommandFree(cmd);
- return ret;
+ return ret;
}
@@ -267,9 +267,9 @@ openvzSetDiskQuota(virDomainDefPtr vmdef,
ret = 0;
cleanup:
- virCommandFree(cmd);
+ virCommandFree(cmd);
- return ret;
+ return ret;
}
@@ -633,40 +633,40 @@ static int openvzDomainSuspend(virDomainPtr dom)
static int openvzDomainResume(virDomainPtr dom)
{
- struct openvz_driver *driver = dom->conn->privateData;
- virDomainObjPtr vm;
- const char *prog[] = {VZCTL, "--quiet", "chkpnt", PROGRAM_SENTINEL, "--resume", NULL};
- int ret = -1;
+ struct openvz_driver *driver = dom->conn->privateData;
+ virDomainObjPtr vm;
+ const char *prog[] = {VZCTL, "--quiet", "chkpnt", PROGRAM_SENTINEL, "--resume", NULL};
+ int ret = -1;
- openvzDriverLock(driver);
- vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
- openvzDriverUnlock(driver);
+ openvzDriverLock(driver);
+ vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
+ openvzDriverUnlock(driver);
- if (!vm) {
- virReportError(VIR_ERR_NO_DOMAIN, "%s",
- _("no domain with matching uuid"));
- goto cleanup;
- }
+ if (!vm) {
+ virReportError(VIR_ERR_NO_DOMAIN, "%s",
+ _("no domain with matching uuid"));
+ goto cleanup;
+ }
- if (!virDomainObjIsActive(vm)) {
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Domain is not running"));
- goto cleanup;
- }
+ if (!virDomainObjIsActive(vm)) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Domain is not running"));
+ goto cleanup;
+ }
- if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
- openvzSetProgramSentinal(prog, vm->def->name);
- if (virRun(prog, NULL) < 0)
- goto cleanup;
- virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_UNPAUSED);
- }
+ if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
+ openvzSetProgramSentinal(prog, vm->def->name);
+ if (virRun(prog, NULL) < 0)
+ goto cleanup;
+ virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_UNPAUSED);
+ }
- ret = 0;
+ ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
- return ret;
+ if (vm)
+ virObjectUnlock(vm);
+ return ret;
}
static int
@@ -833,7 +833,8 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
char *guest_ifname = NULL;
if (net == NULL)
- return 0;
+ return 0;
+
if (vpsid == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Container ID is not specified"));
@@ -864,9 +865,9 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
} else {
guest_ifname = openvzGenerateContainerVethName(veid);
if (guest_ifname == NULL) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not generate eth name for container"));
- goto cleanup;
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not generate eth name for container"));
+ goto cleanup;
}
}
@@ -875,9 +876,9 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
if (net->ifname == NULL) {
net->ifname = openvzGenerateVethName(veid, guest_ifname);
if (net->ifname == NULL) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not generate veth name"));
- goto cleanup;
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not generate veth name"));
+ goto cleanup;
}
}
@@ -902,7 +903,7 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
virCommandAddArg(cmd, "--netif_add");
virCommandAddArgBuffer(cmd, &buf);
} else if (net->type == VIR_DOMAIN_NET_TYPE_ETHERNET &&
- net->guestIP.nips > 0) {
+ net->guestIP.nips > 0) {
size_t i;
/* --ipadd ip */
@@ -1035,7 +1036,7 @@ openvzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int fla
driver->xmlopt) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not set number of vCPUs"));
- goto cleanup;
+ goto cleanup;
}
}
@@ -1043,7 +1044,7 @@ openvzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int fla
if (openvzDomainSetMemoryInternal(vm, vm->def->mem.cur_balloon) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not set memory size"));
- goto cleanup;
+ goto cleanup;
}
}
@@ -2068,7 +2069,7 @@ openvzUpdateDevice(virDomainDefPtr vmdef,
static int
openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
- unsigned int flags)
+ unsigned int flags)
{
int ret = -1;
int veid;