[libvirt] [PATCH 0/4] Misc clean-ups again

Just a couple of them this time. Martin Kletzander (4): rpc: Don't mix max_clients and max_workers in PostExecRestart virnetserver: Remove unnecessary double space gendispatch: Don't generate long lines Some alignment fixes in lxc_controller and jsontest src/lxc/lxc_controller.c | 16 ++++++++-------- src/rpc/gendispatch.pl | 5 +++-- src/rpc/virnetserver.c | 6 +++--- tests/jsontest.c | 12 ++++++------ 4 files changed, 20 insertions(+), 19 deletions(-) -- 2.4.0

This only affected the servers that re-exec themselves, which is only virtlockd and it didn't do any mess, so this is mostly a clenaup. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/rpc/virnetserver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 47d83ba..b061275 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -484,7 +484,7 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, goto error; } - if (!(srv = virNetServerNew(min_workers, max_clients, + if (!(srv = virNetServerNew(min_workers, max_workers, priority_workers, max_clients, max_anonymous_clients, keepaliveInterval, keepaliveCount, -- 2.4.0

Since we don't have syntax-check for this, it has to be checked manually. Let's hope this is the only place it happened. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/rpc/virnetserver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index b061275..42427dc 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -499,7 +499,7 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, goto error; } - n = virJSONValueArraySize(services); + n = virJSONValueArraySize(services); if (n < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Malformed services data in JSON document")); @@ -532,7 +532,7 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, goto error; } - n = virJSONValueArraySize(clients); + n = virJSONValueArraySize(clients); if (n < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Malformed clients data in JSON document")); -- 2.4.0

We don't allow it in normal code, why would it need to be in the generated one. IT also splits the line in perl code so it's readable. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/rpc/gendispatch.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index b642d6e..cb8e157 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# Copyright (C) 2010-2014 Red Hat, Inc. +# Copyright (C) 2010-2015 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -429,7 +429,8 @@ elsif ($mode eq "server") { print "{\n"; print " int rv;\n"; print " virThreadJobSet(\"$name\");\n"; - print " VIR_DEBUG(\"server=%p client=%p msg=%p rerr=%p args=%p ret=%p\", server, client, msg, rerr, args, ret);\n"; + print " VIR_DEBUG(\"server=%p client=%p msg=%p rerr=%p args=%p ret=%p\",\n"; + print " server, client, msg, rerr, args, ret);\n"; print " rv = $name(server, client, msg, rerr"; if ($argtype ne "void") { print ", args"; -- 2.4.0

Again, a clean-up for which we don't have proper syntax-check. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/lxc/lxc_controller.c | 16 ++++++++-------- tests/jsontest.c | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 4544cd0..ba44e09 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -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; diff --git a/tests/jsontest.c b/tests/jsontest.c index f27943e..f070649 100644 --- a/tests/jsontest.c +++ b/tests/jsontest.c @@ -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\": " -- 2.4.0

On 13.05.2015 14:14, Martin Kletzander wrote:
Just a couple of them this time.
Martin Kletzander (4): rpc: Don't mix max_clients and max_workers in PostExecRestart virnetserver: Remove unnecessary double space gendispatch: Don't generate long lines Some alignment fixes in lxc_controller and jsontest
src/lxc/lxc_controller.c | 16 ++++++++-------- src/rpc/gendispatch.pl | 5 +++-- src/rpc/virnetserver.c | 6 +++--- tests/jsontest.c | 12 ++++++------ 4 files changed, 20 insertions(+), 19 deletions(-)
ACK series Michal
participants (2)
-
Martin Kletzander
-
Michal Privoznik