mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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: 93accefd9e
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
|
static int
|
||||||
virCHMonitorBuildPTYJson(virJSONValue *content, virDomainDef *vmdef)
|
virCHMonitorBuildPTYJson(virJSONValue *content, virDomainDef *vmdef)
|
||||||
{
|
{
|
||||||
virJSONValue *ptys = virJSONValueNewObject();
|
|
||||||
|
|
||||||
if (vmdef->nconsoles) {
|
if (vmdef->nconsoles) {
|
||||||
g_autoptr(virJSONValue) pty = virJSONValueNewObject();
|
g_autoptr(virJSONValue) pty = virJSONValueNewObject();
|
||||||
if (virJSONValueObjectAppendString(pty, "mode", "Pty") < 0)
|
if (virJSONValueObjectAppendString(pty, "mode", "Pty") < 0)
|
||||||
@ -100,7 +98,7 @@ virCHMonitorBuildPTYJson(virJSONValue *content, virDomainDef *vmdef)
|
|||||||
|
|
||||||
if (vmdef->nserials) {
|
if (vmdef->nserials) {
|
||||||
g_autoptr(virJSONValue) pty = virJSONValueNewObject();
|
g_autoptr(virJSONValue) pty = virJSONValueNewObject();
|
||||||
if (virJSONValueObjectAppendString(ptys, "mode", "Pty") < 0)
|
if (virJSONValueObjectAppendString(pty, "mode", "Pty") < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virJSONValueObjectAppend(content, "serial", &pty) < 0)
|
if (virJSONValueObjectAppend(content, "serial", &pty) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user