[libvirt PATCH 3/4] ch: fix logic in virCHMonitorBuildPtyJson

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/ch/ch_monitor.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c
index 691d1ce64b..12c10da874 100644
--- a/src/ch/ch_monitor.c
+++ b/src/ch/ch_monitor.c
@@ -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;
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux