mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
ch: fix logic in virCHMonitorBuildPtyJson
There is a leftover 'ptys' variable, which we only assign to and one assignment to 'content', where we add an empty 'pty' object. Remove 'ptys'. Fixes: 93accefd9eca1bc3d7e923a979ab2d1b8a312ff7 Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Kristína Hanicová <khanicov@redhat.com>
This commit is contained in:
parent
f5dd918978
commit
096412f1ba
@ -88,8 +88,6 @@ virCHMonitorBuildCPUJson(virJSONValue *content, virDomainDef *vmdef)
|
||||
static int
|
||||
virCHMonitorBuildPTYJson(virJSONValue *content, virDomainDef *vmdef)
|
||||
{
|
||||
virJSONValue *ptys = virJSONValueNewObject();
|
||||
|
||||
if (vmdef->nconsoles) {
|
||||
g_autoptr(virJSONValue) pty = virJSONValueNewObject();
|
||||
if (virJSONValueObjectAppendString(pty, "mode", "Pty") < 0)
|
||||
@ -100,7 +98,7 @@ virCHMonitorBuildPTYJson(virJSONValue *content, virDomainDef *vmdef)
|
||||
|
||||
if (vmdef->nserials) {
|
||||
g_autoptr(virJSONValue) pty = virJSONValueNewObject();
|
||||
if (virJSONValueObjectAppendString(ptys, "mode", "Pty") < 0)
|
||||
if (virJSONValueObjectAppendString(pty, "mode", "Pty") < 0)
|
||||
return -1;
|
||||
if (virJSONValueObjectAppend(content, "serial", &pty) < 0)
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user