mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-30 16:35:24 +00:00
Some alignment fixes in lxc_controller and jsontest
Again, a clean-up for which we don't have proper syntax-check. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
2cda7e1b89
commit
07df9e1f74
@ -454,7 +454,7 @@ static int virLXCControllerSetupLoopDeviceDisk(virDomainDiskDefPtr disk)
|
||||
cleanup:
|
||||
VIR_FREE(loname);
|
||||
if (ret < 0)
|
||||
VIR_FORCE_CLOSE(lofd);
|
||||
VIR_FORCE_CLOSE(lofd);
|
||||
|
||||
return lofd;
|
||||
|
||||
@ -1126,7 +1126,7 @@ static void virLXCControllerConsoleIO(int watch, int fd, int events, void *opaqu
|
||||
len = &console->fromContLen;
|
||||
avail = sizeof(console->fromContBuf) - *len;
|
||||
}
|
||||
reread:
|
||||
reread:
|
||||
done = read(fd, buf + *len, avail);
|
||||
if (done == -1 && errno == EINTR)
|
||||
goto reread;
|
||||
@ -1154,7 +1154,7 @@ static void virLXCControllerConsoleIO(int watch, int fd, int events, void *opaqu
|
||||
len = &console->fromHostLen;
|
||||
}
|
||||
|
||||
rewrite:
|
||||
rewrite:
|
||||
done = write(fd, buf, *len);
|
||||
if (done == -1 && errno == EINTR)
|
||||
goto rewrite;
|
||||
@ -1895,7 +1895,7 @@ static int virLXCControllerMoveInterfaces(virLXCControllerPtr ctrl)
|
||||
virDomainHostdevCaps hdcaps = hdev->source.caps;
|
||||
|
||||
if (hdcaps.type != VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET)
|
||||
continue;
|
||||
continue;
|
||||
|
||||
if (virNetDevSetNamespace(hdcaps.u.net.iface, ctrl->initpid) < 0)
|
||||
return -1;
|
||||
@ -1985,7 +1985,7 @@ lxcCreateTty(virLXCControllerPtr ctrl, int *ttymaster,
|
||||
* anything other than 0, but let's play it safe. */
|
||||
if ((virAsprintf(ttyName, "/dev/pts/%d", ptyno) < 0) ||
|
||||
(virAsprintf(ttyHostPath, "/%s/%s.devpts/%d", LXC_STATE_DIR,
|
||||
ctrl->def->name, ptyno) < 0)) {
|
||||
ctrl->def->name, ptyno) < 0)) {
|
||||
errno = ENOMEM;
|
||||
goto cleanup;
|
||||
}
|
||||
@ -2101,7 +2101,7 @@ virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
|
||||
|
||||
if ((lxcContainerChown(ctrl->def, ctrl->devptmx) < 0) ||
|
||||
(lxcContainerChown(ctrl->def, devpts) < 0))
|
||||
goto cleanup;
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
||||
@ -2139,7 +2139,7 @@ virLXCControllerSetupConsoles(virLXCControllerPtr ctrl,
|
||||
&ctrl->consoles[i].contFd,
|
||||
&containerTTYPaths[i], &ttyHostPath) < 0) {
|
||||
virReportSystemError(errno, "%s",
|
||||
_("Failed to allocate tty"));
|
||||
_("Failed to allocate tty"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -2429,7 +2429,7 @@ int main(int argc, char *argv[])
|
||||
int c;
|
||||
|
||||
c = getopt_long(argc, argv, "dn:v:p:m:c:s:h:S:",
|
||||
options, NULL);
|
||||
options, NULL);
|
||||
|
||||
if (c == -1)
|
||||
break;
|
||||
|
@ -71,7 +71,7 @@ testJSONAddRemove(const void *data)
|
||||
case 1:
|
||||
if (!info->pass) {
|
||||
VIR_TEST_VERBOSE("should not remove from non-object %s\n",
|
||||
info->doc);
|
||||
info->doc);
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
@ -83,17 +83,17 @@ testJSONAddRemove(const void *data)
|
||||
goto cleanup;
|
||||
default:
|
||||
VIR_TEST_VERBOSE("unexpected result when removing from %s\n",
|
||||
info->doc);
|
||||
info->doc);
|
||||
goto cleanup;
|
||||
}
|
||||
if (STRNEQ_NULLABLE(virJSONValueGetString(name), "sample")) {
|
||||
VIR_TEST_VERBOSE("unexpected value after removing name: %s\n",
|
||||
NULLSTR(virJSONValueGetString(name)));
|
||||
NULLSTR(virJSONValueGetString(name)));
|
||||
goto cleanup;
|
||||
}
|
||||
if (virJSONValueObjectRemoveKey(json, "name", NULL)) {
|
||||
VIR_TEST_VERBOSE("%s",
|
||||
"unexpected success when removing missing key\n");
|
||||
"unexpected success when removing missing key\n");
|
||||
goto cleanup;
|
||||
}
|
||||
if (virJSONValueObjectAppendString(json, "newname", "foo") < 0) {
|
||||
@ -139,8 +139,8 @@ mymain(void)
|
||||
|
||||
DO_TEST_PARSE("Simple", "{\"return\": {}, \"id\": \"libvirt-1\"}");
|
||||
DO_TEST_PARSE("NotSoSimple", "{\"QMP\": {\"version\": {\"qemu\":"
|
||||
"{\"micro\": 91, \"minor\": 13, \"major\": 0},"
|
||||
"\"package\": \" (qemu-kvm-devel)\"}, \"capabilities\": []}}");
|
||||
"{\"micro\": 91, \"minor\": 13, \"major\": 0},"
|
||||
"\"package\": \" (qemu-kvm-devel)\"}, \"capabilities\": []}}");
|
||||
|
||||
|
||||
DO_TEST_PARSE("Harder", "{\"return\": [{\"filename\": "
|
||||
|
Loading…
x
Reference in New Issue
Block a user