qmeventd: allow up to 100 columns per line

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-02-11 17:21:23 +01:00
parent 6d4f89b6a4
commit a2488e4c22

View File

@ -192,13 +192,11 @@ handle_qmp_event(struct Client *client, struct json_object *obj)
if (!json_object_object_get_ex(obj, "event", &event)) { if (!json_object_object_get_ex(obj, "event", &event)) {
return; return;
} }
VERBOSE_PRINT("%s: got QMP event: %s\n", client->qemu.vmid, VERBOSE_PRINT("%s: got QMP event: %s\n", client->qemu.vmid, json_object_get_string(event));
json_object_get_string(event));
if (client->state == STATE_TERMINATING) { if (client->state == STATE_TERMINATING) {
// QEMU sometimes sends a second SHUTDOWN after SIGTERM, ignore // QEMU sometimes sends a second SHUTDOWN after SIGTERM, ignore
VERBOSE_PRINT("%s: event was after termination, ignoring\n", VERBOSE_PRINT("%s: event was after termination, ignoring\n", client->qemu.vmid);
client->qemu.vmid);
return; return;
} }
@ -544,15 +542,13 @@ handle_client(struct Client *client)
break; break;
case json_tokener_continue: case json_tokener_continue:
if (client->buflen >= sizeof(client->buf)) { if (client->buflen >= sizeof(client->buf)) {
VERBOSE_PRINT("pid%d: msg too large, discarding buffer\n", VERBOSE_PRINT("pid%d: msg too large, discarding buffer\n", client->pid);
client->pid);
memset(client->buf, 0, sizeof(client->buf)); memset(client->buf, 0, sizeof(client->buf));
client->buflen = 0; client->buflen = 0;
} // else we have enough space try again after next read } // else we have enough space try again after next read
break; break;
default: default:
VERBOSE_PRINT("pid%d: parse error: %d, discarding buffer\n", VERBOSE_PRINT("pid%d: parse error: %d, discarding buffer\n", client->pid, jerr);
client->pid, jerr);
memset(client->buf, 0, client->buflen); memset(client->buf, 0, client->buflen);
client->buflen = 0; client->buflen = 0;
break; break;