mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-06 09:55:46 +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:
|
cleanup:
|
||||||
VIR_FREE(loname);
|
VIR_FREE(loname);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
VIR_FORCE_CLOSE(lofd);
|
VIR_FORCE_CLOSE(lofd);
|
||||||
|
|
||||||
return lofd;
|
return lofd;
|
||||||
|
|
||||||
@ -1126,7 +1126,7 @@ static void virLXCControllerConsoleIO(int watch, int fd, int events, void *opaqu
|
|||||||
len = &console->fromContLen;
|
len = &console->fromContLen;
|
||||||
avail = sizeof(console->fromContBuf) - *len;
|
avail = sizeof(console->fromContBuf) - *len;
|
||||||
}
|
}
|
||||||
reread:
|
reread:
|
||||||
done = read(fd, buf + *len, avail);
|
done = read(fd, buf + *len, avail);
|
||||||
if (done == -1 && errno == EINTR)
|
if (done == -1 && errno == EINTR)
|
||||||
goto reread;
|
goto reread;
|
||||||
@ -1154,7 +1154,7 @@ static void virLXCControllerConsoleIO(int watch, int fd, int events, void *opaqu
|
|||||||
len = &console->fromHostLen;
|
len = &console->fromHostLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
rewrite:
|
rewrite:
|
||||||
done = write(fd, buf, *len);
|
done = write(fd, buf, *len);
|
||||||
if (done == -1 && errno == EINTR)
|
if (done == -1 && errno == EINTR)
|
||||||
goto rewrite;
|
goto rewrite;
|
||||||
@ -1895,7 +1895,7 @@ static int virLXCControllerMoveInterfaces(virLXCControllerPtr ctrl)
|
|||||||
virDomainHostdevCaps hdcaps = hdev->source.caps;
|
virDomainHostdevCaps hdcaps = hdev->source.caps;
|
||||||
|
|
||||||
if (hdcaps.type != VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET)
|
if (hdcaps.type != VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (virNetDevSetNamespace(hdcaps.u.net.iface, ctrl->initpid) < 0)
|
if (virNetDevSetNamespace(hdcaps.u.net.iface, ctrl->initpid) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -1985,7 +1985,7 @@ lxcCreateTty(virLXCControllerPtr ctrl, int *ttymaster,
|
|||||||
* anything other than 0, but let's play it safe. */
|
* anything other than 0, but let's play it safe. */
|
||||||
if ((virAsprintf(ttyName, "/dev/pts/%d", ptyno) < 0) ||
|
if ((virAsprintf(ttyName, "/dev/pts/%d", ptyno) < 0) ||
|
||||||
(virAsprintf(ttyHostPath, "/%s/%s.devpts/%d", LXC_STATE_DIR,
|
(virAsprintf(ttyHostPath, "/%s/%s.devpts/%d", LXC_STATE_DIR,
|
||||||
ctrl->def->name, ptyno) < 0)) {
|
ctrl->def->name, ptyno) < 0)) {
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -2101,7 +2101,7 @@ virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
|
|||||||
|
|
||||||
if ((lxcContainerChown(ctrl->def, ctrl->devptmx) < 0) ||
|
if ((lxcContainerChown(ctrl->def, ctrl->devptmx) < 0) ||
|
||||||
(lxcContainerChown(ctrl->def, devpts) < 0))
|
(lxcContainerChown(ctrl->def, devpts) < 0))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -2139,7 +2139,7 @@ virLXCControllerSetupConsoles(virLXCControllerPtr ctrl,
|
|||||||
&ctrl->consoles[i].contFd,
|
&ctrl->consoles[i].contFd,
|
||||||
&containerTTYPaths[i], &ttyHostPath) < 0) {
|
&containerTTYPaths[i], &ttyHostPath) < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
_("Failed to allocate tty"));
|
_("Failed to allocate tty"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2429,7 +2429,7 @@ int main(int argc, char *argv[])
|
|||||||
int c;
|
int c;
|
||||||
|
|
||||||
c = getopt_long(argc, argv, "dn:v:p:m:c:s:h:S:",
|
c = getopt_long(argc, argv, "dn:v:p:m:c:s:h:S:",
|
||||||
options, NULL);
|
options, NULL);
|
||||||
|
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
break;
|
break;
|
||||||
|
@ -71,7 +71,7 @@ testJSONAddRemove(const void *data)
|
|||||||
case 1:
|
case 1:
|
||||||
if (!info->pass) {
|
if (!info->pass) {
|
||||||
VIR_TEST_VERBOSE("should not remove from non-object %s\n",
|
VIR_TEST_VERBOSE("should not remove from non-object %s\n",
|
||||||
info->doc);
|
info->doc);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -83,17 +83,17 @@ testJSONAddRemove(const void *data)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
default:
|
default:
|
||||||
VIR_TEST_VERBOSE("unexpected result when removing from %s\n",
|
VIR_TEST_VERBOSE("unexpected result when removing from %s\n",
|
||||||
info->doc);
|
info->doc);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (STRNEQ_NULLABLE(virJSONValueGetString(name), "sample")) {
|
if (STRNEQ_NULLABLE(virJSONValueGetString(name), "sample")) {
|
||||||
VIR_TEST_VERBOSE("unexpected value after removing name: %s\n",
|
VIR_TEST_VERBOSE("unexpected value after removing name: %s\n",
|
||||||
NULLSTR(virJSONValueGetString(name)));
|
NULLSTR(virJSONValueGetString(name)));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virJSONValueObjectRemoveKey(json, "name", NULL)) {
|
if (virJSONValueObjectRemoveKey(json, "name", NULL)) {
|
||||||
VIR_TEST_VERBOSE("%s",
|
VIR_TEST_VERBOSE("%s",
|
||||||
"unexpected success when removing missing key\n");
|
"unexpected success when removing missing key\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virJSONValueObjectAppendString(json, "newname", "foo") < 0) {
|
if (virJSONValueObjectAppendString(json, "newname", "foo") < 0) {
|
||||||
@ -139,8 +139,8 @@ mymain(void)
|
|||||||
|
|
||||||
DO_TEST_PARSE("Simple", "{\"return\": {}, \"id\": \"libvirt-1\"}");
|
DO_TEST_PARSE("Simple", "{\"return\": {}, \"id\": \"libvirt-1\"}");
|
||||||
DO_TEST_PARSE("NotSoSimple", "{\"QMP\": {\"version\": {\"qemu\":"
|
DO_TEST_PARSE("NotSoSimple", "{\"QMP\": {\"version\": {\"qemu\":"
|
||||||
"{\"micro\": 91, \"minor\": 13, \"major\": 0},"
|
"{\"micro\": 91, \"minor\": 13, \"major\": 0},"
|
||||||
"\"package\": \" (qemu-kvm-devel)\"}, \"capabilities\": []}}");
|
"\"package\": \" (qemu-kvm-devel)\"}, \"capabilities\": []}}");
|
||||||
|
|
||||||
|
|
||||||
DO_TEST_PARSE("Harder", "{\"return\": [{\"filename\": "
|
DO_TEST_PARSE("Harder", "{\"return\": [{\"filename\": "
|
||||||
|
Loading…
Reference in New Issue
Block a user